Video timelapses with FFmpeg

21 Jan 2025

An artist friend took videos of her art creation process and asked for assistance converting them into per-artwork timelapse recordings. Let’s document the steps for my future self!

Task

For the given recordings, finding the cut points for the first and last steps could easily be done manually.1

Prerequisite

Install commandline video editing tool FFmpeg.

Steps

After viewing a recording and making note of the timestamps around a specific artwork’s creation (in this example, 00:25:16 to 00:42:34):

# Trim into new file, remove audio
ffmpeg -i INPUT.mp4 -ss 00:25:16 -to 00:42:34 -c:v copy -c:a copy -an ARTWORK_A.mp4

# Speed it up into a 4x timelapse, update framerate=60fps, rotate 90 degrees
ffmpeg -i ARTWORK_A.mp4 -vf "setpts=PTS/4,fps=60,transpose=2" ARTWORK_A_4x.mp4

# Trim out region with inactivity (00:03:39 to 00:04:17)
ffmpeg -i ARTWORK_A_4x.mp4 -vf  "select='not(between(t,219,257))',setpts=N/FRAME_RATE/TB" ARTWORK_A_4x_trimmed.mp4

Footnotes

  1. If the recordings were longer (or if there were more of them), I’d probably automate that step—I considered it here, because it would be fun, and then decided that it failed xkcd’s Is It Worth the Time test: ↩︎