Log in

View Full Version : DVD time information


micnieb
27th July 2004, 12:45
Hi,

i'm wondering how to browse a vob file. Within mpeg2-files i'm used to read the gop-header and the included time-code for browsing.

in vob-files all gop-header - time-codes are equal to 0.

how can i browse them? :confused:

greetings,

michael

SansGrip
27th July 2004, 15:36
VOBs also contain timing information, with the SCR (System Clock Reference) in the VOBU pack header, the PTS (Presentation Time Stamp) and DTS (Decode Time Stamp) in -- I think -- the video PES (Packetized Elementary Stream).

Sorry I can't give you more details (my "library" is on my other computer), but those terms should give you something to throw at Google.

micnieb
31st July 2004, 12:46
thx a lot.

but how can i gather a time information from the time-stamps, e.g. convert it to a time information in seconds.

greetings,
michael

SansGrip
31st July 2004, 17:23
The system clock runs at a certain frequency (not sure what, but 27 and 90 spring to mind. Would need to check), and all figures are based on that. So if you know how often the system clock "ticks" you can convert it to seconds pretty easily. For example, if it runs at 50hz (which it doesn't, but let's pretend it does) then there are 50 ticks per second. If a particular packet's PTS is 50, then, it comes one second after the clock is started. 100 is two seconds, and so on.

micnieb
31st July 2004, 18:38
ah, i see.

one last thing to know: ;-)

how are the timestamps encoded? there are three fields for each timestamp. whats their meaning?

for example pack_header in MPEG2-Program-Streams


pack_header() {
pack_start_code 32 bslbf
'01' 2 bslbf
system_clock_reference_base [32..30] 3 bslbf
marker_bit 1 bslbf
system_clock_reference_base [29..15] 15 bslbf
marker_bit 1 bslbf
system_clock_reference_base [14..0] 15 bslbf
marker_bit 1 bslbf
system_clock_reference_extension 9 uimsbf
marker_bit 1 bslbf
program_mux_rate 22 uimsbf
marker_bit 1 bslbf
marker_bit 1 bslbf
reserved 5 bslbf
pack_stuffing_length 3 uimsbf
for (i=0;i<pack_stuffing_length;i++) {
stuffing_byte 8 bslbf
}
if (nextbits() == system_header_start_code) {
system_header ()
}
}


greetings,
michael