[vlc-devel] Pre-roll

Steve Lhomme steve.lhomme at free.fr
Sun Feb 13 14:27:37 CET 2005


Hi,

As mentionned yesterday, I have a problem with Matroska chapters (and 
seeking in general). I have 2 chapters that are very close in the file 
(a few seconds). When I seek on the second chapter, VLC starts display 
data from the previous chapter because that's where the keyframe that 
should be used is located... That means this second chapter is useless. 
But since our menu system relies on chapters, I *need* this to work (the 
few seconds of video is actually a menu section).

In DirectShow this works fine, because it uses something which I think 
is called pre-roll (probably from movie tapes that have to start playing 
before you switch from one tape to another). It does the decoding 
(audio, video, etc) from that keyframe but only start rendering the 
content when the given pre-roll timecode is reached.

I managed to do this in the Matroska demuxer by setting a p_block->i_pts 
to -1 for the data (frames) that should be decoded but not used for 
rendering. But there are 2 problems :

- even though the keyframe and all consecutive frames are supposed to be 
decoded, the first frame displayed shows that this isn't the case (like 
when you start decoding using a P/B frame).

- The pre-roll time (the few seconds mentioned) is used during 
rendering. That means no audio or video for a few seconds. This time 
should be the shortest possible (in DirectShow it's less than a second).

Could anyone explain me how to achieve to do what I want ? Or where I 
should look at in VLC ?

I guess it involves the clock handling, the decoders and renderers. 
Something like "tell the renderer to use only data with timecodes >= 
given timecode" or "tell the decoder to decode data but not put it in 
the renderer queue if the display timecode is <= given timecode". There 
would still be the problem of the playback doing nothing while waiting 
for this timecode to happen.

Thanks for any help.

-- 
robUx4 on blog <http://robux4.blogspot.com/>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list