MCPcopy Create free account
hub / github.com/FastLED/FastLED / find_ffmpeg

Function find_ffmpeg

ci/tools/generate_audio_fixtures.py:70–97  ·  view source on GitHub ↗

Find ffmpeg binary, preferring static-ffmpeg from pip.

()

Source from the content-addressed store, hash-verified

68
69
70def find_ffmpeg() -> str:
71 """Find ffmpeg binary, preferring static-ffmpeg from pip."""
72 # Try static-ffmpeg first
73 try:
74 import static_ffmpeg # pyright: ignore[reportMissingTypeStubs]
75
76 static_ffmpeg.add_paths() # pyright: ignore[reportUnknownMemberType]
77 except ImportError:
78 pass
79
80 ffmpeg = shutil.which("ffmpeg")
81 if ffmpeg:
82 return ffmpeg
83
84 # Fallback: common locations
85 for path in [
86 r"C:\Users\niteris\bin\ffmpeg.EXE",
87 "/usr/bin/ffmpeg",
88 "/usr/local/bin/ffmpeg",
89 ]:
90 if os.path.isfile(path):
91 return path
92
93 print(
94 "ERROR: ffmpeg not found. Install with: pip install static-ffmpeg",
95 file=sys.stderr,
96 )
97 sys.exit(1)
98
99
100def run_ffmpeg(ffmpeg: str, args: list[str], desc: str = "") -> None:

Callers 1

mainFunction · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected