from __future__ import annotations import shutil def resolve_ffmpeg_executable() -> str: executable = shutil.which("ffmpeg") if executable: return executable try: import imageio_ffmpeg return imageio_ffmpeg.get_ffmpeg_exe() except Exception as exc: raise RuntimeError( "ffmpeg is required for video processing. Install ffmpeg on PATH or install " "the Python package 'imageio-ffmpeg'." ) from exc