-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from genkobar/find-ffmpeg-path-in-environment
Attempt to find ffmpeg path in the environment
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import shutil | ||
|
||
|
||
def get_ffmpeg_location(): | ||
""" | ||
Locate the ffmpeg executable in the system's PATH. | ||
Returns: | ||
str: The path to the ffmpeg executable. | ||
Raises: | ||
FileNotFoundError: If ffmpeg is not found in the PATH. | ||
""" | ||
ffmpeg_path = shutil.which("ffmpeg") | ||
if ffmpeg_path: | ||
return ffmpeg_path | ||
else: | ||
raise FileNotFoundError("ffmpeg not found in PATH") |