First frame of our input movie:
ffmpeg -i input.mov -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:expansion=normal: text='%{pts \\: hms}': fontcolor=white:fontsize=48: x=(w-text_w)/2: y=h-th-10: box=1: boxcolor=black: boxborderw=5: line_spacing=32" -vcodec libx264 -vb 2600k -strict -2 -preset slower -f mp4 -an timestamp_clock.mp4
In the first step we take our input movie input.mov and add at bottom center a black box with white timestamp text on it.
ffmpeg -i timestamp_clock.mp4 -an -vf "setpts=PTS/35" speedup_timestamp.mp4
Here, we speed up the video to make the "timelapse". We speed it up 35 times which you can easily change in the command.
ffmpeg -i speedup_timestampImage 03-11-2020 at 17.05.jpeg.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:expansion=normal: text='x35 speed': fontcolor=orange:fontsize=48: x=(w-text_w)/2: y=h-th-60" -vcodec libx264 -vb 2600k -strict -2 -preset slower -f mp4 timestamp_final.mp4
In the last step we add information about how much the video is speed up right above our clock.
ffmpeg -i timestamp_final.mp4 -loop -1 timestamp_final.gif
And at last we generate GIF out of our MP4. Here, you can change value of the -loop
setting:
use -1
for no loop, 0
for looping indefinitely (default).