PDA

View Full Version : MPEG-PES packet, understanding VOB format


konran
10th September 2008, 02:21
Hello again,

meanwhile I got stuck with PES packet headers in VOB files when I analyze these headers. Could anyone please explain how I should interpret things I've found in there (on a VOB that is DVD PAL, 1 MPEG2 video stream, 1 AC3 audio stream):

- the PES system header says that video and audio bound both are 1
=> I interpret this to be 1 video stream + 1 audio stream
(so far so good)

- stream ID's B9 and B8 in the system header tell me that P-STD applies
to all video streams and to all audio streams as well

- next I find stream ID's BD and BF in the system header. ISO 13818-1 says that any valid stream should be >= BC which should be interpreted according to stream id assignments.

Now that's my problem: BD normally is private stream 1 and BF is private stream 2. Can the be video or audio streams? Further I've found that BF is used for navigation packet information.

So, how do I have to treat the information of stream ID's in my system header? ... I regularly find E0 packets after the system header which are correctly formatted as video packets. E0 is not listed in the system header. And I don't find any C0's or similar that I would expect as an ID for the audio stream.

There is another problem also with VOB's: I'm trying to read timing information from the PES video packets at the beginning and end of the file. It is fine for the first VOB of a title set but I'm failing on all following VOB files of the same title set because the starting timestamp is greater than the ending timestamp in the file.

First I thought that I get a wrap around of the PTS/DTS values in between there so I added the maximum of a 33 bit value but the result is far off the reality. How are timestamps in a VOB coded?

Is the first timestamp something of the ending time of the previous file in the same title set? If yes, what's going on afterwards?

Regards,
Konran

konran
11th September 2008, 13:50
OK, it seems that my last post was not clearly explained what I needed to know. Here is a 2nd attempt as I found out some things since my previous thread:

1.) Some articles in the web say that non-MPEG audio PES headers in a VOB (denoted by private stream 1 = 00 00 01 bd) contain also timing information. Does anyone have a spec of such a PS1 header?

I only find the start code 00 00 01 bd, 2 bytes length (e.g. 07 ec) and the sub-stream ID (e.g. 81) - but I'm not aware of any format spec coming after the sub-stream ID.

2.) Analyzing a PES system header (00 00 01 bb) in a VOB (which has 1 MPEG 2 video stream PAL D1 and 1 AC3 audio stream) I find information for two streams: 0xbd and 0xbf. But these stream ID's are private stream 1 and private stream 2.

How should these stream ID's be handled? I know later when I read packets with these stream ID's that I get audio sub-stream 0x81 in PS1 and VOB NAV packets PCI/DSI in two subsequent PS2 packets ... but I don't know that before reading the first one actually, do I?

3.) How can I calculate the real duration of an individual VOB file of a title set, e.g. 2nd file of a VTS? In the video header given with 00 00 01 e0 I find a start PTS/DTS preceeding the first sequence header which is greater than the PTS/DTS preceeding the last sequence header.

Is there something I might have not read out but I needed to?

Regards and in the real hope of help ;-)
Konran

blutach
11th September 2008, 14:22
Look here (if you are a member of mpucoder.com)

http://www.mpucoder.com/DVD/pes-hdr.html

Regards

konran
12th September 2008, 01:30
Thanks, Les:)
http://www.mpucoder.com/DVD/pes-hdr.html

That answers question 1.
... and I didn't find anything about 2. and 3.

Any idea about that?
Regards

neuron2
12th September 2008, 03:22
For DVDs, private stream 2 are always nav packs.

For Private stream 1, you can have AC3, DTS, PCM, MPEG, or AAC audio.

konran
12th September 2008, 13:56
So when I find a system header 00 00 01 bb and I get stream information of
- 0xbd: I only know that I'll expect any positive number of non-MPEG audio streams present in the stream without knowing which sub-stream ID's to come
- 0xbf: I know to expect VOB NAV packs present in the stream

Right?

And what about the timing thing that drives me really crazy? PTS/DTS values of video stream header always seem to be synchronized with the NAV pack PTS'es ... but when I get greater values at the beginning of a follow-up VOB file than at the end of the same file, how to deal with that?

neuron2
12th September 2008, 15:25
- 0xbd: I only know that I'll expect any positive number of non-MPEG audio streams present in the stream without knowing which sub-stream ID's to come
- 0xbf: I know to expect VOB NAV packs present in the stream

Right? Right, unless you parse the IFO file.

And what about the timing thing that drives me really crazy? PTS/DTS values of video stream header always seem to be synchronized with the NAV pack PTS'es ... but when I get greater values at the beginning of a follow-up VOB file than at the end of the same file, how to deal with that? Determining playing time from PTS values is notoriously unreliable, for various reasons. I'm not an expert on DVDs, but the time may be available in the IFO file. You should post about it in the DVD Authoring or IFO/VOB Editors forum, as it is not an MPEG2 Encoding issue.

blutach
13th September 2008, 01:53
So when I find a system header 00 00 01 bb and I get stream information of
- 0xbd: I only know that I'll expect any positive number of non-MPEG audio streams present in the stream without knowing which sub-stream ID's to come
Up to 8 of them anyway (and up to 32 subpic streams).

- 0xbf: I know to expect VOB NAV packs present in the streamNavPacks are present at the start of every GOP. You will also see NavPacks on a still, where the only things that change are the clock references (mux a still in muxman, set the time for say 3 seconds, and examine in VobEdit).

Regards

konran
14th September 2008, 18:06
Thanks all, that will help.

@neuron2: My main task is (and always was) only parsing most of MPEG 1&2 formats. I never intended do add a second parsing interface for additional files. Although IFO's might contain those informations it will produce again overhead on non-documented or well-paid for tons of $'s specification documents I want to avoid.

@Les: That's valuable to know that every GOP has a NavPack preceeding it. So I've found the possible problem I ran into: due to the discontinuity of VOB file splitting I find a NavPack at the beginning of the second VOB file in sequence that belongs to the first VOB ID instead of marking the introducing part of VOB ID 2 ... as this file ends up with a NavPack of VOB ID 2.

So I'll continue this point in one of the matching forums.

Regards,
Konran

gurpreet1989
17th February 2011, 10:57
from system header of mpeg file i get audio bound=1 and video bound=1 what is the meaning of that.

i think this is the number of video and audio stream in one pack header.......but after some time i found this is wrong.....please tell me about this

but 000001BF AND 000001BD are not found in mpeg file........

IS it possible to find the length of a slice in a picture............

tell me about how to find number of times 000001E0 and 000001C0 exist in one mpeg file