[FFmpeg-cvslog] avcodec/mpegvideo_enc: override bitrate tolerance when its value is too small

Michael Niedermayer git at videolan.org
Sat Apr 12 01:44:24 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 12 01:29:20 2014 +0200| [66e959682c49e0686667cd3cbde87d725bb3c7e3] | committer: Michael Niedermayer

avcodec/mpegvideo_enc: override bitrate tolerance when its value is too small

Fixes Ticket3257

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66e959682c49e0686667cd3cbde87d725bb3c7e3
---

 libavcodec/mpegvideo_enc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6f043bb..09b48ab 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -409,9 +409,9 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
     if (!s->fixed_qscale &&
         avctx->bit_rate * av_q2d(avctx->time_base) >
             avctx->bit_rate_tolerance) {
-        av_log(avctx, AV_LOG_ERROR,
-               "bitrate tolerance %d too small for bitrate %d\n", avctx->bit_rate_tolerance, avctx->bit_rate);
-        return -1;
+        av_log(avctx, AV_LOG_WARNING,
+               "bitrate tolerance %d too small for bitrate %d, overriding\n", avctx->bit_rate_tolerance, avctx->bit_rate);
+        avctx->bit_rate_tolerance = 5 * avctx->bit_rate * av_q2d(avctx->time_base);
     }
 
     if (s->avctx->rc_max_rate &&



More information about the ffmpeg-cvslog mailing list