FFmpeg recipe
FFmpeg: Convert MKV to MP4 (Stream-Copy)
When the MKV uses H.264 + AAC (most movie rips), stream-copy remuxes to MP4 in seconds — bit-identical streams, new container.
Command
ffmpeg -i input.mkv -c copy -map 0:v:0 -map 0:a:0 -y output.mp4Prefer no terminal?
Use the Video Converter in your browser
What each flag does
| -i | Input file. Can be a video, audio, or image. Repeat for multiple inputs. |
|---|---|
| -c copy | Stream-copy: no re-encoding. Output is bit-identical between cut points. Fastest possible. |
| -map | Manually pick which streams to include from the input(s). |
| -y | Overwrite output file without confirmation. |
| -map 0:v:0 | Take the first video stream from input 0. |
| -map 0:a:0 | Take the first audio stream from input 0. Add -map 0:a:1 to keep multiple tracks. |
Notes & gotchas
- For DTS or AC3 audio inside MKV, stream-copy fails — re-encode audio with -c:a aac -b:a 192k.
- For HEVC video, browsers reject the result; re-encode with -c:v libx264 -crf 23.
- Subtitles do not migrate cleanly to MP4 — burn them in with the Subtitle Burner if needed.
Check it worked
ffprobe -v error -show_entries stream=index,codec_type -of csv=p=0 output.mp4One video and one audio stream. If the MKV had several audio tracks, only the first was carried across.
What to change
| Subtitles do not come along | MP4 cannot hold most MKV subtitle formats. Extract them first, or burn them into the picture. |
|---|---|
| Pick the audio track | MKV files often carry several languages. Add -map 0:a:0 to take the first rather than whatever ffmpeg chooses. |
| -c copy usually works | H.264 plus AAC inside MKV rewraps into MP4 losslessly and instantly. H.265, VP9 and FLAC do not. |
If it fails
Only the first audio track survived, and the commentary is gone.
Why: Without an explicit map, FFmpeg picks one stream per type.
Fix: Add -map 0:v -map 0:a to take every audio track, though MP4 handles multiple tracks less reliably than MKV does.
Subtitle codec not supported in container.
Why: The MKV carries ASS or PGS subtitles, neither of which MP4 accepts.
Fix: Drop them with -sn, convert them to mov_text with -c:s mov_text, or burn them into the picture with the subtitles filter.