_MAX_FFMPEG_VARIABLE_BITRATE = 32767
_KNOWN_MOTION_OPTIONS = set([
- 'auto_brightness', 'brightness', 'contrast', 'emulate_motion', 'event_gap', 'ffmpeg_bps', 'ffmpeg_output_movies', 'ffmpeg_variable_bitrate', 'ffmpeg_video_codec',
- 'framerate', 'height', 'hue', 'lightswitch', 'despeckle_filter', 'locate_motion_mode', 'locate_motion_style', 'minimum_motion_frames', 'movie_filename', 'max_movie_time', 'max_mpeg_time',
- 'noise_level', 'noise_tune', 'on_event_end', 'on_event_start', 'on_movie_end', 'on_picture_save', 'output_pictures', 'picture_filename', 'post_capture', 'pre_capture',
- 'quality', 'rotate', 'saturation', 'snapshot_filename', 'snapshot_interval', 'stream_auth_method', 'stream_authentication', 'stream_localhost', 'stream_maxrate',
- 'stream_motion', 'stream_port', 'stream_quality', 'target_dir', 'text_changes', 'text_double', 'text_left', 'text_right', 'threshold', 'videodevice', 'width',
- 'webcam_localhost', 'webcam_port', 'webcam_maxrate', 'webcam_quality', 'webcam_motion', 'ffmpeg_cap_new', 'output_normal', 'output_motion', 'jpeg_filename', 'output_all',
- 'gap', 'locate', 'netcam_url', 'netcam_userpass', 'netcam_http', 'netcam_tolerant_check', 'netcam_keepalive', 'rtsp_uses_tcp',
- 'mask_file', 'smart_mask_speed'
+ 'auto_brightness',
+ 'brightness',
+ 'contrast',
+ 'despeckle_filter',
+ 'emulate_motion',
+ 'event_gap',
+ 'ffmpeg_bps',
+ 'ffmpeg_output_debug_movies',
+ 'ffmpeg_output_movies',
+ 'ffmpeg_variable_bitrate',
+ 'ffmpeg_video_codec',
+ 'framerate',
+ 'height',
+ 'hue',
+ 'lightswitch',
+ 'locate_motion_mode',
+ 'locate_motion_style',
+ 'mask_file',
+ 'max_movie_time',
+ 'minimum_motion_frames',
+ 'movie_filename',
+ 'netcam_keepalive',
+ 'netcam_tolerant_check',
+ 'netcam_url',
+ 'netcam_userpass',
+ 'noise_level',
+ 'noise_tune',
+ 'on_event_end',
+ 'on_event_start',
+ 'on_movie_end',
+ 'on_picture_save',
+ 'output_debug_pictures',
+ 'output_motion',
+ 'output_pictures',
+ 'picture_filename',
+ 'post_capture',
+ 'pre_capture',
+ 'quality',
+ 'rotate',
+ 'rtsp_uses_tcp',
+ 'saturation',
+ 'smart_mask_speed',
+ 'snapshot_filename',
+ 'snapshot_interval',
+ 'stream_authentication',
+ 'stream_auth_method',
+ 'stream_localhost',
+ 'stream_maxrate',
+ 'stream_motion',
+ 'stream_port',
+ 'stream_quality',
+ 'target_dir',
+ 'text_changes',
+ 'text_double',
+ 'text_left',
+ 'text_right',
+ 'threshold',
+ 'videodevice',
+ 'width',
])
camera_config['emulate_motion'] = camera_config.pop('output_all')
if 'ffmpeg_cap_new' in camera_config:
camera_config['ffmpeg_output_movies'] = camera_config.pop('ffmpeg_cap_new')
+ if 'ffmpeg_cap_motion' in camera_config:
+ camera_config['ffmpeg_output_debug_movies'] = camera_config.pop('ffmpeg_cap_motion')
if 'locate' in camera_config:
camera_config['locate_motion_mode'] = camera_config.pop('locate')
if 'jpeg_filename' in camera_config:
camera_config['output_all'] = camera_config.pop('emulate_motion')
if 'ffmpeg_output_movies' in camera_config:
camera_config['ffmpeg_cap_new'] = camera_config.pop('ffmpeg_output_movies')
+ if 'ffmpeg_output_debug_movies' in camera_config:
+ camera_config['ffmpeg_cap_motion'] = camera_config.pop('ffmpeg_output_debug_movies')
if 'locate_motion_mode' in camera_config:
camera_config['locate'] = camera_config.pop('locate_motion_mode')
if 'picture_filename' in camera_config:
'minimum_motion_frames': int(ui['minimum_motion_frames']),
'smart_mask_speed': 0,
'mask_file': '',
+ 'output_debug_pictures': ui['create_debug_media'],
+ 'ffmpeg_output_debug_movies': ui['create_debug_media'],
# working schedule
'@working_schedule': '',
'mask_type': 'smart',
'smart_mask_sluggishness': 5,
'mask_lines': [],
+ 'create_debug_media': data['ffmpeg_output_debug_movies'] or data['output_debug_pictures'],
# motion notifications
'email_notifications_enabled': False,
data.setdefault('minimum_motion_frames', 20)
data.setdefault('smart_mask_speed', 0)
data.setdefault('mask_file', '')
+ data.setdefault('ffmpeg_output_debug_movies', False)
+ data.setdefault('output_debug_pictures', False)
data.setdefault('pre_capture', 1)
data.setdefault('post_capture', 1)
/* motion detection */
'motion_detection': $('#motionDetectionEnabledSwitch')[0].checked,
- 'show_frame_changes': $('#showFrameChangesSwitch')[0].checked,
'frame_change_threshold': $('#frameChangeThresholdSlider').val(),
'auto_noise_detect': $('#autoNoiseDetectSwitch')[0].checked,
'noise_level': $('#noiseLevelSlider').val(),
'mask_type': $('#maskTypeSelect').val(),
'smart_mask_sluggishness': $('#smartMaskSluggishnessSlider').val(),
'mask_lines': $('#maskLinesEntry').val() ? $('#maskLinesEntry').val().split(',').map(function (l) {return parseInt(l);}) : [],
+ 'show_frame_changes': $('#showFrameChangesSwitch')[0].checked,
+ 'create_debug_media': $('#createDebugMediaSwitch')[0].checked,
/* motion notifications */
'email_notifications_enabled': $('#emailNotificationsEnabledSwitch')[0].checked,
/* motion detection */
$('#motionDetectionEnabledSwitch')[0].checked = dict['motion_detection']; markHideIfNull('motion_detection', 'motionDetectionEnabledSwitch');
- $('#showFrameChangesSwitch')[0].checked = dict['show_frame_changes']; markHideIfNull('show_frame_changes', 'showFrameChangesSwitch');
$('#frameChangeThresholdSlider').val(dict['frame_change_threshold']); markHideIfNull('frame_change_threshold', 'frameChangeThresholdSlider');
$('#autoNoiseDetectSwitch')[0].checked = dict['auto_noise_detect']; markHideIfNull('auto_noise_detect', 'autoNoiseDetectSwitch');
$('#noiseLevelSlider').val(dict['noise_level']); markHideIfNull('noise_level', 'noiseLevelSlider');
$('#maskTypeSelect').val(dict['mask_type']); markHideIfNull('mask_type', 'maskTypeSelect');
$('#smartMaskSluggishnessSlider').val(dict['smart_mask_sluggishness']); markHideIfNull('smart_mask_sluggishness', 'smartMaskSluggishnessSlider');
$('#maskLinesEntry').val((dict['mask_lines'] || []).join(',')); markHideIfNull('mask_lines', 'maskLinesEntry');
+ $('#showFrameChangesSwitch')[0].checked = dict['show_frame_changes']; markHideIfNull('show_frame_changes', 'showFrameChangesSwitch');
+ $('#createDebugMediaSwitch')[0].checked = dict['create_debug_media']; markHideIfNull('create_debug_media', 'createDebugMediaSwitch');
/* motion notifications */
$('#emailNotificationsEnabledSwitch')[0].checked = dict['email_notifications_enabled']; markHideIfNull('email_notifications_enabled', 'emailNotificationsEnabledSwitch');
<span class="minimize"></span>
</div>
<table class="settings advanced-setting">
- <tr class="settings-item advanced-setting">
- <td class="settings-item-label"><span class="settings-item-label">Show Frame Changes</span></td>
- <td class="settings-item-value"><input type="checkbox" class="styled motion-detection camera-config" id="showFrameChangesSwitch"></td>
- <td><span class="help-mark" title="if this is enabled, frame changes (number of pixels as well as the changed area) are shown on the video; temporarily enable this option to help adjust the motion detection parameters">?</span></td>
- </tr>
<tr class="settings-item advanced-setting" min="0" max="20" snap="0" ticksnum="5" decimals="1" unit="%">
<td class="settings-item-label"><span class="settings-item-label">Frame Change Threshold</span></td>
<td class="settings-item-value"><input type="text" class="range styled motion-detection camera-config" id="frameChangeThresholdSlider"></td>
<td class="settings-item-value"><div class="button normal-button clear-mask-button" id="clearMaskButton">Clear Mask</div></td>
<td><span class="help-mark" title="click this button to clear the current mask">?</span></td>
</tr>
+ <tr class="settings-item advanced-setting">
+ <td colspan="100"><div class="settings-item-separator"></div></td>
+ </tr>
+ <tr class="settings-item advanced-setting">
+ <td class="settings-item-label"><span class="settings-item-label">Show Frame Changes</span></td>
+ <td class="settings-item-value"><input type="checkbox" class="styled motion-detection camera-config" id="showFrameChangesSwitch"></td>
+ <td><span class="help-mark" title="if this is enabled, frame changes (number of pixels as well as the changed area) are shown on the video; temporarily enable this option to help adjust the motion detection parameters">?</span></td>
+ </tr>
+ <tr class="settings-item advanced-setting">
+ <td class="settings-item-label"><span class="settings-item-label">Create Debug Media Files</span></td>
+ <td class="settings-item-value"><input type="checkbox" class="styled motion-detection camera-config" id="createDebugMediaSwitch"></td>
+ <td><span class="help-mark" title="when enabled, creates special movies and pictures that help debugging motion detection problems">?</span></td>
+ </tr>
{% for config in camera_sections.get('motion-detection', {}).get('configs', []) %}
{{config_item(config)}}
{% endfor %}