From 5a21ac5ee4a4870f0e42555a23c13ba8c9e78c2f Mon Sep 17 00:00:00 2001 From: Andrey Morozov Date: Fri, 13 Apr 2012 10:25:29 +0000 Subject: [PATCH] increased bitrate of recorded video on 25% --- modules/highgui/src/cap_ffmpeg_impl_v2.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp index e9ca872d5d..85c024cb5c 100755 --- a/modules/highgui/src/cap_ffmpeg_impl_v2.hpp +++ b/modules/highgui/src/cap_ffmpeg_impl_v2.hpp @@ -986,7 +986,7 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc, unsigned long long lbit_rate = static_cast(bitrate); lbit_rate += (bitrate / 4); lbit_rate = std::min(lbit_rate, static_cast(std::numeric_limits::max())); - c->bit_rate = static_cast(lbit_rate); + c->bit_rate = bitrate; // took advice from // http://ffmpeg-users.933282.n4.nabble.com/warning-clipping-1-dct-coefficients-to-127-127-td934297.html @@ -1457,7 +1457,10 @@ void CvVideoWriter_FFMPEG::close() return false; } - c->bit_rate_tolerance = c->bit_rate; + unsigned long long lbit_rate = static_cast(c->bit_rate); + lbit_rate += (bitrate / 4); + lbit_rate = std::min(lbit_rate, static_cast(std::numeric_limits::max())); + c->bit_rate_tolerance = static_cast(lbit_rate); /* open the codec */ if ((err=