Pregunta

If picture header is codec dependent or there is some general location where we can find picture header in transport stream ?

¿Fue útil?

Solución

What you're trying to do is Start Codes Extraction.

If you have a raw Transport Stream with MPEG-2 video:

  1. Look for packets which have the PayloadUnitStartIndicator bit set in the TS header, this indicates the start of a PES packet.
  2. You need to look at the 4th byte of such PES packet to determine the StreamId. The PES Start Code looks like this

    0x00 0x00 0x01 0xXY

The PES Start Code for a packet with a Picture header is

0x00 0x00 0x01 0x00

For H.264 I believe you would be interested in packets which have the Sequence Parameter Set (SPS) and/or the Picture Parameter Set (PPS) NAL units instead of the picture header.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top