[FFmpeg-devel] Updating initial dts when streamswitching and dts/pts wrap occurs

Erik Van Grunderbeeck erik
Wed Jul 1 03:36:05 CEST 2009


I need some hints on how I would go on updating the ffmpeg code for the dvd
decoding I am working on. I got playing for ffplay working fine, but before
I submit anything I also want to get ffmpeg going, to see if the data I pass
back is enough for all Libav users.

I figured out the changes needed for the introduction in new streams and
stream switching, but am stuck on the best way to get dts/pts
synchronization working both when a new chapter/vob transition happens, and
pts wrapping occurs because of 2^31 stamps.

Problem is getting the syncing between input and output streams going. When
a stream switch occurs (or a new stream is introduced), pts of the new
stream will start from 0 (or be at least less then "old" pts). The sync
difference between output generated dts will be off (or even wrap around)
and audio/video desync occurs (depending on the sync mechanism either frames
dropped or inserted).

I tested several scenario's, but found none that works well.  I looked at
av_update_cur_dts(): can't use since new substreams might be introduced late
(like subtitles), and tested some stuff that would be rejected anyway by
messing with AVStream::cur_dts .

Anyone have any idea's or can give me a direction?


*(Might be a better topic for av-user, not sure).


More information about the ffmpeg-devel mailing list