Skip to content

Commit 0bf9fc8

Browse files
committed
Add get_ffmpeg_location utility
1 parent 45dbbf7 commit 0bf9fc8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/utilities.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import shutil
2+
3+
4+
def get_ffmpeg_location():
5+
"""
6+
Locate the ffmpeg executable in the system's PATH.
7+
8+
Returns:
9+
str: The path to the ffmpeg executable.
10+
11+
Raises:
12+
FileNotFoundError: If ffmpeg is not found in the PATH.
13+
"""
14+
ffmpeg_path = shutil.which("ffmpeg")
15+
if ffmpeg_path:
16+
return ffmpeg_path
17+
else:
18+
raise FileNotFoundError("ffmpeg not found in PATH")

0 commit comments

Comments
 (0)