MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / get_ffmpeg_version

Function get_ffmpeg_version

scenedetect/platform.py:280–291  ·  view source on GitHub ↗

Get ffmpeg version identifier, or None if ffmpeg is not found. Uses `get_ffmpeg_path()`.

()

Source from the content-addressed store, hash-verified

278
279
280def get_ffmpeg_version() -> str | None:
281 """Get ffmpeg version identifier, or None if ffmpeg is not found. Uses `get_ffmpeg_path()`."""
282 ffmpeg_path = get_ffmpeg_path()
283 if ffmpeg_path is None:
284 return None
285 # If get_ffmpeg_path() returns a value, the path it returns should be invocable.
286 output = subprocess.check_output(args=[ffmpeg_path, "-version"], text=True)
287 output_split = output.split()
288 if len(output_split) >= 3 and output_split[1] == "version":
289 return output_split[2]
290 # If parsing the version fails, return the entire first line of output.
291 return output.splitlines()[0]
292
293
294def get_mkvmerge_path() -> str | None:

Callers 1

get_system_version_infoFunction · 0.85

Calls 1

get_ffmpeg_pathFunction · 0.85

Tested by

no test coverage detected