summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-17 14:42:33 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-17 14:42:33 +0100
commit135d63fc9802976a504dde9eb0caa0ddf55b210c (patch)
treeb7a2d5961dea876ac714b4e3f9e4812453ef2751 /cli
parent2b08bf3469e9a768da3ef9725ce02a0126b21315 (diff)
check if exists
Diffstat (limited to 'cli')
-rw-r--r--cli/app/commands/cortex/upload_video.py4
-rw-r--r--cli/app/search/live.py2
-rw-r--r--cli/app/search/video.py4
3 files changed, 8 insertions, 2 deletions
diff --git a/cli/app/commands/cortex/upload_video.py b/cli/app/commands/cortex/upload_video.py
index c0d2afd..4590a6c 100644
--- a/cli/app/commands/cortex/upload_video.py
+++ b/cli/app/commands/cortex/upload_video.py
@@ -34,7 +34,9 @@ def cli(ctx, opt_fp_in, opt_folder_id):
fp_out = os.path.join(app_cfg.DIR_RENDERS, fn + '.mp4')
export_video_final(opt_fp_in, fp_out)
-
+ if fp_out is None:
+ return
+
if not os.path.exists(fp_out):
print("No video found")
return
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',