Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Draw text in video FFMPEG
#ffmpeg -f lavfi -i color=white:s=1920x1080:r=1 -preset ultrafast -t 60 -vf "drawtext=text='Full HD (1920x1080)':enable='between(t,0,20)':fontcolor=red:fontsize=124:x=(w-tw)/2:y=20, drawtext=text='Full HD (1920x1080)':enable='between(t,5,25)':fontcolor=blue:fontsize=124:x=(w-tw)/2:y=200, drawtext=text='Full HD (1920x1080)':enable='between(t,10,30)':fontcolor=green:fontsize=124:x=(w-tw)/2:y=380, drawtext=text='Full HD (1920x1080)':enable='between(t,15,35)':fontcolor=yellow:fontsize=124:x=(w-tw)/2:y=560, drawtext=text='Full HD (1920x1080)':enable='between(t,20,40)':fontcolor=pink:fontsize=124:x=(w-tw)/2:y=740, drawtext=text='Full HD (1920x1080)':enable='between(t,25,45)':fontcolor=cyan:fontsize=124:x=(w-tw)/2:y=920" _.mp4
ffmpeg version N-94664-g0821bc4eee Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.101 / 58. 55.101
libavformat 58. 31.104 / 58. 31.104
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.101 / 7. 58.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, lavfi, from 'color=white:s=1920x1080:r=1':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1 fps, 1 tbr, 1 tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Fontconfig error: Cannot load default config file
[Parsed_drawtext_0 @ 0000021b37879700] Using "C:/WINDOWS/fonts/mingliub.ttc"
Fontconfig error: Cannot load default config file
[Parsed_drawtext_1 @ 0000021b37fc6cc0] Using "C:/WINDOWS/fonts/mingliub.ttc"
Fontconfig error: Cannot load default config file
[Parsed_drawtext_2 @ 0000021b37fc5cc0] Using "C:/WINDOWS/fonts/mingliub.ttc"
Fontconfig error: Cannot load default config file
[Parsed_drawtext_3 @ 0000021b37fc5fc0] Using "C:/WINDOWS/fonts/mingliub.ttc"
Fontconfig error: Cannot load default config file
[Parsed_drawtext_4 @ 0000021b37fc6ac0] Using "C:/WINDOWS/fonts/mingliub.ttc"
Fontconfig error: Cannot load default config file
[Parsed_drawtext_5 @ 0000021b37fc71c0] Using "C:/WINDOWS/fonts/mingliub.ttc"
[libx264 @ 0000021b37903880] using SAR=1/1
[libx264 @ 0000021b37903880] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000021b37903880] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit
[libx264 @ 0000021b37903880] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=1 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '_.mp4':
Metadata:
encoder : Lavf58.31.104
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 1 fps, 16384 tbn, 1 tbc
Metadata:
encoder : Lavc58.55.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
frame= 60 fps=0.0 q=-1.0 Lsize= 311kB time=00:00:59.00 bitrate= 43.2kbits/s speed= 108x
video:310kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.337916%
[libx264 @ 0000021b37903880] frame I:1 Avg QP:20.00 size: 33085
[libx264 @ 0000021b37903880] frame P:59 Avg QP: 2.58 size: 4816
[libx264 @ 0000021b37903880] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0000021b37903880] mb P I16..4: 0.8% 0.0% 0.0% P16..4: 1.2% 0.0% 0.0% 0.0% 0.0% skip:98.0%
[libx264 @ 0000021b37903880] coded y,uvDC,uvAC intra: 11.5% 12.3% 12.1% inter: 0.5% 0.9% 0.8%
[libx264 @ 0000021b37903880] i16 v,h,dc,p: 96% 3% 1% 0%
[libx264 @ 0000021b37903880] i8c dc,h,v,p: 88% 3% 10% 0%
[libx264 @ 0000021b37903880] kb/s:42.30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment