Spaces:
Running
on
Zero
Running
on
Zero
Bug fix: video write failure on $pred_only == True
#4
by
danpanfili
- opened
- run_video.py +5 -0
run_video.py
CHANGED
@@ -59,6 +59,11 @@ if __name__ == '__main__':
|
|
59 |
frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
|
60 |
output_width = frame_width * 2 + margin_width
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')
|
63 |
out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
|
64 |
|
|
|
59 |
frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
|
60 |
output_width = frame_width * 2 + margin_width
|
61 |
|
62 |
+
if args.pred_only:
|
63 |
+
output_width = frame_width
|
64 |
+
else:
|
65 |
+
output_width = frame_width * 2 + margin_width
|
66 |
+
|
67 |
output_path = os.path.join(args.outdir, os.path.splitext(os.path.basename(filename))[0] + '.mp4')
|
68 |
out = cv2.VideoWriter(output_path, cv2.VideoWriter_fourcc(*"mp4v"), frame_rate, (output_width, frame_height))
|
69 |
|