[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:
https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/utils.c#L2458

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
encoding.


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;
            break;
    }
    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;
         break;
   }
   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.

-- 
  *Marc-Antoine*
 | e: arnaud.marcantoine at gmail.com
| tel: 06-84-71-84-45
| ohloh: http://bit.ly/1iwtlsU
  [image: LinkedIn]
<http://s.wisestamp.com/links?url=https%3A%2F%2Fwww.linkedin.com%2Fpub%2Fmarc-antoine-arnaud%2Fb%2F7b8%2F2a3&sn=YXJuYXVkLm1hcmNhbnRvaW5lQGdtYWlsLmNvbQ%3D%3D>
[image:
Google Plus]


More information about the ffmpeg-devel mailing list