Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logging.debug('Detecting threshold, parameters:\n'
' threshold: %d, min-scene-len: %d, fade-bias: %d,\n'
' add-last-scene: %s, min-percent: %d, block-size: %d',
threshold, min_scene_len, fade_bias,
'yes' if add_last_scene else 'no', min_percent, block_size)
# Handle case where add_last_scene is not set and is None.
add_last_scene = True if add_last_scene else False
min_scene_len = parse_timecode(ctx.obj, min_scene_len)
# Convert min_percent and fade_bias from integer to floats (0.0-1.0 and -1.0-+1.0 respectively).
min_percent /= 100.0
fade_bias /= 100.0
ctx.obj.add_detector(scenedetect.detectors.ThresholdDetector(
threshold=threshold, min_scene_len=min_scene_len, fade_bias=fade_bias,
add_final_scene=add_last_scene, min_percent=min_percent, block_size=block_size))