annie.media.probe¶
Cheap media probing via ffprobe (service).
Browse shows video / audio tags per sample. Whether a file has frames is
known from the scan (a video file is present); whether it has an audio stream is
not, so it is probed on demand with ffprobe — much cheaper than decoding. The
command builder is pure and unit-tested; the thin runner spawns it.
Functions¶
|
Build the ffprobe argv that lists a file's audio streams. |
|
Build the ffprobe argv that lists a file's video streams. |
|
Return whether |
|
Return whether |
Module Contents¶
- annie.media.probe.audio_probe_command(path: str | pathlib.Path) list[str][source]¶
Build the ffprobe argv that lists a file’s audio streams.
- Parameters:
path – The media file to inspect.
- Returns:
The ffprobe argv (no shell). Non-empty stdout means an audio stream exists.
- annie.media.probe.video_probe_command(path: str | pathlib.Path) list[str][source]¶
Build the ffprobe argv that lists a file’s video streams.
- Parameters:
path – The media file to inspect.
- Returns:
The ffprobe argv (no shell). Empty stdout means the file has no video stream (e.g. an
.mp4that is really audio-only and yields no frames).
- annie.media.probe.has_audio(path: str | pathlib.Path) bool[source]¶
Return whether
pathhas at least one audio stream.- Parameters:
path – The media file to inspect.
- Returns:
Trueif ffprobe reports an audio stream,Falseotherwise (including on any ffprobe error, so a missing ffprobe degrades to “no audio”).