[FFmpeg-devel] [RFC]Do not set the lame quality if the user didn't set it

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Oct 25 14:11:56 CEST 2014


Hi!

Attached patch makes FFmpeg mp3 output more similar to lame's.
It appears to me that 5 is not the default if vbr is used.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 661d1c0..d8a444d 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -106,9 +106,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
     lame_set_out_samplerate(s->gfp, avctx->sample_rate);
 
     /* algorithmic quality */
-    if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
-        lame_set_quality(s->gfp, 5);
-    else
+    if (avctx->compression_level != FF_COMPRESSION_DEFAULT)
         lame_set_quality(s->gfp, avctx->compression_level);
 
     /* rate control */


More information about the ffmpeg-devel mailing list