Converting MKV to MP4 without losing quality
Quality loss is not a fact of conversion, it is a side effect of one particular method. Here is how to tell which method you are getting, and how to prove it afterwards.
Where the softness comes from
A video is compressed once, by whoever made it. Every later encode decodes those frames and compresses them again, and lossy compression does not round-trip: the second pass cannot recover what the first one threw away, and it adds its own errors on top.
One generation at a high bitrate is hard to see. Two or three, on a file already compressed for streaming, show up in gradients, dark scenes and fine texture. That is why "convert it again to fix it" makes things worse rather than better.
A remux has no generation. The compressed frames are moved, not rebuilt, so the tenth conversion is identical to the first.
Four signals that a converter re-encoded
- Time. Copying a 1 GB file is disk-bound: seconds. Encoding is CPU-bound: minutes.
- Fan noise. Re-encoding uses every core. A remux leaves the CPU close to idle.
- Output size. A remux lands within a few kilobytes of the input's video payload. A re-encode changes the size, often upward, because the tool picked a bitrate instead of reading one.
- Metadata.
ffprobereveals the encoder tag and bitrate. A new encoder string and a different bitrate mean the video was rebuilt.
None of these proves it alone. Together they are hard to misread.
Verify it yourself
Frame hashes are the ground truth. The video stream is a sequence of compressed frames; hash each one and any difference shows up immediately.
ffmpeg -i input.mkv -map 0:v -f framemd5 before.txt
ffmpeg -i output.mp4 -map 0:v -f framemd5 after.txt
diff before.txt after.txt
No output from diff means every frame is bit-for-bit the same. On a remux that is expected. On a re-encode it is impossible.
If you want a score rather than an exact match, compare with SSIM:
ffmpeg -i output.mp4 -i input.mkv -lavfi ssim -f null -
A remux reports 1.000000 because the frames are identical. Anything lower is loss, and only you can decide whether it matters for your use.
What this tool does, precisely
It parses the Matroska index, copies every video frame and the first supported audio track, and writes MP4 indexes around that data. No decoder is involved, so there is no path by which the picture could change.
The trade is that it cannot repair a file MP4 genuinely cannot hold: VP9 and AV1 video are refused, and AC-3, DTS, Opus, Vorbis and FLAC audio are dropped, with a warning shown before you press convert. Subtitles and chapters are not carried over either.
The reasoning behind those limits is on remux vs re-encode. If your question is about containers rather than operations, MKV vs MP4 covers that.