Summary
Extend parler doctor to report the installed FFmpeg version and flag when video codec support may be limited. Right now the check only tests whether the ffmpeg binary is on PATH — it does not tell the user which version they have or whether common video codecs are available.
Background
parler uses FFmpeg to extract audio from video files (.mp4, .mkv, .mov, .avi, .ts). Users frequently hit issues because:
- Their distro's FFmpeg build lacks certain codec libraries (e.g.
libx264, aac)
- The wrong FFmpeg is on PATH (e.g. a minimal build from a conda env)
Reporting the version in parler doctor makes these problems immediately visible without needing to process a real file.
What to implement
In parler/doctor.py, extend the existing FFmpeg check to also run ffmpeg -version and parse the first line:
# Current output
parler doctor
✓ FFmpeg available
# Target output
parler doctor
✓ FFmpeg 7.1 (built with libx264, libopus, aac)
⚠ FFmpeg 3.4.8 — version is old, some video formats may fail
Specifically:
- Run
ffmpeg -version (or ffprobe -version) via subprocess.run with capture_output=True
- Parse the version string from the first output line (e.g.
ffmpeg version 7.1 Copyright ...)
- Include the version in the
DoctorCheck.detail field
- Emit a
warn status if the version is older than 4.0 (a reasonable baseline for codec support)
- If FFmpeg is not found, keep the existing
fail status unchanged
JSON output (parler doctor --json) should include the version string in the relevant check's detail field — no schema change needed.
Files to look at
| File |
What to understand |
parler/doctor.py |
The DoctorCheck dataclass and existing FFmpeg check function |
parler/audio/ffmpeg.py |
ffmpeg_available() — the current binary detection |
tests/unit/test_cli_commands.py — TestOperationalCommands |
Existing doctor tests to follow |
Acceptance criteria
Setting up
git clone https://github.com/AbdelStark/mistral-parler && cd mistral-parler
uv sync --locked --group dev
uv run parler doctor --json | python -m json.tool # see current output shape
Tips for first-timers
- Use
subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True) — wrap in try/except FileNotFoundError for the missing-binary case
- The version line looks like:
ffmpeg version 7.1-0ubuntu0.1 Copyright (c) 2000-2024 ...
- Use a simple regex or
str.split() to extract the version token; no need for packaging or semver libraries
- Look at the existing
_check_ffmpeg function in doctor.py to see how DoctorCheck objects are constructed
Summary
Extend
parler doctorto report the installed FFmpeg version and flag when video codec support may be limited. Right now the check only tests whether theffmpegbinary is onPATH— it does not tell the user which version they have or whether common video codecs are available.Background
parleruses FFmpeg to extract audio from video files (.mp4,.mkv,.mov,.avi,.ts). Users frequently hit issues because:libx264,aac)Reporting the version in
parler doctormakes these problems immediately visible without needing to process a real file.What to implement
In
parler/doctor.py, extend the existing FFmpeg check to also runffmpeg -versionand parse the first line:Specifically:
ffmpeg -version(orffprobe -version) viasubprocess.runwithcapture_output=Trueffmpeg version 7.1 Copyright ...)DoctorCheck.detailfieldwarnstatus if the version is older than4.0(a reasonable baseline for codec support)failstatus unchangedJSON output (
parler doctor --json) should include the version string in the relevant check'sdetailfield — no schema change needed.Files to look at
parler/doctor.pyDoctorCheckdataclass and existing FFmpeg check functionparler/audio/ffmpeg.pyffmpeg_available()— the current binary detectiontests/unit/test_cli_commands.py—TestOperationalCommandsAcceptance criteria
parler doctorincludes the FFmpeg version string in the FFmpeg check detailwarnwith a hint about upgradingfail)--jsonoutput includes the version in thedetailfield of the FFmpeg checkruff checkandruff format --checkpassSetting up
Tips for first-timers
subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True)— wrap intry/except FileNotFoundErrorfor the missing-binary caseffmpeg version 7.1-0ubuntu0.1 Copyright (c) 2000-2024 ...str.split()to extract the version token; no need forpackagingor semver libraries_check_ffmpegfunction indoctor.pyto see howDoctorCheckobjects are constructed