[FFmpeg-devel] [PATCH] set bitrate from rc_max_rate for duration estimation will fix ticket #3678

Marc-Antoine ARNAUD arnaud.marcantoine at gmail.com
Thu Aug 21 15:01:18 CEST 2014

I have analysed a little more of code, and in fact the duration was not
present in the MXF.
It's for this reason who we pass in the estimation based on the bitrate.
You can see here the selection of the method:

About the max bitrate, I agreed how it can't work every time but in major
cases it can be ok because we target the max_bitrate value during the

can I send a patch with these modifactions:

if (st->codec->bit_rate > 0) {
    if (INT_MAX - st->codec->bit_rate < bit_rate) {
            bit_rate = 0;
    bit_rate += st->codec->bit_rate;
*else *if (st->codec->rc_max_rate > 0) {
   if (INT_MAX - st->codec->rc_max_rate < bit_rate) {
         bit_rate = 0;
   bit_rate += st->codec->rc_max_rate;
   *show_warning = 1;*

It can increase the bitrate, but also display the warning message.
This solution can display the minimum duration of the stream.

 | e: arnaud.marcantoine at gmail.com
| tel: 06-84-71-84-45
| ohloh: http://bit.ly/1iwtlsU
  [image: LinkedIn]
Google Plus]

More information about the ffmpeg-devel mailing list