[Libav-user] Encoding with variable frame rate

Brad O'Hearne brado at bighillsoftware.com
Tue May 21 17:53:29 CEST 2013


On May 21, 2013, at 7:26 AM, Kalileo <kalileo at universalx.net> wrote:

> I disagree (again). If your player synchronizes audio and video using dts/pts, and as far as I know most do, you can indeed create the weirdest frame rate changes by manipulating dts/pts. 

I posted a working app with source code to this list a few months ago that demonstrated this was not the case. That was the reason for my continued inquisition about pts/dts. 

> Which "Playback" , which player ? Every player can have it's own playback logic, nevertheless I don't see where the player logic would require fps to be fixed (unless it ignores dts/pts).

I reproduced this behavior by with playback in Wondershare Video Converter Ultimate, VLC, and streaming through Wowza and playback in a browser Flash player. All consistent. 

> Again i disagree. Just set DTS/PTS accordingly, to compensate for the different fps rate. Been there, done that. Works.

It really isn't an issue of agreement, it is an issue of how FFmpeg works. Most of the posts I've seen about variable frame rate have stated that FFmpeg does not support variable frame rate. This was consistent with what I saw in my testing, and moreover, the solution to the problem in my case wasn't solved by setting pts/dts (though I tried for days to no avail), it was solved by sending a fixed frame rate. If what you are saying about pts/dts is true, then I believe by definition FFmpeg would support variable frame rate, because you could send any number of frames at any interval different from time_base.den and just simply correct the situation by setting pts/dts. (FWIW, if my capture source gave my app the exact pts and dts, and FFmpeg couldn't handle it because the frame rate was different than time_base.den). 

I think the easy way to settle this is just to put it out there -- can someone who knows definitively (not intuition, not guessing, i.e. a developer preferably) answer these two questions:

1. Does FFmpeg support variable frame rate, or not? 

2. If I set the time_base.den on the video codec (let's say to 30 fps), can I fire  say 12fps at the encoder and compensate for that by setting pts/dts such that the timing won't be incorrect? 

Thanks,

Brad


More information about the Libav-user mailing list