[FFmpeg-devel] [PATCH] libx264: list possible presets and tunes.

Nicolas George nicolas.george at normalesup.org
Sat Jul 14 00:38:15 CEST 2012


The values are listed if setting them fails.
Using "-preset help" or "-preset list" have that effect.
Note: due to the way x264 exposes the list,
it may not be in sync with a shared libx264.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavcodec/libx264.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 2ffdc7d..dd74081 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -287,7 +287,16 @@ static av_cold int X264_init(AVCodecContext *avctx)
     x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset;
     if (x4->preset || x4->tune)
         if (x264_param_default_preset(&x4->params, x4->preset, x4->tune) < 0) {
+            int i;
             av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune %s/%s.\n", x4->preset, x4->tune);
+            av_log(avctx, AV_LOG_INFO, "Possible presets:");
+            for (i = 0; x264_preset_names[i]; i++)
+                av_log(avctx, AV_LOG_INFO, " %s", x264_preset_names[i]);
+            av_log(avctx, AV_LOG_INFO, "\n");
+            av_log(avctx, AV_LOG_INFO, "Possible tunes:");
+            for (i = 0; x264_tune_names[i]; i++)
+                av_log(avctx, AV_LOG_INFO, " %s", x264_tune_names[i]);
+            av_log(avctx, AV_LOG_INFO, "\n");
             return AVERROR(EINVAL);
         }
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list