Sean Carnahan commited on
Commit
460d366
·
1 Parent(s): 146de98

Use mp4v codec for VideoWriter

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -221,7 +221,7 @@ def process_video_movenet(video_path, model_variant='lightning', pose_type='fron
221
  output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename)
222
  print(f"Output path: {output_path}")
223
 
224
- fourcc = cv2.VideoWriter_fourcc(*'avc1')
225
  out = cv2.VideoWriter(output_path, fourcc, fps, (total_width, height))
226
  if not out.isOpened():
227
  raise ValueError(f"Failed to create output video writer at {output_path}")
@@ -383,7 +383,7 @@ def process_video_mediapipe(video_path):
383
  print(f"Processing video with MediaPipe: {width}x{height} @ {fps}fps")
384
  output_filename = f'output_mediapipe.mp4'
385
  output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename)
386
- fourcc = cv2.VideoWriter_fourcc(*'avc1')
387
  out = cv2.VideoWriter(output_path, fourcc, fps, (total_width, height))
388
  if not out.isOpened():
389
  raise ValueError(f"Failed to create output video writer at {output_path}")
 
221
  output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename)
222
  print(f"Output path: {output_path}")
223
 
224
+ fourcc = cv2.VideoWriter_fourcc(*'mp4v')
225
  out = cv2.VideoWriter(output_path, fourcc, fps, (total_width, height))
226
  if not out.isOpened():
227
  raise ValueError(f"Failed to create output video writer at {output_path}")
 
383
  print(f"Processing video with MediaPipe: {width}x{height} @ {fps}fps")
384
  output_filename = f'output_mediapipe.mp4'
385
  output_path = os.path.join(app.config['UPLOAD_FOLDER'], output_filename)
386
+ fourcc = cv2.VideoWriter_fourcc(*'mp4v')
387
  out = cv2.VideoWriter(output_path, fourcc, fps, (total_width, height))
388
  if not out.isOpened():
389
  raise ValueError(f"Failed to create output video writer at {output_path}")