Metadata-Version: 2.4
Name: cjm-capability-ffmpeg
Version: 0.0.25
Summary: An FFmpeg-based media-processing capability for the cjm-substrate runtime that provides audio extraction, segmentation, and format conversion.
Author-email: "Christian J. Mills" <9126128+cj-mills@users.noreply.github.com>
License: Apache-2.0
Project-URL: Repository, https://github.com/cj-mills/cjm-capability-ffmpeg
Keywords: python
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cjm-substrate>=0.0.51
Requires-Dist: cjm-capability-primitives>=0.0.10
Requires-Dist: tqdm
Dynamic: license-file

# cjm-capability-ffmpeg

<!-- generated from the context graph by `cjm-context-graph readme` — do not edit by hand; edit the graph (the urge to hand-edit = move it on-graph) -->

An FFmpeg-based media-processing capability for the cjm-substrate runtime that provides audio extraction, segmentation, and format conversion.

## Modules

- **`cjm_capability_ffmpeg.capability`** — FFmpeg-based media processing capability implementing the MediaProcessingCapability interface.
- **`cjm_capability_ffmpeg.utils.availability`** — Detect whether the ffmpeg binary is installed on this system.
- **`cjm_capability_ffmpeg.utils.codec`** — Map audio container formats to the ffmpeg codec used to encode them.
- **`cjm_capability_ffmpeg.utils.probe`** — Probe media files for metadata (duration, ...) via ffprobe.
- **`cjm_capability_ffmpeg.utils.progress`** — Run ffmpeg subprocess commands with a progress bar and optional callback.
- **`cjm_capability_ffmpeg.utils.segments`** — Extract temporal segments from audio files via ffmpeg stream-copy.

## API

### `cjm_capability_ffmpeg.capability`

- `FFmpegCapabilityConfig` _class_ — Configuration for the FFmpeg processing tool (the HOW knobs only).
- `FFmpegProcessingCapability` _class_ — FFmpeg-based media-processing tool capability (stage 8: pure compute).

### `cjm_capability_ffmpeg.utils.codec`

- `get_audio_codec` _function_ — Map an audio container format to the appropriate ffmpeg codec.

### `cjm_capability_ffmpeg.utils.probe`

- `get_media_duration` _function_ — Get the duration of a media file (seconds) via ffprobe.

### `cjm_capability_ffmpeg.utils.progress`

- `parse_progress_line` _function_ — Parse a progress line from ffmpeg stderr output.
- `run_ffmpeg_with_progress` _function_ — Run an ffmpeg command with a progress bar.

### `cjm_capability_ffmpeg.utils.segments`

- `extract_audio_segment` _function_ — Extract a temporal segment from an audio file.
