Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th June 2009, 17:01   #1  |  Link
extra
Registered User
 
Join Date: Apr 2009
Posts: 10
VOB timestamp reset

I have a VOB file:
http://www.dvdloc8.com/distributorcl...id=15&clipid=2

The present time stamp increases but will reset to zero and start over again near the end of the file. Does anyone know why it works like this? Is this the reason many player could not recognize correctly the play duration of a vob file? How are decoders/demuxers supposed to deal with this?

Thanks for any help!
extra is offline   Reply With Quote
Old 29th June 2009, 17:14   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
It's not that unusual because the leadin is often encoded separately from the main movie, etc.
Guest is offline   Reply With Quote
Old 29th June 2009, 19:11   #3  |  Link
extra
Registered User
 
Join Date: Apr 2009
Posts: 10
In this case shouldn't the leadin and main movie have two different Stream ID? In this file, the Stream ID for video is the same, always 0xE0... Should the demuxer regard them as two different streams?
extra is offline   Reply With Quote
Old 29th June 2009, 19:32   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by extra View Post
In this case shouldn't the leadin and main movie have two different Stream ID?
I'm not aware of any spec that asserts such a thing.

Quote:
Should the demuxer regard them as two different streams?
Not at the elementary video syntax level. Aren't they differentiated in the DVD structure?
Guest is offline   Reply With Quote
Old 30th June 2009, 15:22   #5  |  Link
extra
Registered User
 
Join Date: Apr 2009
Posts: 10
Quote:
I'm not aware of any spec that asserts such a thing.
But if we stick to the spec of MPEG2 program stream, the last few packets should be displayed at the very beginning of the program, causing duplicate timestamps... I must be missing something, like a new time reference...

Quote:
Not at the elementary video syntax level. Aren't they differentiated in the DVD structure?
VOB file is 100% MPEG2 program stream compatible... so I guess it should be able to play correctly even without the DVD structure. Am I wrong?
extra is offline   Reply With Quote
Old 30th June 2009, 15:53   #6  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by extra View Post
But if we stick to the spec of MPEG2 program stream, the last few packets should be displayed at the very beginning of the program, causing duplicate timestamps... I must be missing something, like a new time reference...
I suppose you are missing the SCR, which is the timebase of the stream.

Don't forget that the timestamps (SCR, PTS, DTS) are a finite size in bits, so they can wrap back to zero in normal operation.
Guest is offline   Reply With Quote
Old 30th June 2009, 16:08   #7  |  Link
extra
Registered User
 
Join Date: Apr 2009
Posts: 10
Quote:
Originally Posted by neuron2 View Post
I suppose you are missing the SCR, which is the timebase of the stream.

Don't forget that the timestamps (SCR, PTS, DTS) are a finite size in bits, so they can wrap back to zero in normal operation.
Thank you for the tip. I check the spec again.

"SCR indicates the intended time of arrival of the byte containing the last bit of the system_clock_reference_base at the input of the program target decoder". So it's not the reference time we are looking for.

The wrap back point is about 26 hours and could not be possible in this case.

God, why VOB is implemented like this?
extra is offline   Reply With Quote
Old 30th June 2009, 17:01   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
SCR is indeed the timebase of the stream for program streams (VOB is a program stream). The equivalent for transport streams is PCR. You can use the Log Timestamps function of DGIndex to see that the SCR resets along with the PTS.

A decoder should align a local clock with the stream's SCR. Then, an access unit is displayed when it's PTS (possibly interpolated) matches the local clock.

My point about the wrap-around is that it *can* occur. Also, in broadcast environments, the timebase and associated timestamps can all shift when a new stream is sent (e.g., new program, cut to commercial, etc.) This is called a discontinuity and decoders must not be designed to assume that there are no discontinuities.

Using the starting and ending PTS to determine a stream duration is a heuristic that is foiled by any discontinuities.
Guest is offline   Reply With Quote
Old 30th June 2009, 17:18   #9  |  Link
extra
Registered User
 
Join Date: Apr 2009
Posts: 10
Quote:
Originally Posted by neuron2 View Post
SCR is indeed the timebase of the stream for program streams (VOB is a program stream). The equivalent for transport streams is PCR. You can use the Log Timestamps function of DGIndex to see that the SCR resets along with the PTS.

A decoder should align a local clock with the stream's SCR. Then, an access unit is displayed when it's PTS (possibly interpolated) matches the local clock.

My point about the wrap-around is that it *can* occur. Also, in broadcast environments, the timebase and associated timestamps can all shift when a new stream is sent (e.g., new program, cut to commercial, etc.) This is called a discontinuity and decoders must not be designed to assume that there are no discontinuities.

Using the starting and ending PTS to determine a stream duration is a heuristic that is foiled by any discontinuities.
Thank you so much neuron2. I think I understand how it works now.

So in the case of discontinuities, the calculation of present and decoding time of frames, as well as that of the total duration, should take into account the differences of the SCR.

But in a software implementation, how to calibrate the decoder time clock? using the mux rate and byte counts? I need to dig into the spec again...
extra is offline   Reply With Quote
Reply

Tags
timestamp, vob

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.