FFmpeg recipe

FFmpeg: Reverse a Video (Audio + Video)

reverse filters the entire video backward — note that it loads everything into memory, so works best on short clips.

Command

ffmpeg -i input.mp4 -vf reverse -af areverse -c:v libx264 -crf 23 -y output_reversed.mp4
Prefer no terminal?
Use the Video Reverse in your browser
Open Video Reverse →

What each flag does

-iInput file. Can be a video, audio, or image. Repeat for multiple inputs.
-vfVideo filter chain. e.g. scale=1280:720, crop=, fps=30.
-afAudio filter chain. e.g. silenceremove, loudnorm.
-c:vVideo codec for output. e.g. libx264, libx265, libvpx-vp9.
-crfConstant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264.
reverseVideo filter that buffers the entire stream and emits it in reverse.
areverseAudio counterpart of reverse. Often paired together.

Notes & gotchas

  • Both filters require the entire stream in memory — keep clips under 1 minute or use a workstation with lots of RAM.
  • For boomerang-style loops, use the loop recipe and append a reversed copy.

Check it worked

ffprobe -v error -show_entries format=duration -of csv=p=0 output.mp4

The same duration as the source. A shorter file means the reverse filter ran out of memory.

What to change

It holds the whole clip in memoryreverse buffers every frame. A few seconds is fine; a few minutes of 1080p will exhaust RAM.
Drop areverseReversed speech is unusable. -an gives a silent clip, which is what most reversed video wants.
Trim firstReverse the shortest section that matters rather than the whole file. It is the difference between seconds and minutes.

If it fails

FFmpeg is killed, or memory use climbs until the machine stalls.

Why: The reverse filter buffers every frame in memory, because it cannot know the last frame until it has read them all.

Fix: Split the clip into short segments, reverse each, then concatenate them in reverse order.

The picture is reversed but the audio still plays forwards.

Why: The reverse filter handles video only.

Fix: Add areverse for the audio stream.

Related recipes