diff options
author | Martin Storsjö <martin@martin.st> | 2015-10-28 11:06:36 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-10-28 23:02:48 +0200 |
commit | 9e14a992409348630ea96521411127418a92e8a3 (patch) | |
tree | 25db7c3958852fddde565a51993a33239ad9694a | |
parent | b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc (diff) | |
download | ffmpeg-9e14a992409348630ea96521411127418a92e8a3.tar.gz |
libopenh264enc: Add an option for controlling the frame skipping
This allows enabling the frame skipping, which is required for the
encoder to properly hit the target bitrate.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/libopenh264enc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index 1553b6d52c..0502bc1a0d 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -38,6 +38,7 @@ typedef struct SVCContext { int loopfilter; char *profile; int max_nal_size; + int skip_frames; } SVCContext; #define OPENH264_VER_AT_LEAST(maj, min) \ @@ -55,6 +56,7 @@ static const AVOption options[] = { { "loopfilter", "Enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE }, { "max_nal_size", "Set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, VE }, + { "allow_skip_frames", "Allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE }, { NULL } }; @@ -144,7 +146,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) param.bEnableDenoise = 0; param.bEnableBackgroundDetection = 1; param.bEnableAdaptiveQuant = 1; - param.bEnableFrameSkip = 0; + param.bEnableFrameSkip = s->skip_frames; param.bEnableLongTermReference = 0; param.iLtrMarkPeriod = 30; param.uiIntraPeriod = avctx->gop_size; |