Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th October 2010, 09:42   #1  |  Link
tidi
Registered User
 
Join Date: Feb 2010
Posts: 13
h264 in Transport Stream pes but no AU

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
tidi is offline   Reply With Quote
Old 19th October 2010, 10:39   #2  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 713
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).
kieranrk is offline   Reply With Quote
Old 19th October 2010, 10:52   #3  |  Link
tidi
Registered User
 
Join Date: Feb 2010
Posts: 13
Quote:
Originally Posted by kieranrk View Post
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
tidi is offline   Reply With Quote
Old 19th October 2010, 10:58   #4  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 713
AUDs are not needed for decoding. They are merely separators between frames. Your corrupted image is likely caused by something else.
kieranrk is offline   Reply With Quote
Old 19th October 2010, 11:24   #5  |  Link
tidi
Registered User
 
Join Date: Feb 2010
Posts: 13
Quote:
Originally Posted by kieranrk View Post
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.
tidi is offline   Reply With Quote
Old 19th October 2010, 11:56   #6  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 713
Quote:
Originally Posted by tidi View Post
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.
kieranrk is offline   Reply With Quote
Old 21st October 2010, 01:39   #7  |  Link
skontel
Encoding Slave
 
skontel's Avatar
 
Join Date: Feb 2007
Posts: 13
Quote:
Originally Posted by tidi View Post
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.
skontel is offline   Reply With Quote
Old 24th October 2010, 08:19   #8  |  Link
Shevach
Video compressionist
 
Join Date: Jun 2009
Location: Israel
Posts: 126
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.
Shevach is offline   Reply With Quote
Old 24th October 2010, 11:31   #9  |  Link
Reimar
Registered User
 
Join Date: Jun 2005
Posts: 278
Quote:
Originally Posted by Shevach View Post
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.
Reimar is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.