Reverse a video for boomerang effect
useful tips
// what it does
Builds a ping-pong loop with filter_complex: split duplicates the stream into [fwd] and [rev], reverse plays the copy backward, and concat=n=2:v=1:a=0 joins forward-then-backward into one seamless cycle with no audio. loop=3:size=999 then buffers the first 999 frames of that concatenated segment and repeats it. The result is the classic boomerang bounce that reads as a short seamless loop.
// shell
$ ffmpeg -i input.mp4 -filter_complex "[0:v]split[fwd][rev];[rev]reverse[r];[fwd][r]concat=n=2:v=1:a=0,loop=3:size=999" output.mp4// gotcha
The reverse filter must hold every frame of the input in RAM to emit them backward, so long or high-resolution clips can exhaust memory; and size=999 caps the loop buffer at 999 frames (max is 32767), so a concatenated segment longer than that won't loop in full.