Skip to content
Snippets Groups Projects
Commit 61090db2 authored by James Almer's avatar James Almer
Browse files

avcodec/libx265: print supported presets and tunes on error


Based on code from libavcodec/libx264.c

Reviewed-by: default avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
parent bc48c889
No related branches found
No related tags found
No related merge requests found
...@@ -100,7 +100,20 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) ...@@ -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) { 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); return AVERROR(EINVAL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment