FFmpeg · Command Guide

How to Convert Any Video to MP4 With FFmpeg

MP4 with H.264 video and AAC audio is the most universally compatible combination — this converts almost any input format into that baseline.

MP4 with H.264 video and AAC audio is the most universally compatible combination — this converts almost any input format into that baseline.

The command

ffmpeg -i input.mov -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 192k output.mp4

What each flag does

-i input.movSource file — works for .mov, .avi, .mkv, .webm, or nearly any container FFmpeg can decode.
-c:v libx264Encodes to H.264, playable on essentially every device and platform.
-crf 20Visually near-lossless for most content — go lower only if you're archiving a master.
-preset mediumA balanced speed/compression tradeoff — the FFmpeg default and a sensible one.
-c:a aac -b:a 192kEncodes audio to AAC at a bitrate that's transparent for speech and most music.

Where this goes wrong

If the source file already contains H.264 video, re-encoding it again with this command is a wasted step that can only lose quality, never gain it. Check the source codec first (ffprobe input.mov) — if it's already H.264/AAC in an incompatible container, you can remux instead: ffmpeg -i input.mov -c copy output.mp4, which is instant and lossless.

After the command

Once your footage is in a clean, standard format, it's ready for the next step — adding structure, captions, and motion with a template instead of building each one by hand.

See the templates

Common questions

What if the remux command fails?+
It means the container needs the streams re-encoded, not just repackaged — usually because the codec inside isn't H.264/AAC. Fall back to the full re-encoding command.
Is CRF or a fixed bitrate better?+
CRF for most cases — it targets consistent quality and lets file size vary with content complexity, which is more efficient than a fixed bitrate.
Why does my converted file look worse than the original?+
Either the CRF value is too high (try a lower number, e.g. 18) or the source was already compressed and you're compounding compression artifacts.