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.mp4What each flag does
| -i input.mov | Source file — works for .mov, .avi, .mkv, .webm, or nearly any container FFmpeg can decode. |
| -c:v libx264 | Encodes to H.264, playable on essentially every device and platform. |
| -crf 20 | Visually near-lossless for most content — go lower only if you're archiving a master. |
| -preset medium | A balanced speed/compression tradeoff — the FFmpeg default and a sensible one. |
| -c:a aac -b:a 192k | Encodes 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.
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