How to Convert MKV to MP4
Convert MKV to MP4 by remuxing without quality loss or by re-encoding when codecs are incompatible. Practical steps for FFmpeg, HandBrake, VLC and OBS.
MKV (Matroska) and MP4 are both containers. They hold video, audio and subtitle streams that were encoded with a codec such as H.264, HEVC or AAC. Converting MKV to MP4 can mean two different jobs. Remuxing moves the existing streams into a new container without touching the encoding, so it is fast and keeps the original quality. Re-encoding decodes the streams and compresses them again. It takes longer, changes quality and file size, and is only needed when a stream cannot go into MP4 or will not play on your target device.
Before you start
- Keep the original MKV file until you have checked the MP4. Neither remuxing nor re-encoding needs to overwrite it.
- Find out which codecs the MKV contains. A media inspection tool such as MediaInfo, or the ffprobe command that ships with FFmpeg, lists each video, audio and subtitle stream. H.264 or HEVC video with AAC or MP3 audio can usually be remuxed straight into MP4.
- Decide whether the work should stay on your computer. FFmpeg, HandBrake, VLC and OBS Studio process files locally. Web converters such as CloudConvert upload the file to a remote service, so read that service's current terms on storage, retention and deletion before sending private recordings.
- Check free disk space. A remuxed MP4 is roughly the same size as the source, and you will temporarily have both files.
- If the MKV is a screen or webcam recording from OBS Studio, note that OBS often records to MKV by default because an interrupted MKV recording is easier to recover than an interrupted MP4.
Step-by-step instructions
Option 1: Remux with FFmpeg (no quality loss)
- Install FFmpeg for your operating system and open a terminal in the folder that contains the MKV file.
- Run: ffmpeg -i input.mkv -c copy output.mp4. The -c copy option copies the streams without re-encoding them.
- By default FFmpeg picks one video and one audio stream. To keep every track, add -map 0 before the output name: ffmpeg -i input.mkv -map 0 -c copy output.mp4.
- If the command fails because of subtitles, either drop them with -sn or convert text-based subtitles to the MP4 text format with -c:s mov_text while still copying video and audio: ffmpeg -i input.mkv -map 0 -c:v copy -c:a copy -c:s mov_text output.mp4.
- For files that will be played from a web page, add -movflags +faststart so playback can begin before the whole file has downloaded.
- For HEVC video that should play on Apple devices, adding -tag:v hvc1 often improves compatibility.
Option 2: Remux recordings in OBS Studio
If the MKV came from OBS Studio, use the Remux Recordings tool in the File menu. Select the MKV recording, choose where the MP4 should be saved and start the remux. OBS copies the streams without re-encoding. Newer OBS versions also include a setting to remux recordings to MP4 automatically after each recording ends; check the advanced settings of your version, since option names and locations have changed between releases.
Option 3: Re-encode with HandBrake
- Open HandBrake and load the MKV file as the source.
- Choose a preset that matches your target, for example a general-purpose H.264 preset at the source resolution.
- Set the output container format to MP4.
- In the audio and subtitle settings, confirm which tracks are included. Text subtitles can be added as a track or burned into the picture; image-based subtitles usually have to be burned in for MP4.
- For screen recordings and webcam captures with uneven timing, a constant frame rate setting can help avoid audio drift on some players.
- Pick a destination file name that does not overwrite the original, then start the encode.
HandBrake always re-encodes video, so expect some quality change and a different file size. Use it when remuxing fails or when a device needs a specific codec, resolution or bitrate.
Option 4: Convert in VLC
VLC media player has a Convert/Save option in its Media menu. Add the MKV file, choose an MP4 profile and set a destination file. The standard profiles re-encode the video, and the result depends on the profile settings, so VLC is a convenient fallback rather than the best choice for preserving quality.
Re-encoding with FFmpeg
When a stream cannot be copied, you can re-encode only the problem stream. For example, ffmpeg -i input.mkv -c:v copy -c:a aac -b:a 192k output.mp4 keeps the video untouched and converts the audio to AAC. To re-encode the video as well, use ffmpeg -i input.mkv -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 192k output.mp4. A lower CRF value gives higher quality and a larger file; a slower preset improves compression efficiency at the cost of encoding time.
Check the output
- Play the MP4 on the device or app you actually intend to use, not only on the computer that made it. Check the start, a few points in the middle and the end.
- Compare duration with the original. Running ffprobe output.mp4 shows duration, codecs, resolution, frame rate and bitrate for each stream.
- Confirm every audio track and subtitle track you need is present. A remux with default settings may include only one audio track.
- Watch for audio drifting out of sync over longer clips, which points to timing problems in the original capture rather than the container change.
- After a remux, the file size should be close to the MKV. A much smaller file usually means a stream was dropped or the file was re-encoded.
- Delete the MKV only after the MP4 has passed these checks.
Common problems and next steps
The remux fails or the MP4 will not play
Some codecs that are common in MKV files, such as certain lossless or surround audio formats and some video codecs, are not accepted by every MP4 muxer or player. Re-encode just the unsupported stream, usually the audio to AAC, and copy the rest. If the video itself is the issue, re-encode it to H.264 for the widest playback support.
Video plays but there is no sound
The player may not support the audio codec that was copied, or the wrong audio track was selected. Inspect the streams, then either map the correct track explicitly with -map or convert the audio to AAC.
Subtitles disappeared
MP4 supports a narrower range of subtitle formats than MKV. Text subtitles can be converted to mov_text, though styling from formats such as ASS may be lost. Image-based subtitles such as PGS generally need to be burned into the video during a re-encode, or kept as a separate file.
The MP4 looks worse than the MKV
Quality loss means the video was re-encoded. If the source codec is MP4-compatible, remux instead. If re-encoding is unavoidable, raise the quality setting or bitrate and keep the original resolution and frame rate.
Online converters
Web-based MKV to MP4 converters can be convenient for an occasional small file, but they involve uploading, often have file size limits, and may re-encode rather than remux. For large recordings or anything containing faces, voices or private screens, a local tool avoids sending the file anywhere.
Avoid the conversion next time
If you regularly convert recordings, check the recording format setting in your capture software. Recording to MKV and remuxing afterwards protects against losing the whole file after a crash, while recording directly to MP4 saves a step but is riskier if the capture source or application stops unexpectedly. Some capture tools also offer fragmented or hybrid MP4 options that reduce that risk; availability depends on the application version.