mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-06 20:47:41 +00:00
libx264: feed x264_param_apply_profile from AVCodecContext.profile in absence of other information
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
fd9cd8cd5a
commit
63951aec2b
@ -457,6 +457,30 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
|||||||
if (x4->fastfirstpass)
|
if (x4->fastfirstpass)
|
||||||
x264_param_apply_fastfirstpass(&x4->params);
|
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 = av_strdup("baseline");
|
||||||
|
break;
|
||||||
|
case FF_PROFILE_H264_HIGH:
|
||||||
|
x4->profile = av_strdup("high");
|
||||||
|
break;
|
||||||
|
case FF_PROFILE_H264_HIGH_10:
|
||||||
|
x4->profile = av_strdup("high10");
|
||||||
|
break;
|
||||||
|
case FF_PROFILE_H264_HIGH_422:
|
||||||
|
x4->profile = av_strdup("high422");
|
||||||
|
break;
|
||||||
|
case FF_PROFILE_H264_HIGH_444:
|
||||||
|
x4->profile = av_strdup("high444");
|
||||||
|
break;
|
||||||
|
case FF_PROFILE_H264_MAIN:
|
||||||
|
x4->profile = av_strdup("main");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (x4->profile)
|
if (x4->profile)
|
||||||
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
|
if (x264_param_apply_profile(&x4->params, x4->profile) < 0) {
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
Reference in New Issue
Block a user