[FFmpeg-devel] [PATCH] lavc/libx264: add a warning when using qscale

James Darnley james.darnley at gmail.com
Sat Mar 22 00:27:43 CET 2014


This addresses ticket #3238.
---
 libavcodec/libx264.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 6007630..dd0ff03 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -404,6 +404,14 @@ static av_cold int X264_init(AVCodecContext *avctx)
         }
     }
 
+    if (avctx->global_quality > 0 && x4->params.rc.i_rc_method == X264_RC_CRF)
+        av_log(avctx, AV_LOG_WARNING, "-qscale is ignored with libx264, "
+                "using -crf %0.0f instead.\n", x4->params.rc.f_rf_constant);
+
+    if (avctx->global_quality > 0 && x4->params.rc.i_rc_method == X264_RC_CQP)
+        av_log(avctx, AV_LOG_WARNING, "-qscale is ignored with libx264, "
+                "using -qp %d instead.\n", x4->params.rc.i_qp_constant);
+
     if (avctx->i_quant_factor > 0)
         x4->params.rc.f_ip_factor         = 1 / fabs(avctx->i_quant_factor);
 
-- 
1.7.9



More information about the ffmpeg-devel mailing list