[FFmpeg-devel] [PATCH] avcodec: try to document timebase and framerate a bit more

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 5 19:55:47 CET 2016


On Sat, Mar 05, 2016 at 06:56:30PM +0100, Michael Niedermayer wrote:
> On Sat, Mar 05, 2016 at 06:01:11PM +0100, Reimar Döffinger wrote:
> > On Sat, Mar 05, 2016 at 01:41:32PM +0100, Michael Niedermayer wrote:
> > > +     * Note, for variable framerate material this has undefined meaning currently
> > > +     * and is not set to the actual framerate nor {0,1} but can be set to
> > > +     * 1/timebase (FIXME) the code in some parts assumes framerate == 1/timebase
> > > +     * which is generally not true but these parts need to be fixed before framerate
> > > +     * can be fixed.
> > 
> > This is too complex, maybe it can be split in multiple sentences.
> > Suggestion (but I took a lot of liberty and it might not say what you
> > meant!):
> > 
> > Note: meaning is not yet defined for variable frame rate content.
> > Ideally it should be set to either the current frame rate or {0,1}
> > for that case.
> > However for this some code assuming framerate == 1/timebase needs to
> > be fixed first - until then this field may incorrectly be set
> > to 1/timebase.
> 
> there are 2 cases
> 1. encoding where the users sets it
> 2. deoding where lavc sets it
> 
> my comment was about decoding "issues"/"bugs"

I understood that, but I admit my description did not capture that,
so maybe clearer with adding "when decoding" and "libavcodec sets"

> > Note: when decoding meaning is not yet defined for variable frame
> > rate content.
> > Ideally libavcodec should set it to either the current frame rate or {0,1}
> > for that case.
> > However for this some code assuming framerate == 1/timebase needs to
> > be fixed first - until then libavcodec may incorrectly set this field
> > to 1/timebase.

But as said it's just a suggestion. Even your original one is better
than nothing. I just thought it quite tough to read.


More information about the ffmpeg-devel mailing list