10/13/2025
Convert MOV, MKV, AVI, WebM, and other video formats to MP4 with FFmpeg. Learn when to use stream copy, when to re-encode, and which settings are most compatible.
How to Convert Video Formats with FFmpeg
FFmpeg can convert almost any video format, but the best command depends on what you mean by "convert." Sometimes you only need to change the container, such as MOV to MP4. Other times you need to re-encode the video so it plays reliably in browsers, phones, or editing software.
For a guided command builder, use the FFmpeg video converter. For direct commands, start with the examples below.
Fastest MOV to MP4 Command
If your MOV file already contains MP4-compatible streams, you can rewrap it without quality loss:
ffmpeg -i input.mov -c copy output.mp4
This is fast because FFmpeg copies the existing video and audio streams into a new MP4 container. It does not re-encode, so quality stays the same.
Use this when:
- The source is MOV, MKV, or another container with compatible codecs.
- You want the fastest conversion.
- You do not need to reduce file size or change quality.
Most Compatible MP4 Command
If you need a file that plays almost everywhere, re-encode to H.264 video and AAC audio:
ffmpeg -i input.mov -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart output.mp4
This is slower than stream copy, but it creates a safer MP4 for web playback and sharing.
What the Options Mean
| Option | Meaning |
|---|---|
-i input.mov |
Source video file. |
-c copy |
Copies streams without re-encoding. |
-c:v libx264 |
Encodes video as H.264 for broad compatibility. |
-crf 23 |
Sets quality. Lower values mean higher quality and larger files. |
-preset medium |
Balances encoding speed and compression efficiency. |
-c:a aac |
Encodes audio as AAC for MP4 compatibility. |
-movflags +faststart |
Helps MP4 files start faster when streamed on the web. |
Stream Copy vs Re-encode
| Method | Speed | Quality | Use when |
|---|---|---|---|
-c copy |
Very fast | No generation loss | The existing codecs already work in the target container |
| Re-encode | Slower | Some generation loss | You need compatibility, smaller size, or different codecs |
If -c copy fails, use the re-encode command. That usually means the target container cannot hold one of the existing streams.
Convert MKV or WebM to MP4
Try stream copy first:
ffmpeg -i input.mkv -c copy output.mp4
If the result does not play correctly, re-encode:
ffmpeg -i input.mkv -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4
WebM files often use VP9 or Opus, so re-encoding is commonly needed for MP4 compatibility.
Keep Quality High
Use a lower CRF value if you want less visible loss:
ffmpeg -i input.mov -c:v libx264 -crf 18 -preset slow -c:a aac -b:a 192k output.mp4
CRF 18 is often visually close to the source. It will create a larger file than CRF 23.
Common Problems
The output has no audio or unsupported audio.
Use -c:a aac -b:a 128k instead of copying audio.
The MP4 will not play in a browser.
Use H.264 video, AAC audio, and -movflags +faststart.
The command says Unknown encoder 'libx264'.
Your FFmpeg build does not include x264. Install a full FFmpeg build or try an available hardware encoder. The FFmpeg error explainer can help with the exact message.
Related FFmpeg Pages
- Build a custom command with the Convert Video tool.
- See the short recipe: Convert MOV to MP4.
- Learn how to compress video with FFmpeg after conversion.
Related tool
Convert Video with FFmpeg
Convert video formats with FFmpeg while controlling codec, quality, and container.
Open the command generator