[FFmpeg-devel] [PATCH, RFC] lavc/options_table: Add basic candidate h264 profiles

Linjie Fu linjie.fu at intel.com
Wed May 6 08:37:53 EEST 2020


Allows specifying avctx->profile with string type profile for
h264 encoders.

Private field/option "profile" may be abled to be removed for basic
h264 profiles, directly for encoders like libopenh264/h264_vaapi,
or with an map to hardware profile like h264_qsv.

Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
One concern is some encoders have options for specific profiles,
like "high444p" for nvenc_h264 and "constrained_high" for h264_amf,
hence they may not be able to remove the private option easily.

Please help to comment.

 libavcodec/options_table.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 54366747ca..8d41f2755c 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -282,6 +282,10 @@ static const AVOption avcodec_options[] = {
 {"mpeg4_asp",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_MPEG4_ADVANCED_SIMPLE }, INT_MIN, INT_MAX, V|E, "profile"},
 {"main10",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "profile"},
 {"msbc",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_SBC_MSBC }, INT_MIN, INT_MAX, A|E, "profile"},
+{"h264_constrained_baseline", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, V|E, "profile"},
+{"h264_baseline",             NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_H264_BASELINE },             INT_MIN, INT_MAX, V|E, "profile"},
+{"h264_main",                 NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_H264_MAIN },                 INT_MIN, INT_MAX, V|E, "profile"},
+{"h264_high",                 NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_H264_HIGH },                 INT_MIN, INT_MAX, V|E, "profile"},
 {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
 {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "level"},
 {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D},
-- 
2.17.1



More information about the ffmpeg-devel mailing list