Introduction
An .m2v file holds MPEG-2 video on its own, with no audio and no
container. MPEG-2 video, defined by ITU-T H.262 and ISO/IEC 13818-2, is the codec of
DVD video and of standard-definition digital television. DVD authoring tools take the
video as an .m2v file and the audio as separate files, then multiplex them
into the disc’s VOB files.
MPEG-1 video streams have the same layout and are sometimes saved as
.m1v.
Structure
The stream is made of headers and data, each header starting with a start code: the
bytes 00 00 01 and a code byte. B3 is the sequence header,
with the frame size, aspect ratio, frame rate and bit rate; B5 is an
extension, which marks the stream as MPEG-2 rather than MPEG-1; B8 starts
a group of pictures; 00 is a picture header; 01 to
AF are slices of the picture; and B7 ends the sequence.
000 00 01 B3 sequence headervaries…00 00 01 B5 sequence extensionvaries…00 00 01 B8 group of pictures8 bytes…00 00 01 00 picture header, then its slicesrepeated…00 00 01 B7 sequence end4 bytes
Reference
- Start codes – every code, the order of headers, and how to tell MPEG-1 from MPEG-2
- Sequence header – every field, the aspect ratio and frame rate codes, and quantiser matrices
- Extensions – all twelve extensions, profiles and levels, and the colour codes
- Pictures and slices – the group of pictures, picture and slice headers, content description data and frame packing user data
- Macroblocks – the macroblock and block syntax and every variable-length code table
Not described
The pages follow ITU-T H.262 (the free 2000 edition with its amendments, which carry the consolidated text).
Known, not yet covered
- Reference: the decoding processes (inverse quantisation arithmetic, IDCT accuracy, motion compensation, spatial upsampling and the weights of Table 7-21), the per-profile tables of Annex E and the limits of the scalable profiles (only Main profile and 4:2:2 limits are given).
- Reference: MPEG-1 video (ISO/IEC 11172-2) is described from web sources, not from that standard.
- Viewer: there is no MPEG-2 video viewer plugin yet; the explorer shows the file as bytes.
Links
Software
- FFmpeg and ffplay – command-line tools that play, write and convert MPEG-2 video (Windows, macOS, Linux)
- VLC media player – free media player that plays M2V files (Windows, macOS, Linux, mobile)
- mpv – free, minimal media player (Windows, macOS, Linux)
- Adobe Media Encoder – Adobe’s encoder, which writes MPEG-2 for DVD (Windows, macOS)
Developers
- libavcodec – FFmpeg’s codec library, which decodes and encodes MPEG-2 video (C)
Reference
- ITU-T Recommendation H.262 – the MPEG-2 video standard
- MPEG headers quick reference – start codes and header fields as used on DVD
- cbs_mpeg2_syntax_template.c – FFmpeg’s field-by-field syntax of the MPEG-2 headers