{"course":{"slug":"video-editing","title":"Editing Video","url":"https://addaly.com/learn/video-editing","level":"beginner","track":"create"},"lesson":{"slug":"containers-and-codecs","title":"The box and the codec are two different decisions","url":"https://addaly.com/learn/video-editing/containers-and-codecs","position":68,"of":77,"minutes":9,"answer":"A filename tells you the container and nothing about the codec, so repack with a remux rather than a rename, and check a file with ffprobe before you send it anywhere.","keyIdea":"A filename tells you the container and nothing about the codec, so repack with a remux rather than a rename, and check a file with ffprobe before you send it anywhere."},"body":{"format":"markdown","text":"## The box and the thing inside it\n\nA video file is two separate decisions wearing one filename.\n\nThe **codec** is how the pictures and the sound were compressed: H.264, H.265, AV1, VP9, ProRes, DNxHR for picture; AAC, PCM, Opus, MP3 for sound. The **container** is the box that holds those compressed streams side by side, along with the timecode, the track names, the subtitle tracks and the metadata: MP4, MOV, MKV, MXF, WebM.\n\n`holiday.mp4` tells you the box. It tells you nothing about what is inside, which is why \"it's an MP4\" is not an answer to \"what codec is it?\" and why one MP4 plays on a phone and another does not.\n\nThe confusion is worth clearing up now, because almost every delivery problem in this block is a container-and-codec problem wearing a different hat.\n\n## What each box is for\n\n**MP4** is the ISO standard box. It is the safest thing to hand anybody. Browsers play it, phones play it, every platform accepts it. It legally holds H.264, H.265 and AAC, and that is most of what it is used for.\n\n**MOV** is Apple's QuickTime box, and structurally it is MP4's older sibling: the two share a file format lineage, which is why so many tools treat them interchangeably. MOV is where ProRes lives, and it holds timecode tracks more comfortably than MP4.\n\n**MKV** (Matroska) is the open box that holds anything: any codec, unlimited subtitle and audio tracks, chapters. It is excellent for archiving and for anything you will watch yourself. Upload one to a client's review system and it may well be rejected, because MKV support outside VLC and media players is patchy.\n\n**MXF** is the broadcast box. If a spec sheet asks for MXF OP1a, that is a delivery requirement from a system that is older and stricter than you are, and you follow it exactly.\n\n**WebM** is the browser box for VP9 and AV1. You will mostly meet it as a download from a website rather than as something you make.\n\n## Renaming does nothing\n\nThe single most common misunderstanding: changing `.mkv` to `.mp4` in Finder or Explorer does not convert anything. The bytes are unchanged. You have put an MP4 label on a Matroska box, and the player either sees through the lie and works, or refuses.\n\nWhat you actually want is a **remux**: unpack the streams from one box and repack them into another without touching the compression.\n\n```bash\nffmpeg -i clip.mkv -c copy clip.mp4\n```\n\n`-c copy` means \"copy the streams, do not re-encode\". A two-gigabyte file remuxes in a couple of seconds and loses nothing, because nothing was decoded. Compare that with a re-encode, which takes minutes and always loses a little.\n\nThe catch is legality. Not every codec is allowed in every container. H.264 and AAC go into MP4 happily. ProRes in MP4 is not a standard combination and many players will refuse it. FLAC in MP4 is unusual. If a remux fails, ffmpeg will normally say which stream it could not place, and the fix is to re-encode that one stream and copy the rest:\n\n```bash\nffmpeg -i clip.mkv -c:v copy -c:a aac -b:a 192k clip.mp4\n```\n\nPicture copied untouched, audio converted. This is the cheapest repair in the whole delivery chain.\n\n## The one MP4 flag worth knowing\n\nAn MP4 has an index (the `moov` atom) that says where every frame lives. Encoders often write it at the *end* of the file, because they only know the final layout once they finish.\n\nA file with the index at the end cannot start playing until it has fully downloaded. Uploaded to a web page, it appears broken: a long spinner, then it plays. The fix takes seconds and no quality loss:\n\n```bash\nffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4\n```\n\nMost editors have a \"web optimised\" or \"fast start\" checkbox that does exactly this. Tick it for anything going on a website. It does not matter for YouTube or Instagram, which re-encode the file anyway.\n\n## Why a colleague cannot open your ProRes\n\nProRes is a Apple codec, and macOS decodes it everywhere by default. On Windows the situation is better than it used to be and still not universal: recent Windows versions decode ProRes in some applications, VLC and DaVinci Resolve read it regardless, and a random corporate media player may not.\n\nDNxHR is Avid's equivalent and behaves symmetrically: solid everywhere in professional tools, less certain in consumer ones. Both are *intra-frame* codecs, meaning every frame is compressed on its own, which is why they scrub instantly and why the files are enormous.\n\nIf you do not know what the other end can open, send H.264 in MP4. It is the format nobody has trouble with.\n\n## Honest limits\n\nContainer and codec support is not a fixed fact you can memorise once. It shifts with operating system versions, browser versions and hardware. AV1 decoding, for instance, is hardware-accelerated on recent phones and chips and software-only on older ones, where a 4K AV1 file will stutter on a machine that plays 4K H.264 without effort.\n\nThe working habit is not to know the compatibility matrix. It is to check the file before you send it, with `ffprobe` or MediaInfo (both free) and to ask the receiving end what they open things in.\n\n## Today\n\nTake any file on your drive and run `ffprobe -hide_banner file.mp4`. Read the two lines that say `Stream #0:0` and `Stream #0:1`. You now know its codec, its resolution, its frame rate and its audio format, which is more than the filename ever told you."},"check":{"question":"Renaming a .mkv file to .mp4 sometimes plays and sometimes does not. What is actually happening?","options":[{"text":"The rename rewrites the file's identifying header, and players that read headers rather than extensions reject the mismatch.","correct":false,"tempting":"Confuses the extension with the file's internal header; renaming in a file browser touches neither the header nor the streams."},{"text":"Matroska stores its frames in a different order from MP4, so the player has to reorder them and some cannot do it quickly enough.","correct":false,"tempting":"Invents a structural difference in frame ordering; both containers carry the same coded frames in the same order."},{"text":"Nothing inside the file changed, so it plays only where the player reads Matroska anyway; a real conversion needs a remux.","correct":true},{"text":"MP4 requires its index at the start of the file while Matroska writes it at the end, so a renamed file has an index the MP4 parser cannot locate.","correct":false,"tempting":"Mixes up the faststart problem, which is real but concerns where the index sits in a genuinely valid MP4, not a renamed Matroska file."}]},"prev":{"slug":"codecs-and-export","title":"Why the upload looks worse than the file","url":"https://addaly.com/learn/video-editing/codecs-and-export"},"next":{"slug":"bitrate-and-what-it-buys","title":"Bitrate, and why the same number is generous and stingy","url":"https://addaly.com/learn/video-editing/bitrate-and-what-it-buys"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'The box and the codec are two different decisions', in Editing Video. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/video-editing/containers-and-codecs (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"The box and the codec are two different decisions","courseTitle":"Editing Video","module":{"index":8,"slug":"delivery","title":"Delivery: the file that leaves the building"},"answer":null,"keyIdea":"A filename tells you the container and nothing about the codec, so repack with a remux rather than a rename, and check a file with ffprobe before you send it anywhere.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-box-and-the-thing-inside-it","runs":[{"text":"The box and the thing inside it"}]},{"t":"p","runs":[{"text":"A video file is two separate decisions wearing one filename."}]},{"t":"p","runs":[{"text":"The "},{"text":"codec","b":true},{"text":" is how the pictures and the sound were compressed: H.264, H.265, AV1, VP9, ProRes, DNxHR for picture; AAC, PCM, Opus, MP3 for sound. The "},{"text":"container","b":true},{"text":" is the box that holds those compressed streams side by side, along with the timecode, the track names, the subtitle tracks and the metadata: MP4, MOV, MKV, MXF, WebM."}]},{"t":"p","runs":[{"text":"holiday.mp4","code":true},{"text":" tells you the box. It tells you nothing about what is inside, which is why “it’s an MP4” is not an answer to “what codec is it?” and why one MP4 plays on a phone and another does not."}]},{"t":"p","runs":[{"text":"The confusion is worth clearing up now, because almost every delivery problem in this block is a container-and-codec problem wearing a different hat."}]},{"t":"h2","id":"what-each-box-is-for","runs":[{"text":"What each box is for"}]},{"t":"p","runs":[{"text":"MP4","b":true},{"text":" is the ISO standard box. It is the safest thing to hand anybody. Browsers play it, phones play it, every platform accepts it. It legally holds H.264, H.265 and AAC, and that is most of what it is used for."}]},{"t":"p","runs":[{"text":"MOV","b":true},{"text":" is Apple’s QuickTime box, and structurally it is MP4’s older sibling: the two share a file format lineage, which is why so many tools treat them interchangeably. MOV is where ProRes lives, and it holds timecode tracks more comfortably than MP4."}]},{"t":"p","runs":[{"text":"MKV","b":true},{"text":" (Matroska) is the open box that holds anything: any codec, unlimited subtitle and audio tracks, chapters. It is excellent for archiving and for anything you will watch yourself. Upload one to a client’s review system and it may well be rejected, because MKV support outside VLC and media players is patchy."}]},{"t":"p","runs":[{"text":"MXF","b":true},{"text":" is the broadcast box. If a spec sheet asks for MXF OP1a, that is a delivery requirement from a system that is older and stricter than you are, and you follow it exactly."}]},{"t":"p","runs":[{"text":"WebM","b":true},{"text":" is the browser box for VP9 and AV1. You will mostly meet it as a download from a website rather than as something you make."}]},{"t":"h2","id":"renaming-does-nothing","runs":[{"text":"Renaming does nothing"}]},{"t":"p","runs":[{"text":"The single most common misunderstanding: changing "},{"text":".mkv","code":true},{"text":" to "},{"text":".mp4","code":true},{"text":" in Finder or Explorer does not convert anything. The bytes are unchanged. You have put an MP4 label on a Matroska box, and the player either sees through the lie and works, or refuses."}]},{"t":"p","runs":[{"text":"What you actually want is a "},{"text":"remux","b":true},{"text":": unpack the streams from one box and repack them into another without touching the compression."}]},{"t":"code","lang":"bash","label":"Bash","text":"ffmpeg -i clip.mkv -c copy clip.mp4"},{"t":"p","runs":[{"text":"-c copy","code":true},{"text":" means “copy the streams, do not re-encode”. A two-gigabyte file remuxes in a couple of seconds and loses nothing, because nothing was decoded. Compare that with a re-encode, which takes minutes and always loses a little."}]},{"t":"p","runs":[{"text":"The catch is legality. Not every codec is allowed in every container. H.264 and AAC go into MP4 happily. ProRes in MP4 is not a standard combination and many players will refuse it. FLAC in MP4 is unusual. If a remux fails, ffmpeg will normally say which stream it could not place, and the fix is to re-encode that one stream and copy the rest:"}]},{"t":"code","lang":"bash","label":"Bash","text":"ffmpeg -i clip.mkv -c:v copy -c:a aac -b:a 192k clip.mp4"},{"t":"p","runs":[{"text":"Picture copied untouched, audio converted. This is the cheapest repair in the whole delivery chain."}]},{"t":"h2","id":"the-one-mp4-flag-worth-knowing","runs":[{"text":"The one MP4 flag worth knowing"}]},{"t":"p","runs":[{"text":"An MP4 has an index (the "},{"text":"moov","code":true},{"text":" atom) that says where every frame lives. Encoders often write it at the "},{"text":"end","i":true},{"text":" of the file, because they only know the final layout once they finish."}]},{"t":"p","runs":[{"text":"A file with the index at the end cannot start playing until it has fully downloaded. Uploaded to a web page, it appears broken: a long spinner, then it plays. The fix takes seconds and no quality loss:"}]},{"t":"code","lang":"bash","label":"Bash","text":"ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4"},{"t":"p","runs":[{"text":"Most editors have a “web optimised” or “fast start” checkbox that does exactly this. Tick it for anything going on a website. It does not matter for YouTube or Instagram, which re-encode the file anyway."}]},{"t":"h2","id":"why-a-colleague-cannot-open-your-prores","runs":[{"text":"Why a colleague cannot open your ProRes"}]},{"t":"p","runs":[{"text":"ProRes is a Apple codec, and macOS decodes it everywhere by default. On Windows the situation is better than it used to be and still not universal: recent Windows versions decode ProRes in some applications, VLC and DaVinci Resolve read it regardless, and a random corporate media player may not."}]},{"t":"p","runs":[{"text":"DNxHR is Avid’s equivalent and behaves symmetrically: solid everywhere in professional tools, less certain in consumer ones. Both are "},{"text":"intra-frame","i":true},{"text":" codecs, meaning every frame is compressed on its own, which is why they scrub instantly and why the files are enormous."}]},{"t":"p","runs":[{"text":"If you do not know what the other end can open, send H.264 in MP4. It is the format nobody has trouble with."}]},{"t":"h2","id":"honest-limits","runs":[{"text":"Honest limits"}]},{"t":"p","runs":[{"text":"Container and codec support is not a fixed fact you can memorise once. It shifts with operating system versions, browser versions and hardware. AV1 decoding, for instance, is hardware-accelerated on recent phones and chips and software-only on older ones, where a 4K AV1 file will stutter on a machine that plays 4K H.264 without effort."}]},{"t":"p","runs":[{"text":"The working habit is not to know the compatibility matrix. It is to check the file before you send it, with "},{"text":"ffprobe","code":true},{"text":" or MediaInfo (both free) and to ask the receiving end what they open things in."}]},{"t":"h2","id":"today","runs":[{"text":"Today"}]},{"t":"p","runs":[{"text":"Take any file on your drive and run "},{"text":"ffprobe -hide_banner file.mp4","code":true},{"text":". Read the two lines that say "},{"text":"Stream #0:0","code":true},{"text":" and "},{"text":"Stream #0:1","code":true},{"text":". You now know its codec, its resolution, its frame rate and its audio format, which is more than the filename ever told you."}]}],"check":{"question":[{"text":"Renaming a .mkv file to .mp4 sometimes plays and sometimes does not. What is actually happening?"}],"options":[{"text":[{"text":"The rename rewrites the file’s identifying header, and players that read headers rather than extensions reject the mismatch."}],"correct":false,"tempting":[{"text":"Confuses the extension with the file’s internal header; renaming in a file browser touches neither the header nor the streams."}]},{"text":[{"text":"Matroska stores its frames in a different order from MP4, so the player has to reorder them and some cannot do it quickly enough."}],"correct":false,"tempting":[{"text":"Invents a structural difference in frame ordering; both containers carry the same coded frames in the same order."}]},{"text":[{"text":"Nothing inside the file changed, so it plays only where the player reads Matroska anyway; a real conversion needs a remux."}],"correct":true,"tempting":null},{"text":[{"text":"MP4 requires its index at the start of the file while Matroska writes it at the end, so a renamed file has an index the MP4 parser cannot locate."}],"correct":false,"tempting":[{"text":"Mixes up the faststart problem, which is real but concerns where the index sits in a genuinely valid MP4, not a renamed Matroska file."}]}],"order":[1,2,0,3],"why":null},"prev":{"slug":"codecs-and-export","title":"Why the upload looks worse than the file","minutes":11},"next":{"slug":"bitrate-and-what-it-buys","title":"Bitrate, and why the same number is generous and stingy","minutes":9}}}