diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index f2f8990..203f7af 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -447,6 +447,18 @@ static av_cold int X264_init(AVCodecContext *avctx) if (x4->fastfirstpass) x264_param_apply_fastfirstpass(&x4->params); + /* Allow specifying the x264 profile through AVCodecContext. */ + if (!x4->profile) + switch (avctx->profile) { + case FF_PROFILE_H264_BASELINE: + x4->profile = "baseline"; + break; + case FF_PROFILE_H264_MAIN: + x4->profile = "main"; + break; + default: + break; + } if (x4->profile) if (x264_param_apply_profile(&x4->params, x4->profile) < 0) { int i;