Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -725,15 +725,15 @@ def process_video_file(video_file, analysis_types):
|
|
725 |
|
726 |
# Create video writer with higher quality settings
|
727 |
try:
|
728 |
-
#
|
729 |
-
|
730 |
-
fourcc = cv2.VideoWriter_fourcc(*'avc1') # H.264 codec
|
731 |
-
else:
|
732 |
-
# Fallback to older codec naming
|
733 |
-
fourcc = cv2.VideoWriter_fourcc(*'H264')
|
734 |
except Exception:
|
735 |
-
# If
|
736 |
-
|
|
|
|
|
|
|
|
|
737 |
out = cv2.VideoWriter(output_path, fourcc, output_fps, (width, height), isColor=True)
|
738 |
|
739 |
# Process every Nth frame to reduce API calls but increase from 10 to 5 for more detail
|
|
|
725 |
|
726 |
# Create video writer with higher quality settings
|
727 |
try:
|
728 |
+
# Try XVID first (widely available)
|
729 |
+
fourcc = cv2.VideoWriter_fourcc(*'XVID')
|
|
|
|
|
|
|
|
|
730 |
except Exception:
|
731 |
+
# If that fails, try Motion JPEG
|
732 |
+
try:
|
733 |
+
fourcc = cv2.VideoWriter_fourcc(*'MJPG')
|
734 |
+
except Exception:
|
735 |
+
# Last resort - use uncompressed
|
736 |
+
fourcc = cv2.VideoWriter_fourcc(*'DIB ') # Uncompressed RGB
|
737 |
out = cv2.VideoWriter(output_path, fourcc, output_fps, (width, height), isColor=True)
|
738 |
|
739 |
# Process every Nth frame to reduce API calls but increase from 10 to 5 for more detail
|