[FFmpeg-devel] [PATCH] Pass VBV delay to the calling application via ctx

Jason Garrett-Glaser jason
Tue Feb 8 15:43:16 CET 2011


On Tue, Feb 8, 2011 at 6:39 AM, Christophe Massiot <cmassiot at freebox.fr> wrote:
> On Tue, Feb 08, 2011, M?ns Rullg?rd wrote:
>
>> > + ? ?/**
>> > + ? ? * VBV delay coded in the last frame (in seconds).
>> > + ? ? * Used for compliant TS muxing.
>> > + ? ? * - encoding: Set by libavcodec.
>> > + ? ? * - decoding: unused.
>> > + ? ? */
>> > + ? ?double vbv_delay;
>>
>> I don't like floating-point. ?Could this be expressed in some other
>> units instead?
>
> Sure but I have difficulties choosing one. MPEG has two natural clock
> frequencies : 90 kHz and 27 MHz. VBV delay in MPEG-1/2 is actually based
> on the 90 kHz clock.
>
> However, probably other codecs have other clocks, maybe more precise
> than 90 kHz, so if we want to generalize this principle we need a more
> generic clock source. VLC would be perfectly happy with microseconds but
> you could equally choose nanoseconds or anything else that fits in an
> integer...
>
> x264 solved this dilemma by using "double". Not sure whether 27 MHz
> would be acceptable for other codecs. Opinions welcomed here...

Infinite precision (that is, "guaranteed not to have rounding error")
is probably not useful externally: as long as the internal clock is
kept in infinite precision, the exported information can be marginally
imprecise.  Double should work fine.

Jason



More information about the ffmpeg-devel mailing list