mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 15:04:01 +08:00
minor fix in calculate bitrate
This commit is contained in:
parent
247e2d085f
commit
742668434c
@ -985,9 +985,9 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
|
||||
|
||||
/* put sample parameters */
|
||||
unsigned long long lbit_rate = static_cast<unsigned long long>(bitrate);
|
||||
lbit_rate += (bitrate / 4);
|
||||
lbit_rate += (bitrate / 2);
|
||||
lbit_rate = std::min(lbit_rate, static_cast<unsigned long long>(std::numeric_limits<int>::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<unsigned long long>(c->bit_rate);
|
||||
lbit_rate += (bitrate / 4);
|
||||
lbit_rate += (bitrate / 2);
|
||||
lbit_rate = std::min(lbit_rate, static_cast<unsigned long long>(std::numeric_limits<int>::max()));
|
||||
c->bit_rate_tolerance = static_cast<int>(lbit_rate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user