From 205b8fd078e50aa3f7f401646dbb73de1bb35a10 Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Mon, 6 Mar 2017 08:53:28 +0100 Subject: avcodec: estimate output bitrate for uncompressed video codecs Allows to get a more realistic total bitrate (and estimated file size) in avi_write_header. Previously a static default value of 200k was assumed. Adds an internal helper function for bitrate guessing. Signed-off-by: Tobias Rapp Reviewed-by: Michael Niedermayer --- libavcodec/rawenc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/rawenc.c') diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index a2d5ccc0a6..d181b74570 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -44,6 +44,8 @@ FF_ENABLE_DEPRECATION_WARNINGS avctx->bits_per_coded_sample = av_get_bits_per_pixel(desc); if(!avctx->codec_tag) avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); + avctx->bit_rate = ff_guess_coded_bitrate(avctx); + return 0; } -- cgit v1.2.3