To reverse a video with ffmpeg, use the reverse video filter for the picture and the areverse audio filter for the sound, and write the result to a new file. To reverse both picture and sound:
ffmpeg -i in.mp4 -vf reverse -af areverse out.mp4The one caveat to know up front: the reverse filter buffers the entire clip into memory before it can write a single frame, so it is fine for short clips but memory-heavy on long videos. For anything more than a few seconds, trim the segment you want first and reverse that (more on this below).
If you only want the picture reversed and don't care about the audio, drop -af areverse:
ffmpeg -i in.mp4 -vf reverse out.mp4That plays the picture backwards but leaves the audio untouched, so the sound runs forward over a reversed image. Adding -af areverse flips the audio samples too, so picture and sound play end-to-start together.
The 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
You almost certainly used the same filename for input and output, for example ffmpeg -i clip.mp4 -vf reverse clip.mp4. ffmpeg opens that file for writing while still reading it, which truncates the source. Always write to a new path like reversed.mp4, and there is no recovery once the original is overwritten.
Add the areverse audio filter next to the video reverse filter: ffmpeg -i input.mp4 -vf reverse -af areverse reversed.mp4. The reverse filter flips the video frames and areverse flips the audio samples, so both play end-to-start together.
Drop the audio with -an instead of reversing it: ffmpeg -i input.mp4 -vf reverse -an reversed.mp4. This is the right choice for loops and boomerang effects where backwards audio would just be noise.
The reverse filter has to read the entire stream into memory before it can write the first reversed frame, because the last input frame becomes the first output frame. On a long file that exhausts your RAM. Trim the segment you want first, then reverse the short clip.
Yes, and you should. Cut the segment first with -ss and -t (or -c copy for a fast lossless cut), then run the reverse filter on that segment. This is both the correct way to get a partial reversal and the way to avoid the memory problem.
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.





