ByteScope

M4V file format

Apple's MPEG-4 video variant, commonly DRM-wrapped iTunes video.

MIME type
video/x-m4v
Extensions
.m4v
Category
Video

Magic-number signature

0x0000000466747970ftypISO-BMFF 'ftyp' box
0x000000084D345620M4V brand 'M4V '

About the M4V format

M4V is MP4 as the iTunes Store shipped it. The container is the ISO base media file format, the boxes are the same boxes, the video is normally H.264 and the audio AAC — the only structural difference from a plain .mp4 is the brand string in the FileTypeBox and, on purchased content, a FairPlay encryption layer inside the sample descriptions. Apple used the separate extension so that its own software could route the file to iTunes and so that protected and unprotected media could be told apart at a glance. That is all it means: an unprotected M4V renamed to .mp4 plays in anything, and a protected one will not play anywhere regardless of what it is called, because the bytes of the video have been encrypted rather than merely labelled.

Header layout, byte by byte

OffsetLengthFieldMeaning
04ftyp box sizeBig-endian length of the FileTypeBox including this field. 00 00 00 20 is 32 bytes, which fits a major brand, a minor version and three compatible brands — the shape Apple's and ffmpeg's writers both produce.
44Box type 'ftyp'66 74 79 70. Required by ISO/IEC 14496-12 to be the first box in the file, which puts the only recognisable ASCII in the header at offset 4 instead of offset 0.
84Major brand 'M4V '4D 34 56 20 — capital M, digit 4, capital V, then one ASCII space that is part of the brand. Audio-only siblings from the same family use 'M4A ' and 'M4B ' in exactly this position, and each is padded to four characters the same way.
124Minor versionA big-endian 32-bit number with no normative meaning; 00 00 02 00 is what appears in files remuxed by ffmpeg. It is not a version gate and must not be used to reject a file.
16variableCompatible brandsFour bytes per brand for the rest of the box, commonly 'M4V ' repeated followed by isom, iso2 and avc1. The presence of isom here is the file stating outright that a plain MP4 reader can handle it, which is why renaming so often works.
328Second box headerSize and type of the box after ftyp — 'moov', 'mdat' or a 'free' placeholder. It lands at 32 when the ftyp box is 32 bytes; take the length from offset 0 rather than trusting the position.

Telling it apart from its neighbours

Easily confused withHow to tell
MP4Only the four bytes at offset 8 differ: 'M4V ' against isom, mp42 or avc1. Nothing else in the file has to change, and the compatible-brands list at offset 16 usually contains isom anyway. If you want to know whether a given M4V is genuinely playable, the header will not tell you — look for a 'sinf' protection box inside the sample description, since FairPlay content replaces the codec entry with a protected one.
M4AThe audio-only member of the family, brand 'M4A ' (4D 34 41 20) at offset 8. Byte layout is otherwise identical, so the header alone does not prove there is no video — the definitive answer is the handler type in each track's 'hdlr' box, 'vide' for video and 'soun' for audio. An .m4a with a cover image still has only a sound track.
QuickTime MovieBrand 'qt ' at offset 8. Both formats are Apple's, both are ISO base media files and both routinely hold H.264 and AAC, so people move files between the two extensions freely. The difference that bites is content: QuickTime permits codecs and track types that no M4V consumer expects.
3GPBrand 3gp4, 3gp5 or 3gp6 at offset 8. Both are constrained profiles of the same container aimed at particular devices, one at handsets and one at Apple's players, and both hold H.264 and AAC in the general case — the extension records the intended destination, not a difference in structure.

How these files break

  • DRM mistaken for damage. A purchased, FairPlay-protected M4V has an entirely intact header and a perfectly walkable box tree, and it still refuses to play on anything that is not an authorised Apple device. There is nothing to repair; the sample data is encrypted, and a hex editor confirms it by showing high-entropy bytes where a recognisable H.264 start code should be.
  • The moov box never written. An export or download interrupted partway leaves the mdat full and the index absent, and the result will not open in anything. As with any ISO base media file, the frames are still present and recovering them means reconstructing sample tables from a healthy file made by the same encoder.
  • The brand rewritten by a remux. Passing an M4V through a tool that copies streams without preserving the FileTypeBox produces a file whose bytes at offset 8 now say isom. The video is untouched and plays fine, but iTunes and anything else keying off the brand will treat it as a different kind of file.
  • Truncation. The header is at the very front and stays healthy, so file-type detection still reports M4V correctly on a file that is missing most of its content. Walking the boxes is what exposes it: the final box declares more bytes than the file actually has.
  • A moov at the tail on a slow link. Not corruption, but indistinguishable from it while watching: nothing plays until the last byte arrives, because the index is at the end. Moving it to the front rewrites offsets only and leaves the encoded video exactly as it was.

Where the format stands today

M4V mattered when iTunes was how people bought films and television, and it is largely a historical artefact now that the same catalogue is streamed rather than downloaded. Files still turn up: old iTunes libraries, home videos exported from Apple software, and handbrake presets that emit the extension out of habit. There is no reason to choose it for anything new — MP4 is the same container without the ambiguity, and every player and every browser prefers the plain extension. Where an M4V is what you have, the practical question is only ever whether it is protected. Unprotected, it is an MP4 and needs nothing but a rename. Protected, no converter can help, because what is missing is a key rather than a codec, and any tool claiming otherwise is describing circumvention rather than conversion.

Open M4V files on this site

Every one of these runs in your browser — the file never leaves your machine.

Related formats

Formats that are easy to confuse with M4V — compare their leading bytes.

FormatFirst bytesExtension
MP466 74 79 70.mp4
QuickTime Movie66 74 79 70.mov
M4A66 74 79 70.m4a

Frequently asked questions

What is a magic number in a file?

The first few bytes of a file, which identify its format regardless of what the name says. A PNG always starts with 89 50 4E 47; a ZIP with 50 4B 03 04. Operating systems, browsers and the file command all read these bytes rather than trusting the extension, which is why renaming a file does not change what it actually is.

How do I check a file's magic number myself?

On macOS or Linux, xxd -l 16 yourfile prints the first 16 bytes; on Windows, Format-Hex -Path yourfile -Count 16 in PowerShell. Or drop the file into the File Type Identifier on this site, which reads the bytes locally and names the format for you — nothing is uploaded.

Why do two formats share the same magic number?

Because one is built on the other. Every docx, xlsx, pptx, apk, jar and epub begins with the ZIP signature, since all of them are ZIP archives underneath; telling them apart means looking at the entries inside. Java class files and macOS universal binaries both start with CA FE BA BE and are distinguished by the field that follows.

Can a file have no magic number at all?

Yes. Text-based formats — XML, HTML, JSON, SVG, CSV — have no fixed byte signature, so they are recognized structurally instead: a leading <?xml declaration, a <svg element, or a { followed by a quoted key. That detection is a good guess rather than a certainty, which is why this reference marks those formats as probe-detected.

Does a matching magic number mean the file is safe?

No. It tells you what the format is, not whether the contents are harmless — a genuine PDF or docx can still carry a malicious payload. Identifying the true type is a useful first check, especially when the extension disagrees with the bytes, but it is not a malware scan.

Have a file that might be in the M4V format? Identify it with the File Type Identifier — it reads the magic number locally, nothing is uploaded. Or browse all formats.