From 5c69f8779aad293b5842c534ac48523119f03305 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 5 Jul 2015 17:58:07 +0300 Subject: [PATCH] fixed movie quality setting change when changing the framerate or resolution --- src/config.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/config.py b/src/config.py index 2e9bd8d..bd0f5ba 100644 --- a/src/config.py +++ b/src/config.py @@ -781,16 +781,15 @@ def motion_camera_ui_to_dict(ui, old_config=None): data['quality'] = max(1, int(ui['image_quality'])) - if ui['motion_movies']: - if proto == 'v4l2': - max_val = data['width'] * data['height'] * data['framerate'] / 3 - - else: # always assume netcam image size of (640x480) - we have no means to test it - max_val = 640 * 480 * data['framerate'] / 3 - - max_val = min(max_val, 9999999) + if proto == 'v4l2': + max_val = data['width'] * data['height'] * data['framerate'] / 3 + + else: # always assume a netcam image size of 640x480, since we have no means to know it at this point + max_val = 640 * 480 * data['framerate'] / 3 - data['ffmpeg_bps'] = int(ui['movie_quality']) * max_val / 100 + max_val = min(max_val, 9999999) + + data['ffmpeg_bps'] = int(ui['movie_quality']) * max_val / 100 # working schedule if ui['working_schedule']: -- 2.39.5