[FFmpeg-cvslog] libx265: print supported presets and tunes on error

James Almer git at videolan.org
Sat Apr 11 18:12:42 CEST 2015


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Apr 10 16:47:03 2015 -0300| [bbdb50d7a8a91f38188fd15080d7f45f1540b3ac] | committer: Derek Buitenhuis

libx265: print supported presets and tunes on error

Based on code from libavcodec/libx264.c

Signed-off-by: James Almer <jamrial at gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bbdb50d7a8a91f38188fd15080d7f45f1540b3ac
---

 libavcodec/libx265.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a7089b1..c04299a 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -100,7 +100,20 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
     }
 
     if (x265_param_default_preset(ctx->params, ctx->preset, ctx->tune) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid preset or tune.\n");
+        int i;
+
+        av_log(avctx, AV_LOG_ERROR, "Error setting preset/tune %s/%s.\n", ctx->preset, ctx->tune);
+        av_log(avctx, AV_LOG_INFO, "Possible presets:");
+        for (i = 0; x265_preset_names[i]; i++)
+            av_log(avctx, AV_LOG_INFO, " %s", x265_preset_names[i]);
+
+        av_log(avctx, AV_LOG_INFO, "\n");
+        av_log(avctx, AV_LOG_INFO, "Possible tunes:");
+        for (i = 0; x265_tune_names[i]; i++)
+            av_log(avctx, AV_LOG_INFO, " %s", x265_tune_names[i]);
+
+        av_log(avctx, AV_LOG_INFO, "\n");
+
         return AVERROR(EINVAL);
     }
 



More information about the ffmpeg-cvslog mailing list