diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-10-03 15:19:10 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-12-06 10:25:00 +0100 |
commit | 732a37d1466d45b3812509d68c82e783530e291a (patch) | |
tree | c9cf83f3f3ab27d445e3449f809e97a5340e5065 /libavcodec | |
parent | 03afb62e83516141ba999536fc97575faefb98af (diff) | |
download | ffmpeg-streaming-732a37d1466d45b3812509d68c82e783530e291a.zip ffmpeg-streaming-732a37d1466d45b3812509d68c82e783530e291a.tar.gz |
libx264: export CPB props side data
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libx264.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index bcbdf84..e2648f3 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -351,6 +351,7 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt) static av_cold int X264_init(AVCodecContext *avctx) { X264Context *x4 = avctx->priv_data; + AVCPBProperties *cpb_props; #if CONFIG_LIBX262_ENCODER if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) { @@ -610,6 +611,13 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->extradata_size = p - avctx->extradata; } + cpb_props = ff_add_cpb_side_data(avctx); + if (!cpb_props) + return AVERROR(ENOMEM); + cpb_props->buffer_size = x4->params.rc.i_vbv_buffer_size * 1000; + cpb_props->max_bitrate = x4->params.rc.i_vbv_max_bitrate * 1000; + cpb_props->avg_bitrate = x4->params.rc.i_bitrate * 1000; + return 0; } |