patrick_
26th October 2009, 00:16
Where can I find detailled information about IFO (DVDVIDEO-VTS) stream mapping? I'm quite sure I've found where in the file is located the data about streams, but I'm having trouble with the mapping.
Before I'll start, I'm talking about the base addresses, I know that it isn't requiered to have a stream like that, but sure it can't have a lower mapping (so the lowest audio map is 0x80, although it's possible that the first stream is 0x82).
Audio streams seem to be always at 0x80 but for programs like vstrip or ifoedit display 0xc0 for MPEG1. Where does this number come from? Is it a 0x80 modified because of the format?
Subtitles are at either (Deja Vu):
0x80 0x01 0x01 0x00
0x80 0x02 0x02 0x00
0x80 0x03 0x03 0x00
or (Futurama)
0x80 0x00 0x00 0x00
0x81 0x00 0x00 0x00
0x82 0x00 0x00 0x00
but in both cases ifoedit & vstrip show that they are mapped at 0x20, 0x21 and 0x22.
It's not that it would be hard to convert these numbers, but I'ld like to know where they come from. In case that it's just a conversion, does audio only map to 0xc0 when it is MPEG1, or also with other codecs?
Thanks in advance.
Alex_ander
26th October 2009, 06:51
Tables for video, audio and subpicture attributes:
http://dvd.sourceforge.net/dvdinfo/ifo.html#vidatt
http://dvd.sourceforge.net/dvdinfo/ifo.html#audatt
http://dvd.sourceforge.net/dvdinfo/ifo.html#spatt
The numbers are given in natural form there.
r0lZ
26th October 2009, 07:31
The ID of the stream in the VOB file depends of the coding mode (see bits 5-7 of byte 0 here (http://www.mpucoder.com/DVD/ifo.html#audatt)) and of the decoding stream number (PGC_AST_CTL and PGC_SPST_CTL) defined in the PGC header (http://www.mpucoder.com/DVD/pgc.html).
Since there is only one coding mode for the subpics, their IDs are always numbered starting at 0x20, so stream 0 is 0x20, stream 1 is 0x21, etc...
Your Deja Vu example above is relatively strange (but legal), as stream 0 is not used. Typically, for a 16:9 movie, the definition of the first stream is:
0x80 0x00 0x00 0x00 if the same stream is used for all available display modes, or
0x80 0x00 0x01 0x00 if they have designed two different streams for the wide and letterbox modes, or
0x80 0x00 0x00 0x01 if they have designed two different streams for the wide and pan&scan modes, or
0x80 0x00 0x01 0x02 when they have designed 3 different streams (wide, letterbox & pan&scan) but this is extremely rare.
The first byte corresponds to the 4:3 display mode (ignored if the movie is in 16:9), and the 3 following bytes are used for the wide, letterbox and pan&scan modes (ignored for a 4:3 movie).
Since in 16:9 the 4:3 aspect ratio is ignored, the first stream decoding value is always 0.
Note that bit 7 of byte 0 must always be set to indicate that the stream is enabled and can be used by the player or selected by the user. Hence the 0x80 in the first byte.
For 4:3 movies, only the first byte is used (4:3 display mode), so it is 0x80 (to enable the stream) plus the decoding stream number. Your Futurama example is typical. It defines 3 different languages, with decoding streams 0x00, 0x01 and 0x02 (corresponding to the stream IDs 0x20, 0x21 and 0x22 in the VOBs.)
The audio doesn't depend of the display mode, so there is only one audio decoding stream per language in the PGC header. But there are several coding modes for the audio streams, so the ID in the VOB depends of the coding mode and the decoding stream number of the IFO. Bit 7 of the decoding stream must also be set to enable the stream.
The stream IDs start at:
0x80: AC3
0x88: DTS
0x90: SDDS
0xA0: LPCM
0xC0: MPEG
0xC8: MPEG2-ext
So, for the first AC3 stream (with decoding stream number 0), the stream ID is 0x80. If the second stream is, say, a DTS stream, its decoding stream number is 1, and its stream ID is 0x89.
In the PGC header, that streams are defined as 0x80 and 0x81 (the decoding stream number ORed with 0x80 to enable it). There is no mention of the coding mode in the PGC header, so to deduce the stream ID, you have to get the stream number in the PGC header, and the coding mode in the table of the Audio Attributes.
The Video, Audio and Subpic Attributes are defined at offsets 0x100 (for the menus) and 0x200 (for the titles) in the corresponding IFO file headers (http://www.mpucoder.com/DVD/ifo.html), and there is a copy (not always accurate) of those tables in the VMG_VTS_ATRT table (http://www.mpucoder.com/DVD/ifo_vmg.html#atrt) in VIDEO_TS.IFO.
@Alex_ander: the info at sourceforge might not be up to date. It is preferable to link to the source site, by mpucoder, since it is now free.
Alex_ander
26th October 2009, 12:49
@Alex_ander: the info at sourceforge might not be up to date. It is preferable to link to the source site, by mpucoder, since it is now free.
Thanks for the info r0lZ, it was member-only area for long time, nice it's in free access now.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.