{"id":392,"date":"2026-11-03T13:30:00","date_gmt":"2026-11-03T13:30:00","guid":{"rendered":"https:\/\/backendside.com\/blog\/?p=392"},"modified":"2026-11-21T11:31:46","modified_gmt":"2026-11-21T11:31:46","slug":"containers-vs-codecs-mp4-mkv-webm","status":"publish","type":"post","link":"https:\/\/backendside.com\/blog\/2026\/11\/03\/containers-vs-codecs-mp4-mkv-webm\/","title":{"rendered":"Containers vs Codecs: MP4, MKV and WebM Aren&#8217;t Formats"},"content":{"rendered":"<p class=\"lead\">&ldquo;What format is it?&rdquo; &ldquo;MP4.&rdquo; It is the most natural exchange in the world, and it is only half an answer. MP4, MKV and WebM are not video formats in the sense most people mean &mdash; they are <strong>containers<\/strong>: boxes that hold video, audio, subtitles and metadata. What is <em>inside<\/em> the box, the <strong>codec<\/strong>, decides how big the file is and whether your device can play it. Once that clicks, a whole class of &ldquo;this file won&rsquo;t play&rdquo; problems becomes easy to fix.<\/p>\n<h2>The box and the contents<\/h2>\n<p>Think of a container like a ZIP file. The <code>.zip<\/code> extension tells you how the archive is organised; it tells you nothing about whether the files inside are spreadsheets or photos. A video container works the same way. It defines how streams are stored and interleaved, how the player finds a given moment in the file, and where things like the title, chapters and language tags go.<\/p>\n<p>A typical video file contains several streams:<\/p>\n<ul>\n<li><strong>One or more video streams<\/strong>, encoded with a codec such as H.264, HEVC, VP9 or AV1.<\/li>\n<li><strong>One or more audio streams<\/strong>, encoded with AAC, Opus, MP3, AC-3, FLAC and so on &mdash; for example, several languages.<\/li>\n<li><strong>Subtitle streams<\/strong>, in formats such as SRT, WebVTT, ASS or image-based PGS.<\/li>\n<li><strong>Metadata<\/strong>: title, chapters, rotation, cover art.<\/li>\n<\/ul>\n<p>So two files both called <code>holiday.mp4<\/code> can be completely different: one H.264 with AAC audio that plays on a ten-year-old TV, the other AV1 with Opus that the same TV cannot open. The extension did not lie. It just never promised anything about the codec.<\/p>\n<h2>The common containers compared<\/h2>\n<table>\n<thead>\n<tr>\n<th>Container<\/th>\n<th>Typical video<\/th>\n<th>Typical audio<\/th>\n<th>Subtitles<\/th>\n<th>Strengths<\/th>\n<th>Watch out for<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>MP4<\/strong> (.mp4, .m4v)<\/td>\n<td>H.264, HEVC, AV1<\/td>\n<td>AAC, MP3, AC-3; Opus with newer players<\/td>\n<td>Limited (simple text)<\/td>\n<td>Plays nearly everywhere; streaming-friendly<\/td>\n<td>Fussy about less common codecs and styled subtitles<\/td>\n<\/tr>\n<tr>\n<td><strong>MKV<\/strong> (Matroska)<\/td>\n<td>Almost anything<\/td>\n<td>Almost anything<\/td>\n<td>Excellent: SRT, ASS, PGS, many tracks<\/td>\n<td>Multiple audio and subtitle tracks, chapters<\/td>\n<td>Patchy support on some TVs, phones and editors<\/td>\n<\/tr>\n<tr>\n<td><strong>WebM<\/strong><\/td>\n<td>VP8, VP9, AV1 only<\/td>\n<td>Vorbis, Opus only<\/td>\n<td>WebVTT<\/td>\n<td>Royalty-free, made for browsers<\/td>\n<td>Strict codec list; limited outside browsers<\/td>\n<\/tr>\n<tr>\n<td><strong>MOV<\/strong> (QuickTime)<\/td>\n<td>H.264, HEVC, ProRes<\/td>\n<td>AAC, PCM<\/td>\n<td>Limited<\/td>\n<td>Editing and Apple workflows<\/td>\n<td>Large files when it holds ProRes<\/td>\n<\/tr>\n<tr>\n<td><strong>AVI<\/strong><\/td>\n<td>Older codecs (MPEG-4 Part 2, etc.)<\/td>\n<td>MP3, PCM<\/td>\n<td>Not really<\/td>\n<td>Very old players and devices<\/td>\n<td>Poor fit for modern codecs such as HEVC<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>WebM is the odd one out in a useful way: it is a restricted subset of Matroska that only allows royalty-free codecs, so a browser that supports WebM knows exactly what it might find inside.<\/p>\n<h2>Why a file plays here but not there<\/h2>\n<p>When a file fails to play, one of three things is usually going on:<\/p>\n<ol>\n<li><strong>The player does not understand the container.<\/strong> A smart TV that handles MP4 but not MKV will reject a perfectly ordinary H.264 file in an <code>.mkv<\/code>. The video is fine; the box is the problem.<\/li>\n<li><strong>The player does not have the codec.<\/strong> An older laptop without HEVC or AV1 decoding will open the MP4 but show a black screen, stutter, or play sound only.<\/li>\n<li><strong>One stream is the problem.<\/strong> Video plays but there is no sound, because the audio is DTS or AC-3 and the device does not decode it. Or the subtitles are missing because they are an image-based format the player ignores.<\/li>\n<\/ol>\n<p>The fix is different in each case, and the first case is the cheapest by far.<\/p>\n<h2>Find out what is really inside<\/h2>\n<p>Before converting anything, look inside the box. The free ffprobe tool, part of ffmpeg, lists every stream:<\/p>\n<pre style=\"background:#1e1d1b;color:#eceae6;padding:1rem 1.15rem;border-radius:8px;overflow-x:auto;font-size:.85rem;line-height:1.5;\"><code>ffprobe -v error -show_entries stream=index,codec_type,codec_name:stream_tags=language -of compact movie.mkv\n\nstream|index=0|codec_name=h264|codec_type=video\nstream|index=1|codec_name=aac|codec_type=audio|tag:language=eng\nstream|index=2|codec_name=subrip|codec_type=subtitle|tag:language=eng<\/code><\/pre>\n<p>Here the video is H.264, the audio is AAC and the subtitles are SRT (&ldquo;subrip&rdquo;). Every one of those can live happily in an MP4, which means this file does not need converting at all &mdash; it needs rewrapping.<\/p>\n<h2>Remux, don&rsquo;t re-encode<\/h2>\n<p><strong>Remuxing<\/strong> copies the existing streams, untouched, into a new container. <strong>Transcoding<\/strong> decodes the video and compresses it again. The difference is dramatic:<\/p>\n<table>\n<thead>\n<tr>\n<th><\/th>\n<th>Remux<\/th>\n<th>Transcode<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>What changes<\/td>\n<td>Only the box<\/td>\n<td>The video itself<\/td>\n<\/tr>\n<tr>\n<td>Speed<\/td>\n<td>Seconds, limited by disk speed<\/td>\n<td>Minutes to hours<\/td>\n<\/tr>\n<tr>\n<td>Quality<\/td>\n<td>Identical, bit for bit<\/td>\n<td>A little lower with every lossy pass<\/td>\n<\/tr>\n<tr>\n<td>File size<\/td>\n<td>Roughly the same<\/td>\n<td>Whatever you choose<\/td>\n<\/tr>\n<tr>\n<td>When it works<\/td>\n<td>When the target container supports the codecs inside<\/td>\n<td>Always<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With ffmpeg, the magic words are <code>-c copy<\/code>:<\/p>\n<pre style=\"background:#1e1d1b;color:#eceae6;padding:1rem 1.15rem;border-radius:8px;overflow-x:auto;font-size:.85rem;line-height:1.5;\"><code># MKV to MP4 without re-encoding; convert SRT subtitles to MP4's text format\nffmpeg -i movie.mkv -map 0 -c copy -c:s mov_text movie.mp4\n\n# Keep only the first video and the English audio track\nffmpeg -i movie.mkv -map 0:v:0 -map 0:a:m:language:eng -c copy movie.mp4\n\n# Move the index to the front so a web page can start playing before the download finishes\nffmpeg -i movie.mp4 -c copy -movflags +faststart movie-web.mp4<\/code><\/pre>\n<p>If ffmpeg refuses, it is telling you the target container cannot hold one of the streams &mdash; for example, image-based PGS subtitles or certain audio formats in MP4. In that case drop or convert just that stream (<code>-c:a aac<\/code> re-encodes only the audio, leaving the video copied) rather than re-encoding everything.<\/p>\n<div style=\"border:1px solid #c5d3f8;background:linear-gradient(135deg,#eef2fd 0%,#ffffff 72%);border-radius:14px;padding:1.5rem 1.65rem;margin:2rem 0;\">\n<div style=\"font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#2d5be3;margin-bottom:.55rem;\">&#128295; BackendSide Tool<\/div>\n<h4 style=\"margin:0 0 .45rem;font-size:1.15rem;color:#1a1916;font-weight:700;\">VideoTech &mdash; Change the Container, Keep the Video<\/h4>\n<p style=\"margin:0 0 1.05rem;color:#3d3c38;font-size:.92rem;line-height:1.65;\">A player rejects your <code>.mkv<\/code> even though the video inside is perfectly fine? <strong>VideoTech<\/strong> rewraps it into another container <strong>without touching the video<\/strong> &mdash; seconds instead of minutes, and no quality loss at all. Point it at a whole folder and the batch finishes in seconds. Impossible jobs, such as remuxing HEVC into AVI, are refused before the batch starts with a sentence explaining why.<\/p>\n<p>  <a href=\"https:\/\/backendside.com\/videotech.php\" style=\"display:inline-flex;align-items:center;gap:.4rem;background:#2d5be3;color:#ffffff;font-weight:600;font-size:.85rem;padding:.6rem 1.2rem;border-radius:6px;text-decoration:none;\">Explore VideoTech &rarr;<\/a>\n<\/div>\n<h2>When you really do need to re-encode<\/h2>\n<p>Remuxing cannot help when the <em>codec<\/em> is the problem. If an older device cannot decode HEVC or AV1, the only fix is to transcode to something it can, usually H.264. The same applies when you need a smaller file, a lower resolution, or a codec a platform insists on. And image-based subtitles cannot become text without either burning them into the picture or running them through OCR.<\/p>\n<p>A quick decision guide:<\/p>\n<ul>\n<li><strong>Player rejects the file, codecs are common<\/strong> (H.264\/HEVC + AAC): remux to MP4.<\/li>\n<li><strong>Video plays, no sound<\/strong>: re-encode just the audio to AAC and copy the video.<\/li>\n<li><strong>Black screen or stutter on an older device<\/strong>: transcode the video to H.264.<\/li>\n<li><strong>File too big<\/strong>: transcode, ideally to a more efficient codec or lower resolution.<\/li>\n<li><strong>Need several languages and subtitle tracks in one file<\/strong>: MKV, if the player supports it.<\/li>\n<li><strong>Embedding in a web page<\/strong>: MP4 with H.264 for reach, optionally WebM with VP9 or AV1 as a second source.<\/li>\n<\/ul>\n<h2>Picking a container on purpose<\/h2>\n<p>A short rule set covers most cases. Use <strong>MP4<\/strong> for anything you share, upload or play on phones and TVs. Use <strong>MKV<\/strong> for your own archive, especially with multiple audio and subtitle tracks &mdash; and because it tolerates interruption well, it is a good format to record into. Use <strong>WebM<\/strong> for royalty-free web delivery. Use <strong>MOV<\/strong> when an editing workflow asks for it. Leave <strong>AVI<\/strong> for hardware that will not accept anything else.<\/p>\n<p>For a walkthrough of a Windows converter that handles both remuxing and full conversions, plus on-device AI tools, see our <a href=\"https:\/\/backendside.com\/blog\/2026\/08\/24\/videotech-video-converter-five-on-device-ai-models\/\">introduction to VideoTech<\/a>.<\/p>\n<div style=\"border:1px solid #c5d3f8;background:linear-gradient(135deg,#eef2fd 0%,#ffffff 72%);border-radius:14px;padding:1.5rem 1.65rem;margin:2rem 0;\">\n<div style=\"font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#2d5be3;margin-bottom:.55rem;\">&#128295; BackendSide Tool<\/div>\n<h4 style=\"margin:0 0 .45rem;font-size:1.15rem;color:#1a1916;font-weight:700;\">VideoTech &mdash; 20 Output Formats, Subtitles Included<\/h4>\n<p style=\"margin:0 0 1.05rem;color:#3d3c38;font-size:.92rem;line-height:1.65;\">When a re-encode really is needed, <strong>VideoTech<\/strong> converts to MP4 (H.264, HEVC or AV1), WebM (VP9 or AV1), MKV, MOV (ProRes or H.264), AVI and animated GIF, or extracts the audio to MP3, AAC, Opus, FLAC, WAV, ALAC or Vorbis. It can also write subtitles from speech on your own PC &mdash; saved as a separate <code>.srt<\/code>, embedded as a real track the viewer can switch off, or burned into the picture.<\/p>\n<p>  <a href=\"https:\/\/backendside.com\/videotech.php\" style=\"display:inline-flex;align-items:center;gap:.4rem;background:#2d5be3;color:#ffffff;font-weight:600;font-size:.85rem;padding:.6rem 1.2rem;border-radius:6px;text-decoration:none;\">Explore VideoTech &rarr;<\/a>\n<\/div>\n<h2>Key takeaways<\/h2>\n<ul>\n<li><strong>MP4, MKV and WebM are containers<\/strong> &mdash; boxes holding video, audio and subtitle streams. The codec inside decides size and compatibility.<\/li>\n<li>Two files with the same extension can be completely different; use <code>ffprobe<\/code> to see what is really inside.<\/li>\n<li>Playback failures come from the container, a codec, or one stream &mdash; each has a different fix.<\/li>\n<li><strong>Remuxing<\/strong> (<code>-c copy<\/code>) changes only the box: seconds instead of minutes, with zero quality loss.<\/li>\n<li>Re-encode only what you must &mdash; often just the audio track.<\/li>\n<li><strong>VideoTech<\/strong> can change the container without re-encoding, convert to 20 output formats when you do need to, and refuse impossible jobs up front.<\/li>\n<\/ul>\n<div style=\"border:1px solid #c5d3f8;background:linear-gradient(135deg,#eef2fd 0%,#ffffff 72%);border-radius:14px;padding:1.5rem 1.65rem;margin:2rem 0;\">\n<div style=\"font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#2d5be3;margin-bottom:.55rem;\">&#128295; BackendSide Tool<\/div>\n<h4 style=\"margin:0 0 .45rem;font-size:1.15rem;color:#1a1916;font-weight:700;\">VideoTech &mdash; Change the Container, Keep the Video<\/h4>\n<p style=\"margin:0 0 1.05rem;color:#3d3c38;font-size:.92rem;line-height:1.65;\">A player rejects your <code>.mkv<\/code> even though the video inside is perfectly fine? <strong>VideoTech<\/strong> rewraps it into another container <strong>without touching the video<\/strong> &mdash; seconds instead of minutes, and no quality loss at all. Point it at a whole folder and the batch finishes in seconds. Impossible jobs, such as remuxing HEVC into AVI, are refused before the batch starts with a sentence explaining why.<\/p>\n<p>  <a href=\"https:\/\/backendside.com\/videotech.php\" style=\"display:inline-flex;align-items:center;gap:.4rem;background:#2d5be3;color:#ffffff;font-weight:600;font-size:.85rem;padding:.6rem 1.2rem;border-radius:6px;text-decoration:none;\">Explore VideoTech &rarr;<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A .mp4 or .mkv file is a box, not a format: the video and audio inside can be encoded many different ways. Why a file can play on one device and fail on another, what MP4, MKV, WebM, MOV and AVI can each hold, and how to fix most playback problems in seconds by rewrapping instead of re-encoding.<\/p>\n","protected":false},"author":1,"featured_media":421,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,2],"tags":[84,87,83,85],"class_list":["post-392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-windows","tag-codecs","tag-containers","tag-video","tag-videotech"],"_links":{"self":[{"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":1,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"predecessor-version":[{"id":422,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/posts\/392\/revisions\/422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/media\/421"}],"wp:attachment":[{"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/backendside.com\/blog\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}