summaryrefslogtreecommitdiff
path: root/libavcodec/v210enc.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-archive.com>2017-03-06 08:53:28 +0100
committerTobias Rapp <t.rapp@noa-archive.com>2017-03-17 11:55:16 +0100
commit205b8fd078e50aa3f7f401646dbb73de1bb35a10 (patch)
treeabbe5fa686d8d01a1c3bde998e712e5c26f6a561 /libavcodec/v210enc.c
parent8db301deadfcf113fb274881e65afcbe3e1bd645 (diff)
downloadffmpeg-205b8fd078e50aa3f7f401646dbb73de1bb35a10.tar.gz
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 <t.rapp@noa-archive.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/v210enc.c')
-rw-r--r--libavcodec/v210enc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index d3a8e26bc1..a6afbbfc41 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -110,6 +110,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
ff_v210enc_init(s);
+ avctx->bits_per_coded_sample = 20;
+ avctx->bit_rate = ff_guess_coded_bitrate(avctx) * 16 / 15;
+
return 0;
}