From 742668434cbbf4a8913a2fae8291c701af934b4c Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Fri, 20 Apr 2012 11:58:31 +0000 Subject: [PATCH] minor fix in calculate bitrate --- modules/highgui/src/cap_ffmpeg_impl_v2.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp index 1186187158..a5f643d427 100755 --- a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp +++ b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp @@ -985,9 +985,9 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc, /* put sample parameters */ unsigned long long lbit_rate = static_cast(bitrate); - lbit_rate += (bitrate / 4); + lbit_rate += (bitrate / 2); lbit_rate = std::min(lbit_rate, static_cast(std::numeric_limits::max())); - c->bit_rate = bitrate; + c->bit_rate = lbit_rate; // took advice from // http://ffmpeg-users.933282.n4.nabble.com/warning-clipping-1-dct-coefficients-to-127-127-td934297.html @@ -1466,7 +1466,7 @@ void CvVideoWriter_FFMPEG::close() } unsigned long long lbit_rate = static_cast(c->bit_rate); - lbit_rate += (bitrate / 4); + lbit_rate += (bitrate / 2); lbit_rate = std::min(lbit_rate, static_cast(std::numeric_limits::max())); c->bit_rate_tolerance = static_cast(lbit_rate);