Recherche avancée

Médias (1)

Mot : - Tags -/berlin

Autres articles (78)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

Sur d’autres sites (8684)

  • How to make customizable subtitles with FFmpeg ?

    6 août 2022, par Alex Rypun

    I need to generate videos with text (aka subtitles) and styles provided by users.
The styles are a few fonts, text border, text background, text shadow, colors, position on the video, etc.

    


    As I understand there are 2 filters I can use : drawtext and subtitles.

    


    subtitles is easier to use but it's not fully customizable. For example, I can't add shadow and background for the same text.

    


    drawtext is more customizable but quite problematic.

    


    I've implemented almost everything I need with drawtext but have one problem : multiline text with a background.

    


    boxborderw parameter adds specified pixels count from all 4 sides from the extreme text point. I need to make backgrounds touch each other (pixel perfect). That means I have to position text lines with the same space between extreme text points (not between baselines). With crazy workarounds I solved it.
Everything almost works but sometimes some strange border appears between lines :

    


    enter image description here

    


    Spending ages investigating I figured out that it depends on the actual line height and the position on the video.
Each letter has its own distances between baseline and the highest point and between baseline and the lowest point.
The whole line height is the difference between the highest point of the highest symbol and the lowest point of the lowest symbol :

    


    enter image description here

    


    Now the most interesting.

    


    For lines that have even pixels height.

    


    If the line is positioned on the odd pixel (y-axis) and has an odd boxborderw (or positioned on the even pixel (y-axis) and has an even boxborderw ), then it's rendered as expected (without any additional borders).
In other cases, the thin dark line is noticeable on the contact line (it's rendered either on top or at bottom of each text block :

    


    enter image description here

    

    


    For lines that have odd pixels height.

    


    In all cases the thin dark line is noticeable. Depending on y coordinate (odd or even) and boxborderw value (odd or even) that magic line appears on top or bottom :

    


    enter image description here

    


    I can make text lines overlap a bit. This solves the problem but adds another problem.
I use fade-in/out by smoothly changing alfa (transparency). When the text becomes semi-transparent the overlapped area has a different color :

    


    enter image description here

    


    Here is the command I use :

    


    ffmpeg "-y" "-f" "lavfi" "-i" "color=#ffffff" "-filter_complex" \
"[0:v]loop=-1:1:0,trim=duration=2.00,format=yuv420p,scale=960:540,setdar=16/9[video];\
[video]drawtext=text='qqq':\
fontfile=ComicSansMS.ttf:\
fontcolor=#ffffff:\
fontsize=58:\
bordercolor=#000000:\
borderw=2:\
box=1:\
boxcolor=#ff0000:\
boxborderw=15:\
x=(w-text_w)/2:\
y=105:\
alpha='if(lt(t,0),0,if(lt(t,0.5),(t-0)/0.5,if(lt(t,1.49),1,if(lt(t,1.99),(0.5-(t-1.49))/0.5,0))))',\
drawtext=text='qqq':\
fontfile=ComicSansMS.ttf:\
fontcolor=#ffffff:\
fontsize=58:\
bordercolor=#000000:\
borderw=2:\
box=1:\
boxcolor=#ff0000:\
boxborderw=15:\
x=(w-text_w)/2:\
y=182:\
alpha='if(lt(t,0),0,if(lt(t,0.5),(t-0)/0.5,if(lt(t,1.49),1,if(lt(t,1.99),(0.5-(t-1.49))/0.5,0))))'[video]" \
"-vsync" "2" "-map" "[video]" "-r" "25" "output_multiline.mp4"


    


    I tried to draw rectangles with drawbox following the same logic (changing the position and height). But there were no problems.

    


    Does anybody know what is the nature of that dark line ?
And how it can depend on the even/odd of the height and position ?
What should I investigate to figure out such a behavior ?

    


    UPD :

    


    Just accidentally figured out that changing the pixel format (from format=yuv420p to format=uyvy422 or many others) solved the problem. At least on my test commands.
Now will learn about what is pixel format)

    


  • Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (360p.m3u 8) has not been used for any stream.

    28 avril, par Marc Archenault

    I am receiving this warning from ffmpeg. The job runs and all the videos seem to output correctly. I have 2 hls, 1 mp4 with overlay + A single thumbnail.

    



    The warning :

    



    Stream #1:0 : Video : png, rgba(pc), 500x38, 25 tbr, 25 tbn, 25 tbc
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (360p.m3u
8) has not been used for any stream. The most likely reason is either wrong type
 (e.g. a video option with no video streams) or that it is a private option of s
ome encoder which was not actually used for any stream.

    



    The windows batch command :

    



    ffmpeg -loglevel info -threads 2 -hide_banner -y -i SampleVideo_1280x720_10mb.mp4 -i ecocastvideo-overlay-shadow-white-500.png^
 -filter_complex "[1]colorchannelmixer=aa=0.7,scale=iw*0.7 :-1[wm] ;[0:v][wm]overlay=(main_w-overlay_w)-10 :(main_h-overlay_h)-30,split=3[a][b][c] ;[a]scale=w=640:h=360:force_original_aspect_ratio=decrease[a] ;[b]scale=w=1280:h=720:force_original_aspect_ratio=decrease[b] ;[c]scale=w=1280:h=720:force_original_aspect_ratio=decrease[c]"^
 -map "[a]" -map 0:v -c:v h264 -profile:v main -crf 20 -preset veryfast -sc_threshold 0 -g 72 -keyint_min 72 -hls_time 4 -hls_playlist_type vod -b:a 96k -hls_flags single_file 360p.m3u8^
 -map "[b]" -map 0:v -c:v h264 -profile:v main -crf 20 -preset veryfast -sc_threshold 0 -g 72 -keyint_min 72 -hls_time 4 -hls_playlist_type vod -b:a 96k -hls_flags single_file 720p.m3u8^
 -map "[c]" -map 0:v -c:v h264 -profile:v main -preset veryfast 720.mp4^
 -map 0:v -y -ss 0.5 -vframes 1 -an -s 120x90 -ss 30 thumbname-00001.png

    


  • How to detetc hardware acceleration in ffmpeg

    19 décembre 2020, par Ali Razmkhah

    I am writing c++ program to screen record by ffmpeg 4.3 ! I need to detect hardware acceleration support such as h264_qsv or h264_nvenc without running ffmpeg.exe !

    


    I explored ffmpeg.exe source code and found no results ! some solutions are deprecated or dose not work on 4.3 !
As instance,

    


    avcodec_find_encoder_by_name("h264_qsv")


    


    returns null even it is exist and works properly !