summaryrefslogtreecommitdiff
path: root/cli/app/commands
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-11 02:37:30 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-11 02:37:30 +0100
commit509de775884d0bcf89f103580cc7b081215c235a (patch)
tree1f853a011050926aa93f87872ea80cf7c826275e /cli/app/commands
parent7189336ef4538e232a851246476d09cb41ffc660 (diff)
dirz
Diffstat (limited to 'cli/app/commands')
-rw-r--r--cli/app/commands/cortex/upload_video.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/cli/app/commands/cortex/upload_video.py b/cli/app/commands/cortex/upload_video.py
index f8b9686..6c46d0c 100644
--- a/cli/app/commands/cortex/upload_video.py
+++ b/cli/app/commands/cortex/upload_video.py
@@ -19,15 +19,20 @@ def cli(ctx, opt_fp_in, opt_folder_id):
opt_folder_id = folder['id']
if opt_fp_in is None:
- results_dir = os.path.join(app_cfg.RESULTS_DIR)
- for fn in sorted(os.listdir(app_cfg.RESULTS_DIR), reverse=True):
- fp_frames = os.path.join(app_cfg.RESULTS_DIR, fn)
- if os.path.isdir(f):
+ for fn in sorted(os.listdir(app_cfg.DIR_RESULTS), reverse=True):
+ fp_frames = os.path.join(app_cfg.DIR_RESULTS, fn)
+ if os.path.isdir(fp_frames):
+ opt_fp_in = fp_frames
break
- fp_out = os.path.join(app_cfg.DIR_RENDERS, fn + '.mp4')
- export_video_final(fp_frames, fp_out)
- else:
- fp_out = opt_fp_in
+
+ frames = os.listdir(opt_fp_in)
+ if len(frames) < 10:
+ print("Didn't run long enough, skipping")
+ return
+
+ fp_out = os.path.join(app_cfg.DIR_RENDERS, fn + '.mp4')
+ export_video_final(opt_fp_in, fp_out)
+
if not os.path.exists(fp_out):
print("No video found")
return