[Ffmpeg-devel] VFR support

Rich Felker dalias
Thu Oct 20 18:54:30 CEST 2005


On Thu, Oct 20, 2005 at 12:50:26PM +0200, Emiliano Parasassi wrote:
> > 1/10 is not a working timebase for variable framerate anywhere between
> > 1 and 10 fps; it only works for 1, 2, 5, and 10 fps. If the frame
> > durations are all integer multiples of 1/10, then you can use 1/2520
> > (lcm of 1,2,...,10 unless I made a mistake); otherwise just use some
> > small physical unit like microseconds.
> > In any case, you need to set the pts values correctly for each frame
> > you write. MPlayer and vlc incorrectly show the timebase as a
> > "framerate" but they should play the file correctly still.
> > 
> > Rich
> > 
> 
> 8 rows of wisdom ;)
> 
> Unfortunately there is yet something wrong :(
> I tried to encode always a test frame with different PTS:
> 
> AVCContext.timebase = 1/4
> AVStream.timebase =   1/90000 (for mov container)
> 
> CODED_PTS=1  (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=22500
> CODED_PTS=4  (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=90000
> CODED_PTS=9  (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=202500
> CODED_PTS=16 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=360000
> CODED_PTS=25 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=562500
> CODED_PTS=36 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=810000
> CODED_PTS=49 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=1102500
> CODED_PTS=64 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=1440000
> CODED_PTS=81 (1/4) AVSTREAM_TB=(1/90000) PKT_PTS=1822500
> CODED_PTS=100(1/4) AVSTREAM_TB=(1/90000) PKT_PTS=2250000
> 
> The output is played by Mplayer and VLC at 4fps :(((
> 
> I tried also with asf container and it follows PTS, pausing the right
> time :) , but i can't view anything in the player window :(
> 
> Do you have any other suggestions to give me?

Yes, don't use 1/4 as your timebase!!
Really you should use the same timebase for both the container and the
codec unless you have a really good reason not to..

Rich





More information about the ffmpeg-devel mailing list