To reverse a video with ffmpeg, run the reverse video filter and write the result to a new file:
ffmpeg -i input.mp4 -vf reverse reversed.mp4That plays the picture backwards but leaves the audio untouched, so the sound runs forward over a reversed image. To reverse the sound too, add the areverse audio filter:
ffmpeg -i input.mp4 -vf reverse -af areverse reversed.mp4The single most important thing on this page is the output filename. Use a name that is different from the input. A common copy-pasted command reverses a file onto itself (ffmpeg -i clip.mp4 -vf reverse clip.mp4), and ffmpeg opens that same file for writing while it is still reading from it. The result is a truncated, corrupted clip and a lost original. There is no undo. Always reverse into a fresh path.
Reverse the picture only (drop the audio)
If you want a silent reversed clip, do not reverse the audio backwards, just discard it. -an means "no audio":
ffmpeg -i input.mp4 -vf reverse -an reversed.mp4This is the right command for a reversed loop, a boomerang-style effect, or any clip where the original audio would be noise played backwards. Dropping the track is also faster and uses less memory than reversing it.
Reverse both the picture and the sound
For a clip where the reversed audio is the point (speech played backwards, a sound effect run in reverse), pair the two filters. -vf is the video filter chain, -af is the audio filter chain:
ffmpeg -i input.mp4 -vf reverse -af areverse reversed.mp4reverse flips the order of the video frames; areverse flips the order of the audio samples. Run them together and the whole clip plays end-to-start, picture and sound in step.
Why you should trim first: the memory trap
Here is the catch that bites people on anything longer than a short clip: the reverse filter buffers the entire video stream into memory before it can write the first reversed frame. It has to, because the last frame of the input becomes the first frame of the output, so ffmpeg cannot emit anything until it has read everything. A few seconds of 1080p is fine. A feature-length file will exhaust your RAM, swap hard, or get killed outright.
So reverse a segment, not the whole movie. Trim the part you actually want first, then reverse that. Seeking before -i makes the cut fast, and the trimmed file is what you reverse:
# Cut a ~4 second segment from around 12 seconds, no re-encode
# -c copy snaps to the nearest keyframe, so the cut is fast but not frame-exact
ffmpeg -ss 00:00:12 -t 4 -i input.mp4 -c copy segment.mp4
# Reverse the short segment (cheap on memory)
ffmpeg -i segment.mp4 -vf reverse -af areverse reversed.mp4You can also do it in one command with the trim filters, but the two-step version is easier to reason about and lets you check the segment before you commit to reversing it. See trim and cut a video with ffmpeg for the full set of trimming options, including -to for an absolute end timestamp and the keyframe-versus-frame-accurate tradeoff.
areverse is cheaper on memory than reverse because audio samples are tiny next to decoded video frames, but it still buffers the whole audio stream. The video side is the one that hurts, so the trim-first rule is about the picture.
If a video genuinely must be reversed in full and it does not fit in RAM, the workaround is to split it into chunks, reverse each chunk, then concatenate them back together in reverse chunk order. That is a real technique but a rare need; for almost everything, trim the segment you want and reverse that.
A note on quality
-vf reverse re-encodes the video (you cannot stream-copy a filtered stream), so the output is a fresh encode at ffmpeg's defaults. If you care about the encode, add the usual libx264 controls:
ffmpeg -i segment.mp4 -vf reverse -af areverse -c:v libx264 -crf 18 -preset slow reversed.mp4Lower -crf is higher quality (18 is visually near-lossless for x264); -preset slow spends more time for a smaller file. These are the same knobs covered in the ffmpeg commands cheat sheet.
FAQ
See also
- Trim and cut a video with ffmpeg: cut the segment you want before you reverse it, with
-ss,-t, and-to. - Speed up or slow down a video with ffmpeg: the
setptsandatempofilters, the other half of time-warping a clip. - The ffmpeg commands cheat sheet: every common task in one reference, with the modern flags.
Sources
Authoritative references this article was fact-checked against.





