.mkv

Term side of the Card.
Topic: Video
Unit title: .mkv
Categories: Format
Explanation side of the Card

Explanation: The flexible and open-source container format that allows for storing multiple video, audio, subtitle and metadata streams in one file. It's often used for high-definition video content and supports modern codecs.

Example

Wrongbash
ffmpeg -i movie.mkv movie.mp4
Rightbash
ffmpeg -i movie.mkv -c copy -movflags +faststart movie.mp4

If the codecs are H.264 and AAC, -c copy only rewraps the streams into MP4, which is fast and lossless.

Common mistakes

  • Re-encoding an MKV to MP4 when only the container needs to change, losing quality and time.
  • Losing extra audio tracks and subtitles when converting, since MP4 handles them differently.

Key points

  • Web players use .mp4 or .webm, not .mkv, even when some browsers happen to play it.
  • Conversion from MKV first tries remuxing with -c copy when the codecs are already web-friendly.

Interview questions

MKV vs MP4: which is better?

MKV is more flexible for many audio and subtitle tracks, which suits archives. MP4 is better for web and device playback.

Is WebM related to MKV?

Yes. WebM is based on the Matroska container, limited to web codecs like VP8, VP9, AV1, Vorbis and Opus.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy