Add Frame Numbers to Video

To burn the frame number into your video:

ffmpeg -i input.mp4 -vf "drawtext=fontfile=Helvetica.ttf: text='%{frame_num}': start_number=1: x=(w-tw-lh): y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5" -c:a copy output.mp4

If you prefer that the numbering starts at 0 instead of 1 you can change the start_number parameter to 0:

ffmpeg -i input.mp4 -vf "drawtext=fontfile=Helvetica.ttf: text='%{frame_num}': start_number=0: x=(w-tw-lh): y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5" -c:a copy output.mp4