mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 11:46:30 +00:00
motion: fix bitrate overflow
This commit is contained in:
parent
065e6b8597
commit
9bd15919a7
13
package/motion/fix_bitrate_overflow.patch
Normal file
13
package/motion/fix_bitrate_overflow.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/ffmpeg.c b/ffmpeg.c
|
||||
index a8afa6e..3f731ca 100644
|
||||
--- a/ffmpeg.c
|
||||
+++ b/ffmpeg.c
|
||||
@@ -558,7 +558,7 @@ static int ffmpeg_set_quality(struct ffmpeg *ffmpeg){
|
||||
if ((strcmp(ffmpeg->codec->name, "h264_omx") == 0) || (strcmp(ffmpeg->codec->name, "mpeg4_omx") == 0)) {
|
||||
// H264 OMX encoder quality can only be controlled via bit_rate
|
||||
// bit_rate = ffmpeg->width * ffmpeg->height * ffmpeg->fps * quality_factor
|
||||
- ffmpeg->quality = (ffmpeg->width * ffmpeg->height * ffmpeg->fps * ffmpeg->quality) >> 7;
|
||||
+ ffmpeg->quality = (int)(((int64_t)ffmpeg->width * ffmpeg->height * ffmpeg->fps * ffmpeg->quality) >> 7);
|
||||
// Clip bit rate to min
|
||||
if (ffmpeg->quality < 4000) // magic number
|
||||
ffmpeg->quality = 4000;
|
Loading…
x
Reference in New Issue
Block a user