[FFmpeg-devel] [PATCH] Add rc_max_rate to ffprobe stream output

Stefano Sabatini stefasab at gmail.com
Mon Jun 9 12:29:59 CEST 2014


On date Sunday 2014-06-08 16:18:32 +0200, Michael Niedermayer encoded:
> On Sun, Jun 08, 2014 at 03:42:59PM +0200, Stefano Sabatini wrote:
> > On date Sunday 2014-06-08 14:10:12 +0200, Michael Niedermayer encoded:
> > > On Sun, Jun 08, 2014 at 12:57:28PM +0200, Stefano Sabatini wrote:
> > > > On date Wednesday 2014-06-04 18:49:18 +0000, Carl Eugen Hoyos encoded:
> > > > > Stefano Sabatini <stefasab <at> gmail.com> writes:
> > > > > 
> > > > > > > +    if (dec_ctx->rc_max_rate > 0) print_val 
> > > > > > ("max_bit_rate", dec_ctx->rc_max_rate, unit_bit_per_second_str);
> > > > > > > +    else                       print_str_opt("max_bit_rate", "N/A");
> > > > > > 
> > > > > > AVCodecContext.rc_max_rate is an encoding parameter
> > > > > 
> > > > > The documentation is now fixed.
> > > > 
> > > > ffmpeg-codecs(1)
> > > > 
> > > >        maxrate integer (encoding,audio,video)
> > > >            Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
> > > > 
> > > 
> > > > So the question still stands: what's the use case for this?
> > > 
> > > the max rate is part of the paremeters needed for creating correct
> > > valid VBR/CBR mpeg*/h26*. Which can be especially important if you
> > > care about spec compliance or supporting hw players. or intent to
> > > transmit the data over a channel with low latency that doesnt have
> > > infinite bandwidth and want to have a proof it will work and not just
> > > hope it will ...
> > > 
> > > ok above is talk about encoding but
> > > 
> > > concrete use cases, you have some stream, be that clasical broadcast,
> > > internet streaming stuff, or some kind of storage media.
> > > and you want to create a similar compatible stream, you need to know
> > > the buffer sizes and max rate for that.
> > > ffprobe displaying what existing streams use should be helpfull in
> > > choosing valid parameters if you have no access to the proper specs
> > > and its not one of the common formats like DVD/VCD  ...
> > 
> > So what about updating the option bits (libavcodec/options_table.h,
> 
> What exactly do you want me to change ?

In conclusion rc_max_rate is read-only when decoding (thus should not
be considered a decoding option), but is set for a few decoders
(e.g. MPEG video based).

That said, I'm fine with applying the patch if there are no objections
(feel free to apply the patch or I'll do it myself in a few hours).

Patch updated with test reference changes. 
-- 
FFmpeg = Free Forgiving Monstrous Pitiless Ecletic Ghost
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ffprobe-add-rc_max_rate-to-stream-output.patch
Type: text/x-diff
Size: 12892 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140609/e64acd22/attachment.bin>


More information about the ffmpeg-devel mailing list