From 135d63fc9802976a504dde9eb0caa0ddf55b210c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 17 Jan 2020 14:42:33 +0100 Subject: check if exists --- cli/app/search/live.py | 2 +- cli/app/search/video.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'cli/app/search') diff --git a/cli/app/search/live.py b/cli/app/search/live.py index 6d9428c..8635b4c 100644 --- a/cli/app/search/live.py +++ b/cli/app/search/live.py @@ -441,7 +441,7 @@ class Listener: if out_img is not None: save_time = time.time() - out_img.save(os.path.join(path_out, "frame_{:05d}.png".format(i)), format='png', compression_level=2) + out_img.save(os.path.join(path_out, "frame_{:05d}.png".format(i)), format='png', compression_level=3) save_time_total += time.time() - save_time resize_time = time.time() diff --git a/cli/app/search/video.py b/cli/app/search/video.py index 14d84b4..c87edb5 100644 --- a/cli/app/search/video.py +++ b/cli/app/search/video.py @@ -20,6 +20,10 @@ def export_video(fp_frames, fps=30): shutil.rmtree(os.path.join(app_cfg.DIR_OUTPUTS, fp_frames)) def export_video_final(fp_frames, fp_out, fps=25): + if os.path.exists(fp_out): + print("Video already exists: {}".format(fp_out)) + return None + print("Exporting video...") cmd = [ '/home/lens/bin/ffmpeg', -- cgit v1.2.3-70-g09d2