[FFmpeg-devel] [PATCH 09/10] lavc/libopenh264enc: allow specifying the profile through AVCodecContext
Linjie Fu
linjie.fu at intel.com
Fri Apr 3 18:15:09 EEST 2020
Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
libavcodec/libopenh264enc.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index d331cfd..70ded55 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -111,6 +111,22 @@ static av_cold int svc_encode_init_profile(AVCodecContext *avctx, SEncParamExt *
{
SVCContext *s = avctx->priv_data;
+ /* Allow specifying the libopenh264 profile through AVCodecContext. */
+ if (FF_PROFILE_UNKNOWN == s->profile &&
+ FF_PROFILE_UNKNOWN != avctx->profile)
+ switch (avctx->profile) {
+ case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+ s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+ break;
+ case FF_PROFILE_H264_HIGH:
+ s->profile = FF_PROFILE_H264_HIGH;
+ break;
+ default:
+ av_log(avctx, AV_LOG_WARNING,
+ "Unsupported avctx->profile: %d.\n", avctx->profile);
+ break;
+ }
+
if (s->profile == FF_PROFILE_UNKNOWN)
s->profile = s->cabac ? FF_PROFILE_H264_HIGH :
FF_PROFILE_H264_CONSTRAINED_BASELINE;
--
2.7.4
More information about the ffmpeg-devel
mailing list