]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpeg12enc: support mpeg2 encoder const profile
authorLimin Wang <lance.lmwang@gmail.com>
Sat, 30 May 2020 13:25:32 +0000 (21:25 +0800)
committerLimin Wang <lance.lmwang@gmail.com>
Sun, 31 May 2020 23:05:32 +0000 (07:05 +0800)
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
doc/encoders.texi
libavcodec/mpeg12enc.c
libavcodec/profiles.h

index 954f0f6fe383726b420123dd81247d8b7feb7ae7..1331b794589d6e0ee3ab35cf53dbb3fd8efbc755 100644 (file)
@@ -2740,6 +2740,20 @@ MPEG-2 video encoder.
 @subsection Options
 
 @table @option
+@item profile @var{integer}
+Select the mpeg2 profile to encode:
+
+@table @samp
+@item 422
+@item main
+@item ss
+Spatially Scalable
+@item snr
+SNR Scalable
+@item high
+@item simple
+@end table
+
 @item seq_disp_ext @var{integer}
 Specifies if the encoder should write a sequence_display_extension to the
 output.
index cab7076a583691e3e9e17fa6b4a7138ab1d0d883..9fbbcef60783e819262056dc0c8a7f785a9e5e47 100644 (file)
@@ -41,6 +41,7 @@
 #include "mpeg12data.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
+#include "profiles.h"
 
 static const uint8_t svcd_scan_offset_placeholder[] = {
     0x10, 0x0E, 0x00, 0x80, 0x81, 0x00, 0x80,
@@ -1167,6 +1168,7 @@ static const AVOption mpeg2_options[] = {
     {     "mac",          NULL, 0, AV_OPT_TYPE_CONST,  {.i64 = VIDEO_FORMAT_MAC        },  0, 0, VE, "video_format" },
     {     "unspecified",  NULL, 0, AV_OPT_TYPE_CONST,  {.i64 = VIDEO_FORMAT_UNSPECIFIED},  0, 0, VE, "video_format" },
     FF_MPV_COMMON_OPTS
+    FF_MPEG2_PROFILE_OPTS
     { NULL },
 };
 
index e414ea77a7b35f8ad995d1d41844fec1a5759371..d2419257dc519b50d9b9242d802622d344729e1a 100644 (file)
     FF_AVCTX_PROFILE_OPTION("mpeg4_main",    NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\
     FF_AVCTX_PROFILE_OPTION("mpeg4_asp",     NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\
 
+#define FF_MPEG2_PROFILE_OPTS \
+    FF_AVCTX_PROFILE_OPTION("422",           NULL, VIDEO, FF_PROFILE_MPEG2_422)\
+    FF_AVCTX_PROFILE_OPTION("high",          NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\
+    FF_AVCTX_PROFILE_OPTION("ss",            NULL, VIDEO, FF_PROFILE_MPEG2_SS)\
+    FF_AVCTX_PROFILE_OPTION("snr",           NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\
+    FF_AVCTX_PROFILE_OPTION("main",          NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\
+    FF_AVCTX_PROFILE_OPTION("simple",        NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\
+
 extern const AVProfile ff_aac_profiles[];
 extern const AVProfile ff_dca_profiles[];
 extern const AVProfile ff_dnxhd_profiles[];