Spaces:
Running on Zero
Running on Zero
Fix clip extraction return value
Browse files- extract_clip.py +2 -0
extract_clip.py
CHANGED
|
@@ -36,8 +36,10 @@ def extract_pre_alert_clip(video_path, alert_time, output_path="./extracted_clip
|
|
| 36 |
|
| 37 |
out.release()
|
| 38 |
print(f"Extracted clip saved to {output_path} ({start_time:.2f}s to {end_time:.2f}s)")
|
|
|
|
| 39 |
else:
|
| 40 |
print("No frames extracted")
|
|
|
|
| 41 |
|
| 42 |
if __name__ == "__main__":
|
| 43 |
video_path = "./nexar_data/sample_videos/sample_dashcam_2.mp4"
|
|
|
|
| 36 |
|
| 37 |
out.release()
|
| 38 |
print(f"Extracted clip saved to {output_path} ({start_time:.2f}s to {end_time:.2f}s)")
|
| 39 |
+
return output_path
|
| 40 |
else:
|
| 41 |
print("No frames extracted")
|
| 42 |
+
return None
|
| 43 |
|
| 44 |
if __name__ == "__main__":
|
| 45 |
video_path = "./nexar_data/sample_videos/sample_dashcam_2.mp4"
|