Aug
02
2010

MPEG Headers

MPEG Headers Quick Reference

This is a quick reference to the various headers and streams found in MPEG/DVD. For a complete description you should get a copy of ISO/IEC 13818.
This is an incomplete work-in-progress

The header

Every stream or table begins with a 32-bit start code, codes 00 through B8 are video stream start codes (fully defined in 13818-2), and codes B9-FF are stream-id’s

byte 0 byte 1 byte 2 byte 3
0000 0000 0000 0000 0000 0001
Start code prefix
Start Code
-or-Stream ID

Start Code

used for
0x00 Picture
0x01 – 0xAF slice
0xB0 reserved
0xB1 reserved
0xB2 user data
0xB3 Sequence header
0xB4 sequence error
0xB5 extension
0xB6 reserved
0xB7 sequence end
0xB8 Group of Pictures
Stream ID used for
0xB9 Program end (terminates a program stream)
0xBA Pack header
0xBB System Header
0xBC Program Stream Map
0xBD Private stream 1
0xBE Padding stream
0xBF Private stream 2
0xC0 – 0xDF MPEG-1 or MPEG-2 audio stream
0xE0 – 0xEF MPEG-1 or MPEG-2 video stream
0xF0 ECM Stream
0xF1 EMM Stream
0xF2 ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Annex A or ISO/IEC 13818-6_DSMCC_stream
0xF3 ISO/IEC_13522_stream
0xF4 ITU-T Rec. H.222.1 type A
0xF5 ITU-T Rec. H.222.1 type B
0xF6 ITU-T Rec. H.222.1 type C
0xF7 ITU-T Rec. H.222.1 type D
0xF8 ITU-T Rec. H.222.1 type E
0xF9 ancillary_stream
0xFA – 0xFE reserved
0xFF Program Stream Directory


byte 4 byte 5 byte 6 byte 7
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
temporal sequence number frame type
1=I, 2=P
3=B, 4=D
VBV delay

3 2 1 0
full_pel_forward_vector forward_f_code

3 2 1 0
full_pel_backward_vector backward_f_code


byte 4 byte 5 byte 6 byte 7
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
horizontal size vertical size aspect ratio frame rate
byte 8 byte 9 byte 10 byte 11
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
bit rate 1 VBV buffer size constrained parameters flag load intra quantiser matrix (load non-intra quantiser matrix)

Code MPEG-1 Aspect Ratio (PAR) MPEG-2 Aspect Ratio (DAR) Frame Rate
0 forbidden forbidden forbidden
1 1.0000 1:1 24000/1001 (23.976)
2 0.6735 4:3 24
3 0.7031 PAL 16:9 16:9 25
4 0.7615 2.21:1 30000/1001 (29.97)
5 0.8055 reserved 30
6 0.8437 NTSC 16:9 reserved 50
7 0.8935 reserved 60000/1001 (59.94)
8 0.9375 PAL 4:3 reserved 60
9 0.9815 reserved reserved
10 1.0255 reserved reserved
11 1.0695 reserved reserved
12 1.1250 NTSC 4:3 reserved reserved
13 1.1575 reserved reserved
14 1.2015 reserved reserved
15 reserved reserved reserved


byte 4 byte 5 byte 6 byte 7 byte 8 byte 9
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0001 profile and level progressive_sequence chroma_format horizontal size extension vertical size extension bit rate extension 1 vbv buffer size extension low delay frame rate extension n frame rate extension d

byte 4 byte 5 byte 6 byte 7 byte 8
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0010 video format color description flag =0 display horizontal size 1 display vertical size

byte 4 byte 5 byte 6 byte 7 byte 8 byte 9 byte 10 byte 11
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0010 video format color description flag =1 color primaries transfer characteristics matrix coefficients display horizontal size 1 display vertical size

byte 4 byte 5 byte 6 byte 7 byte 8
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0111 frame_center_horizontal_offset[1] 1 frame_center_vertical_offset[1] 1

byte 4 byte 5 byte 6 byte 7 byte 8 byte 9 byte 10 byte 11 byte 12
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0111 frame_center_horizontal_offset[1] 1 frame_center_vertical_offset[1] 1 frame_center_horizontal_offset[2] 1 frame_center_vertical_offset[2] 1

byte 4 byte 5 byte 6 byte 7 byte 8 byte 9 byte 10 byte 11 byte 12 byte 13 byte 14 byte 15 byte 16 byte 17
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0111 frame_center_horizontal_offset[1] 1 frame_center_vertical_offset[1] 1 frame_center_horizontal_offset[2] 1 frame_center_vertical_offset[2] 1 frame_center_horizontal_offset[3] 1 frame_center_vertical_offset[3] 1

byte 4 byte 5 byte 6
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
1000 f_code[0][0] (forward horizontal) f_code[0][1] (forward vertical) f_code[1][0] (backward horizontal) f_code[1][1] (backward vertical) intra_DC_precision picture_structure
byte 7
7 6 5 4 3 2 1 0
Top_Field_First frame_pred_frame_dct concealment_motion_vectors q_scale_type intra_vlc_format alternate_scan Repeat_First_Field chroma_420_type
byte 8 byte 9 byte 10
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
progressive_frame composite_display =0 0 0 0 0 0 0 (not present)
=1 v_axis field_sequence sub_carrier burst_amplitude sub_carrier_phase 0 0


byte 4 byte 5 byte 6 byte 7
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
drop frame flag hour (0-23) minute (0-59) 1 second (0-59) frame (0-59) closed GOP broken GOP 0 0 0 0 0
Written by doutdex in: Uncategorized |

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

%d bloggers like this: