Log in

View Full Version : h264 in Transport Stream pes but no AU


tidi
19th October 2010, 09:42
Hello all,

I have a transport stream with two elementary streams one is an aac and the other one is a h264.

I've got few PES with timestamp but without h264 access unit delimiter.

If I demux the TS looking for PES this gives me some image error because that image is not valid...

do someone know if this is compliant with the standard or not?

Thanks,
TD

kieranrk
19th October 2010, 10:39
H.264 in TS requires access unit delimiters. For some reason a few TV channels send out SPS, PPS and AUD (the AUD should be first).

tidi
19th October 2010, 10:52
H.264 in TS requires access unit delimiters. For some reason a few TV channels send out SPS, PPS and AUD (the AUD should be first).

The AUD is present in almost every PES, so in the ones that is not present I demux an invalid h264 AU.

my TS will look something like this

PES + AUD
PES + AUD
PES + AUD
...
PES NO AUD
...
PES + AUD
PES + AUD
...
PES NO AUD
...
END

in this case the PES WITH NO AUD will end up in a corrupted image, the decoder cannot decode the AU.

is this a valid TS?

Thanks

kieranrk
19th October 2010, 10:58
AUDs are not needed for decoding. They are merely separators between frames. Your corrupted image is likely caused by something else.

tidi
19th October 2010, 11:24
AUDs are not needed for decoding. They are merely separators between frames. Your corrupted image is likely caused by something else.

The problem is the demuxing of the frames. If I parse the TS looking for PES and not AUD I end up with two invalid frames.

for my understanding a frame that does not have an AUD is not valid, and in fact the decoder cannot decode it.

In the Transport streams without that "problem" I can demux every frame correctly and everything is fine.

kieranrk
19th October 2010, 11:56
for my understanding a frame that does not have an AUD is not valid, and in fact the decoder cannot decode it.


It would strictly not be valid for TS encapsulation but a decoder would be able to decode the frame.

skontel
21st October 2010, 01:39
The problem is the demuxing of the frames. If I parse the TS looking for PES and not AUD I end up with two invalid frames.

for my understanding a frame that does not have an AUD is not valid, and in fact the decoder cannot decode it.

In the Transport streams without that "problem" I can demux every frame correctly and everything is fine.

The amendment to 13818-1 that covers H.264 encapsulation inside the TS mandates that H.264 video *must* have AUD when encapsulated inside the TS. So, the AUD is optional for other container formats (MP4, AVI, MKV, etc.), but it is mandatory for the TS.

Was your TS content broadcast? Is it possible it was received with an error, or perhaps you missed the TS packet with the AUD in it?

Hope this helps.

Shevach
24th October 2010, 08:19
Even if AUD is not present it is easy for Main/Haigh H.264 profiles to find picture boundaries.

If first_mb_in_slice (the first parameter in slice data header) is 0 then picture starts here.

Reimar
24th October 2010, 11:31
Even if AUD is not present it is easy for Main/Haigh H.264 profiles to find picture boundaries.

If first_mb_in_slice (the first parameter in slice data header) is 0 then picture starts here.

No, the rules are _far_ more complex. This only works if you just ignore all the difficult cases like FMO/ASO. It will work fine for probably more that 99% of cases, but it certainly is _not_ correct.