[ExtractStream] [HTML inside] MPEG Stream questions...

Roger Merchberger zmerch7 at y...
Sun, 14 Apr 2002 21:27:51 -0700 (PDT)


--- "Edmond E. Shwayri" <eshwayri@n...> wrote:
> A record in a TY file is of the following format :
> 
> Audio sub-types :
> #define TY_APES_SUBTYPE 0x03 // Audio PES packet
> sub-type.
> #define TY_AFRAME_SUBTYPE 0x04 // Audio frame sub-type.
> #define TY_AFRAME_CONTINUE 0x02 // Audio data continues
> from the 
> prev sub-type.
> 
> Video sub-types :
> #define TY_VHEADER_SUBTYPE 0x07 // Video header
> sub-type.
> #define TY_VGOP_SUBTYPE 0x0C // Video
> group-of-pictures 
> sub-type.
> #define TY_VPES_SUBTYPE 0x06 // Video PES packet
> sub-type.
> #define TY_IFRAME_SUBTYPE 0x08 // Video I-Frame
> sub-type.
> #define TY_BFRAME_SUBTYPE 0x0B // Video B-Frame
> sub-type.
> #define TY_PFRAME_SUBTYPE 0x0A // Video P-Frame
> sub-type.
> #define TY_VFRAME_CONTINUE 0x02 // Video data
> continues from 
> the prev sub-type.
> 
> All EXCEPT for 0x02 are approximately the start of the mpeg packet.
> I say 
> approximately because it starts with [number of 0s] then 00 00 01. 
> The 
> number of 0's pre-padded is between is 0 and 4
> 
> From what I've read, the MPEG spec allows for 0 padding. The way
> you tell 
> when an MPEG packet starts is by looking for the 00 00 01.

Interesting... so the 4-byte packets [for the most part] Tivo's way
of saying to the decoder -- "Hold up - there's a little bit more MPEG
info on it's way, but we had to wrap it in something..."
So do you know if the padding is optional, or is it necessary for a)
timing purposes or b) "error control" to ensure enough '00' data to
let the decoder know definitively that the next header won't get
'lost' in the data?
Also - I noticed that in the MPEG spec that audio blocks use not just
C0, but C0 - DF as Stream ID's, and video blocks can actually use E0
thru EF as Stream ID's. In the splitstream (and of course zss) code
it checks the Tivo headers for C0 & E0 for audio & video
respectively... any chance that the Tivo code might use more than one
Stream ID as well?

Conspiring minds want to know... ;-)

Laterz,
Roger "Merch" Merchberger

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/