Media_Dev

How to set PES or Header wheninput to MPEG-2 TS system with H.264

jaster 2011. 9. 14. 20:39
반응형

In order to encapsulate H.264 video sequence to MPEG-2 TS system, each frame of H.264 has to be divided by some information in the syntax of H.264. If each frame of H.264 is divided, it is possible to make MPEG-2 PES for each H.264 frame.

Each frame as like PES especially IDR (Iframe) needs to some signature for SPS, PPS and flag of Au – Delimiter below

Delimiter-IFrame(6)= 0, 0, 0, 1, 9, 10

Delimiter-PFrame(6)= 0x00, 0x00, 0x00, 0x01, 0x09, 0x30

Delimiter-BFrame(6)= 0x00, 0x00, 0x00, 0x01, 0x09, 0x50

 

So, IDR PES packet must be below each IFrame of h.264

00 00 00 01 09 10 00 00 00 01 67 42 e0 0c 96 54 0a 0f c8 00 00 00 01 68 ce 01 ac 50 80 00 00 00 01 65

00 00 00 01 09 10                        :Starting flag + AU.
00 00 00 01 67 42 e0 0c 96 54 0a 0f c8    : H.264 SPS or PPS with Starting code.
00 00 00 01 68 ce 01 ac 50 80                : h.264 pps or  with Starting bitrate code .
0 00 00 01 65                               : h.264 NAL header it is present to IFrame.

In other word, this will be like order

I-             frame
AU > SCP > SPS > SCP > PPS > SCP > NAL header > data.

P-      frame

        AU > SCP > NAL header > NAL data

Maybe you could find more detail means, PES is smallest unit in Mpeg2-TS.

반응형