0xdeadbeef
13th March 2009, 16:35
This is directed to all experts regarding Blu-Ray and HD-DVD subtitle streams (SUP). Hope that someone out there is able and willing to help me out.
While developing BDSup2Sub, I stumbled over several issues that are still unclear to me and that I feel can't find on my own due to lack of documentation, reference tools or whatever. I'd really appreciate any help on these topics.
1) PTS and DTS time stamps of Blu-Ray SUPs
While I think that I understood the contents of the BD-SUP stream to a degree that I can create more or less correct packets containing palette, window and picture information, I'm not quite sure about the time stamps.
I understand that only the PTS info of the PCS packets is needed to identify the start and stop of display. Yet, while a SUP with correct PTS for (only) these two packets for each subtitle frame is displayed correctly in SupRead, I have reports that muxed to a transport stream, they are not displayed at all.
Since the DTS info is already missing in the SUPs created by EAC3TO, I'd suspect that TsMuxer analyzes the PTS info of the various packets and calculate a multiplex (or frame???) rate from the size of the packet and the according PTS info(s). Yet I was kinda unable to find out which PTS from which packets are needed for this and how to exactly determine the PTS from packet length and the known PTS of the start/stop PCS packets.
Here's an example of the various PTS time stamps from one frame of a BD-SUP created by EAC3TO ( offset to the preceding PTS after the packet name)
PTS Packet Offset
01704BA3 PCS <- start time (known)
01704B4C WDS -87
01703484 PDS -5832
01703532 ODS +174
01703532 END +0
01767B40 PCS +411150 <- end time (known)
01767AE9 WDS -87
01704BA3 END
Suprisingly, the PTS of the WDS packet (which follows after the PCS packet) has a smaller time stamp.
The time stamp of the PDS (palette) and ODS (picture RLE buffer) packets are way (!) before the start time stamp.
I played with the idea that e.g. the (negative?) offset of 5832 was somehow related to the size of the palette info. In this example, there are 254 palette entries, each 5 bytes in size. Ignoring additional data in this packet: (1270*8)/(5832/90000) = 156790 bits/s. Does this make any sense??? I wouldn't think so, especially since following this logic, the ODS packet would need a much larger offset - which it hasn't.
I kinda completely fail to see the logic in this.
Or am I completely off the track and it's the missing DTS info tha TsMuxer needs? At least (and in contrast to EAC3TO) it seems to export the DTS info for some packets.
Clues?
2) Order of Cb and Cr components in BD-SUPs and HD-DVD SUPs
I'm not quite sure about the order of the Cb and Cr color components in the palette info of BD- and HD-DVD SUPs and unfortunately, I didn't find a single example of a colored (non white) subtitle for either formats to verify this.
BDSup2Sup currently assumes that the palette info in a BD-SUP is stored like this: "Index, Y, Cb, Cr, Alpha", while it is stored like this in HD-DVD SUPs: "Y, Cr, Cb". Is this correct or a the Cr/Cb components swapped for either or both format(s)?
[EDIT]
Ok, found out myself that BD-SUP is definitely using "Y, Cr, Cb" ("Iron Man" uses colored captions). So HD-DVD is probably the same.
3) Video size in HD-DVD SUPs
While VobSub and BD-SUP contain size information (e.g. 1920x1080 or 720x480) of the video stream for each subpicture frame, the HD-DVD SUP format doesn't seem to have this kind of information. Is it safe to assume that the size of the video stream of a HD-DVD is always 1920x1080?
4) Maximum number of palette entries for BD-SUP
While it seems logical to assume that the maximum of entries is 256 for an 8bit palette, all the BD-SUPs I encountered had only 255 entries or less. Is there a limitation to 255 or is this just by chance?
5) Forced Subs in HD-DVD SUPs
I couldn't find any info if there are "forced" subtitles in HD-DVD SUPs as there are in BD-SUPs. If so, where?
6) Multi-Packet RLE-Buffers in HD-DVD SUPs
Since SUB/IDX as well as BD-SUP spread the RLE buffer over multiple packets, I wondered if HD-DVD SUP streams can do so as well.
7) WDS info used for what?
What exactly is the info in the WDS packet used for? As the image size and offset is also stored somewhere else, the info there seems to be redundant. So can the information from the WDS packet be discarded completely or is it useful for something?
While developing BDSup2Sub, I stumbled over several issues that are still unclear to me and that I feel can't find on my own due to lack of documentation, reference tools or whatever. I'd really appreciate any help on these topics.
1) PTS and DTS time stamps of Blu-Ray SUPs
While I think that I understood the contents of the BD-SUP stream to a degree that I can create more or less correct packets containing palette, window and picture information, I'm not quite sure about the time stamps.
I understand that only the PTS info of the PCS packets is needed to identify the start and stop of display. Yet, while a SUP with correct PTS for (only) these two packets for each subtitle frame is displayed correctly in SupRead, I have reports that muxed to a transport stream, they are not displayed at all.
Since the DTS info is already missing in the SUPs created by EAC3TO, I'd suspect that TsMuxer analyzes the PTS info of the various packets and calculate a multiplex (or frame???) rate from the size of the packet and the according PTS info(s). Yet I was kinda unable to find out which PTS from which packets are needed for this and how to exactly determine the PTS from packet length and the known PTS of the start/stop PCS packets.
Here's an example of the various PTS time stamps from one frame of a BD-SUP created by EAC3TO ( offset to the preceding PTS after the packet name)
PTS Packet Offset
01704BA3 PCS <- start time (known)
01704B4C WDS -87
01703484 PDS -5832
01703532 ODS +174
01703532 END +0
01767B40 PCS +411150 <- end time (known)
01767AE9 WDS -87
01704BA3 END
Suprisingly, the PTS of the WDS packet (which follows after the PCS packet) has a smaller time stamp.
The time stamp of the PDS (palette) and ODS (picture RLE buffer) packets are way (!) before the start time stamp.
I played with the idea that e.g. the (negative?) offset of 5832 was somehow related to the size of the palette info. In this example, there are 254 palette entries, each 5 bytes in size. Ignoring additional data in this packet: (1270*8)/(5832/90000) = 156790 bits/s. Does this make any sense??? I wouldn't think so, especially since following this logic, the ODS packet would need a much larger offset - which it hasn't.
I kinda completely fail to see the logic in this.
Or am I completely off the track and it's the missing DTS info tha TsMuxer needs? At least (and in contrast to EAC3TO) it seems to export the DTS info for some packets.
Clues?
2) Order of Cb and Cr components in BD-SUPs and HD-DVD SUPs
I'm not quite sure about the order of the Cb and Cr color components in the palette info of BD- and HD-DVD SUPs and unfortunately, I didn't find a single example of a colored (non white) subtitle for either formats to verify this.
BDSup2Sup currently assumes that the palette info in a BD-SUP is stored like this: "Index, Y, Cb, Cr, Alpha", while it is stored like this in HD-DVD SUPs: "Y, Cr, Cb". Is this correct or a the Cr/Cb components swapped for either or both format(s)?
[EDIT]
Ok, found out myself that BD-SUP is definitely using "Y, Cr, Cb" ("Iron Man" uses colored captions). So HD-DVD is probably the same.
3) Video size in HD-DVD SUPs
While VobSub and BD-SUP contain size information (e.g. 1920x1080 or 720x480) of the video stream for each subpicture frame, the HD-DVD SUP format doesn't seem to have this kind of information. Is it safe to assume that the size of the video stream of a HD-DVD is always 1920x1080?
4) Maximum number of palette entries for BD-SUP
While it seems logical to assume that the maximum of entries is 256 for an 8bit palette, all the BD-SUPs I encountered had only 255 entries or less. Is there a limitation to 255 or is this just by chance?
5) Forced Subs in HD-DVD SUPs
I couldn't find any info if there are "forced" subtitles in HD-DVD SUPs as there are in BD-SUPs. If so, where?
6) Multi-Packet RLE-Buffers in HD-DVD SUPs
Since SUB/IDX as well as BD-SUP spread the RLE buffer over multiple packets, I wondered if HD-DVD SUP streams can do so as well.
7) WDS info used for what?
What exactly is the info in the WDS packet used for? As the image size and offset is also stored somewhere else, the info there seems to be redundant. So can the information from the WDS packet be discarded completely or is it useful for something?