Skip to content

Commit 1fb5288

Browse files
committed
security: FlightTelemetryTools stop apt auto-install of ffmpeg (Wed Oct 7, 2026 ET)
1 parent c1f9880 commit 1fb5288

4 files changed

Lines changed: 32 additions & 27 deletions

File tree

‎FlightTelemetryTools/README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Optional recorded speed tags also accepted when present: `H.S …m/s`, `[h_spd:
3636
## Requirements
3737

3838
- Python 3.10+ (**stdlib only** for parse / GPX / KML)
39-
- **ffmpeg** (+ ffprobe) for the `burn` HUD command only
39+
- **ffmpeg** (+ ffprobe) for the `burn` HUD command only — install via your OS package manager (`apt`, `brew`, `dnf`, …). The tool does **not** auto-install packages.
4040
- `pytest` for tests
4141

4242
---
@@ -89,7 +89,7 @@ pip install -r requirements.txt
8989
python -m pytest
9090
```
9191

92-
Fixtures under `tests/fixtures/` cover classic font-wrapped, bracket Mini-style, and GPS-function / H.S dialects, plus missing-GPS cues. The burn test generates a short silent lavfi MP4 (no drone footage required) and skips only if ffmpeg cannot be installed.
92+
Fixtures under `tests/fixtures/` cover classic font-wrapped, bracket Mini-style, and GPS-function / H.S dialects, plus missing-GPS cues. The burn test generates a short silent lavfi MP4 (no drone footage required) and skips if ffmpeg/ffprobe are not already on PATH.
9393

9494
---
9595

@@ -123,6 +123,12 @@ FlightTelemetryTools/
123123

124124
---
125125

126+
## Changelog
127+
128+
- **Wed Oct 7, 2026 ET** — Removed silent `apt-get` auto-install of ffmpeg. HUD burn now errors clearly if ffmpeg/ffprobe are missing; install them yourself via your package manager.
129+
130+
---
131+
126132
## License
127133

128134
For portfolio demonstration. Use only with footage and sidecars you own or are authorized to process.

‎FlightTelemetryTools/flight_telemetry/hud.py‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,21 @@ def ffmpeg_available() -> bool:
1818

1919

2020
def ensure_ffmpeg() -> str:
21-
"""Return path to ffmpeg, attempting a package install if missing."""
21+
"""Return path to ffmpeg, or raise if it (or ffprobe) is not on PATH.
22+
23+
Does not install packages. Install ffmpeg and ffprobe via your OS
24+
package manager, e.g. ``apt install ffmpeg``, ``brew install ffmpeg``,
25+
or ``dnf install ffmpeg``.
26+
"""
2227
path = shutil.which("ffmpeg")
23-
if path:
28+
if path and shutil.which("ffprobe"):
2429
return path
25-
# Best-effort install on this Linux box (Debian/Ubuntu style).
26-
for cmd in (
27-
["apt-get", "update"],
28-
["apt-get", "install", "-y", "ffmpeg"],
29-
):
30-
try:
31-
subprocess.run(cmd, check=False, capture_output=True, timeout=180)
32-
except (OSError, subprocess.TimeoutExpired):
33-
break
34-
path = shutil.which("ffmpeg")
35-
if not path:
36-
raise RuntimeError(
37-
"ffmpeg is required for HUD burn but could not be found or installed"
38-
)
39-
return path
30+
raise RuntimeError(
31+
"ffmpeg is required for HUD burn but was not found on PATH. "
32+
"Install it with your package manager "
33+
"(e.g. apt install ffmpeg, brew install ffmpeg, dnf install ffmpeg) "
34+
"and ensure both ffmpeg and ffprobe are available."
35+
)
4036

4137

4238
def _fmt_speed(frame: TelemetryFrame) -> str:

‎FlightTelemetryTools/tests/test_hud.py‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""HUD burn tests (skip only if ffmpeg truly unavailable after install attempt)."""
1+
"""HUD burn tests (skip if ffmpeg/ffprobe not on PATH)."""
22

33
from __future__ import annotations
44

@@ -19,13 +19,15 @@
1919

2020
@pytest.fixture(scope="module")
2121
def ffmpeg_ready() -> bool:
22-
if ffmpeg_available():
23-
return True
24-
try:
22+
return ffmpeg_available()
23+
24+
25+
def test_ensure_ffmpeg_missing(monkeypatch: pytest.MonkeyPatch) -> None:
26+
monkeypatch.setattr(
27+
"flight_telemetry.hud.shutil.which", lambda _name: None
28+
)
29+
with pytest.raises(RuntimeError, match="Install it with your package manager"):
2530
ensure_ffmpeg()
26-
return ffmpeg_available()
27-
except RuntimeError:
28-
return False
2931

3032

3133
def test_ass_generation(bracket_srt: Path) -> None:
@@ -41,7 +43,7 @@ def test_burn_hud_on_generated_video(
4143
bracket_srt: Path, tmp_path: Path, ffmpeg_ready: bool
4244
) -> None:
4345
if not ffmpeg_ready:
44-
pytest.skip("ffmpeg could not be installed on this system")
46+
pytest.skip("ffmpeg/ffprobe not available on PATH")
4547
video = make_silent_test_video(tmp_path / "src.mp4", duration_s=4.0)
4648
frames = parse_srt_file(bracket_srt)
4749
out = tmp_path / "hud.mp4"

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Most folders are copies of the original repositories. `FileIntegrityCheckerSHA25
1919

2020
## Changelog
2121

22+
- **Wed Oct 7, 2026 ET** — `FlightTelemetryTools`: removed silent apt-get auto-install of ffmpeg; HUD burn errors clearly if ffmpeg is missing. See that folder’s README.
2223
- **Wed Oct 7, 2026 ET** — Added `PreFlightGoNoGo`: METAR + NOAA Kp + sun times → FLY / MARGINAL / DON'T FLY. See that folder’s README.
2324
- **Sun Oct 4, 2026 ET** — Added `FlightTelemetryTools`: DJI `.SRT` → GPX/KML flight tracks and ffmpeg altitude/speed HUD burn. See that folder’s README.
2425
- **Sat Sep 26, 2026 ET** — SharePoint hardening on `main` ([017c0c1](https://github.com/ztel42/PythonCollection/commit/017c0c1ca80fe428f7801ecf12727f8faca1dae7)): path traversal fix in `PythonSharePointLibraryAutoZip`; OData datetime validation in `PythonSharePointAutoPull`. See each folder’s `README.txt`.

0 commit comments

Comments
 (0)