avcodec/ratecontrol: give some trivial tips in case of buffer underflows
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Sep 2013 21:10:41 +0000 (23:10 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Sep 2013 21:11:39 +0000 (23:11 +0200)
See Ticket2725

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ratecontrol.c

index bf3321d..7db248e 100644 (file)
@@ -328,6 +328,9 @@ int ff_vbv_update(MpegEncContext *s, int frame_size)
         rcc->buffer_index -= frame_size;
         if (rcc->buffer_index < 0) {
             av_log(s->avctx, AV_LOG_ERROR, "rc buffer underflow\n");
+            if (frame_size > max_rate && s->qscale == s->avctx->qmax) {
+                av_log(s->avctx, AV_LOG_ERROR, "max bitrate possibly too small or try trellis with large lmax or increase qmax\n");
+            }
             rcc->buffer_index = 0;
         }