[FFmpeg-cvslog] avcodec/mpeg12enc: support mpeg2 encoder const level
Limin Wang
git at videolan.org
Fri Aug 14 17:55:33 EEST 2020
ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Sun Aug 2 21:07:04 2020 +0800| [ad49dd7694a504d8f205b1a6a9e5347354be12d0] | committer: Limin Wang
avcodec/mpeg12enc: support mpeg2 encoder const level
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad49dd7694a504d8f205b1a6a9e5347354be12d0
---
doc/encoders.texi | 10 ++++++++++
libavcodec/mpeg12enc.c | 6 ++++++
2 files changed, 16 insertions(+)
diff --git a/doc/encoders.texi b/doc/encoders.texi
index de0472e225..13aa5dee41 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2902,6 +2902,16 @@ SNR Scalable
@item simple
@end table
+ at item level
+Select the mpeg2 level to encode:
+
+ at table @samp
+ at item high
+ at item high1440
+ at item main
+ at item low
+ at end table
+
@item seq_disp_ext @var{integer}
Specifies if the encoder should write a sequence_display_extension to the
output.
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 9fbbcef607..f246427eeb 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -1167,6 +1167,12 @@ static const AVOption mpeg2_options[] = {
{ "secam", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_FORMAT_SECAM }, 0, 0, VE, "video_format" },
{ "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" },
+#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "avctx.level"
+ { LEVEL("high", 4) },
+ { LEVEL("high1440", 6) },
+ { LEVEL("main", 8) },
+ { LEVEL("low", 10) },
+#undef LEVEL
FF_MPV_COMMON_OPTS
FF_MPEG2_PROFILE_OPTS
{ NULL },
More information about the ffmpeg-cvslog
mailing list