[vlc-devel] [PATCH] Discontinuities in source scr/pts/ dts break transcoding for dvdread -> mp4

Christopher Key cjk32 at cam.ac.uk
Sat Oct 17 20:21:42 CEST 2009

Rémi Denis-Courmont wrote:
> Le samedi 17 octobre 2009 20:55:44 Christopher Key, vous avez écrit :
>> Rémi Denis-Courmont wrote:
>>> Christopher Key wrote:
>>>> Hello,
>>>> I recently ran into problems trying to transcode dvds to mp4 format.
>>>> Following any discontinuity in the scr (e.g. layer break, or skip over
>>>> unreadable sectors), I would lose the audio in the output.  What was
>>>> happening was that the discontinuity was causing the dts timestamps on
>>>> packets to jump backwards*.  As the muxer uses two fifos (audio and
>>>> video) and pulls in whichever of the packets has the lowest dts, a jump
>>>> back in time causes problems.  Imagine two FIFOs, with packets with the
>>>> following dts timeamps:
>>>> {...,6,4,2,98,96} and {...,5,3,1,99,97}
>>> Shouldn't this be fixed with a roll-over carry counter rather than by
>>> trying to autodetect discontinuities?
>> Sorry, I'm not quite sure what you mean by this.  Could you clarify.
> Shouldn't the module keep a 64-bits PTS/DTS and increment the high-order bits 
> whenever it the value wraps around?
Thanks, I'm with you.

Doing so introduces discontinuities into the PTS in the resulting mp4
file (albeit jumps forward rather than backward).  Would this not break
seeking within the file?


More information about the vlc-devel mailing list