[FFmpeg-devel] [PATCH] libvpx: ignore bitrate setting when -crf option is set.

Clément Bœsch ubitux at gmail.com
Sun Dec 16 02:03:59 CET 2012


avctx->bit_rate is set by default, so unless you use -b:v 0, the CRF
settings have no effect, and thus generally results in a pretty crappy
quality output.
---
 libavcodec/libvpxenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 0de11b5..cdf9096 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -271,7 +271,7 @@ static av_cold int vp8_init(AVCodecContext *avctx)
     else if (ctx->crf)
         enccfg.rc_end_usage = VPX_CQ;
 
-    if (avctx->bit_rate) {
+    if (avctx->bit_rate && enccfg.rc_end_usage != VPX_CQ) {
         enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
                                                 AV_ROUND_NEAR_INF);
     } else {
-- 
1.8.0.2



More information about the ffmpeg-devel mailing list