Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do_capture(ts_tuple, width, height, suffix, args):
fd, filename = tempfile.mkstemp(suffix=suffix)
media_capture.make_capture(ts_tuple[1], width, height, filename)
blurriness = 1
avg_color = 0
if not args.fast:
blurriness = media_capture.compute_blurriness(filename)
avg_color = media_capture.compute_avg_color(filename)
os.close(fd)
frm = Frame(
filename=filename,
blurriness=blurriness,
timestamp=ts_tuple[0],
avg_color=avg_color
)
return frm