Skip to content

Commit

Permalink
ffmpeg not found on macos-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpagnon committed Dec 9, 2024
1 parent 1dae26a commit 71b2809
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sports2D/Utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import toml
import subprocess
from pathlib import Path
import logging

import numpy as np
from scipy import interpolate
Expand Down Expand Up @@ -206,7 +207,12 @@ def get_start_time_ffmpeg(video_path):
Get the start time of a video using FFmpeg.
'''

ffmpeg_path = ffmpeg.get_ffmpeg_exe()
try:
ffmpeg_path = ffmpeg.get_ffmpeg_exe()
except Exception as e:
logging.warning(f"No ffmpeg exe could be found. Starting time set to 0.0. Error: {e}")
return 0.0

cmd = [ffmpeg_path, "-i", video_path]
result = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.DEVNULL, text=True)
for line in result.stderr.splitlines():
Expand Down

0 comments on commit 71b2809

Please sign in to comment.