Skip to content

Commit 71b2809

Browse files
committed
ffmpeg not found on macos-latest
1 parent 1dae26a commit 71b2809

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sports2D/Utilities/common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import toml
2121
import subprocess
2222
from pathlib import Path
23+
import logging
2324

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

209-
ffmpeg_path = ffmpeg.get_ffmpeg_exe()
210+
try:
211+
ffmpeg_path = ffmpeg.get_ffmpeg_exe()
212+
except Exception as e:
213+
logging.warning(f"No ffmpeg exe could be found. Starting time set to 0.0. Error: {e}")
214+
return 0.0
215+
210216
cmd = [ffmpeg_path, "-i", video_path]
211217
result = subprocess.run(cmd, stderr=subprocess.PIPE, stdout=subprocess.DEVNULL, text=True)
212218
for line in result.stderr.splitlines():

0 commit comments

Comments
 (0)