Skip to content

Burn Frame Number

George Stoyanov edited this page Sep 25, 2017 · 5 revisions

How to Cut Video in FFMPEG

ffmpeg -i <input> \
-vf "drawtext=fontfile=Arial.ttf: text=%{n}: x=(w-tw)/2: y=h-(2*lh): fontsize=20: fontcolor=white: box=1: boxcolor=0x00000099" \
-c:v libx264 \
-x264opts nal-hrd=cbr -b:v 60M -minrate:v 60M -maxrate:v 60M -muxrate 70M -bufsize:v 120M \
-c:a aac -ac 2 -b:a 128k \
-f mpegts <output.ts>

Please note that when you are using the -vf video filter option you need always to encode the video. In this example the font size is in pixels, so I would suggest using different -fontsize depending on the output resolution. For SD 20 should be fine, for HD, 50 and for UHD 100.