Skip to main content

PyFFmpegCore: preflight, plan, run, and receipt

PyFFmpegCore

The safe, explainable FFmpeg task runner for the terminal, Python, and CI.
Make jobs reviewable before they run and verifiable after.

CI CodeQL PyPI version MIT license

Documentation · Five-minute start · Measured results · Releases · ⭐ Star on GitHub

PyFFmpegCore turns recurring FFmpeg commands into typed workflows with a capability check, a previewable argument plan, explicit execution policy, and a redacted receipt. Your media stays local. FFmpeg and FFprobe remain system dependencies.

Install and prove one useful result

Requires Python 3.10–3.14 and ffmpeg/ffprobe on PATH.

pipx install "pyffmpegcore==0.3.2"
pyffmpegcore doctor
pyffmpegcore smoke-test

doctor reports the installed FFmpeg build and capabilities. smoke-test creates and verifies a small synthetic clip. See the installation guide for other package managers and operating systems.

Preview before writing

For example, inspect a web-compatible MP4 plan before creating the output:

pyffmpegcore profile run web/mp4-compatible \
  --input camera.mov \
  --output web.mp4 \
  --explain

When the plan looks right, execute it and save a machine-readable receipt:

pyffmpegcore profile run web/mp4-compatible \
  --input camera.mov \
  --output web.mp4 \
  --receipt web.receipt.json

pyffmpegcore probe --input web.mp4 --json
pyffmpegcore receipt validate web.receipt.json --json

Preflight checks the required encoders, filters, streams, output location, and disk space before mutation. Results include probed output facts and stable status categories. Overwrite refusal, timeout, cancellation, and temporary-file cleanup are explicit policies.

What it is good at

  • Converting to maintained web, podcast, subtitle, and accessibility profiles.
  • Fitting an upload limit with target-size estimates and a minimum quality floor.
  • Preserving all media streams during a remux when explicitly requested.
  • Running image or mixed-media batches with receipts, retries, and resume.
  • Composing validated JSON or TOML media pipelines for repeatable automation.
  • Explaining missing FFmpeg capabilities before a job writes files.

The task recipes give concrete commands and limits for each workflow. The pipeline guide covers validation, visualization, resume, caching, and cancellation.

Python API

The Python API uses the same planner, preflight checks, and result types as the CLI:

import threading
from pyffmpegcore import JobStatus, WorkflowEngine

engine = WorkflowEngine()
plan = engine.planner.thumbnail("talk.mov", "poster.jpg", timestamp="00:00:03")
cancellation = threading.Event()
batch = engine.run(plan, cancellation=cancellation)

# A UI cancel callback or watchdog can call cancellation.set() from another thread.
item = batch.items[0]
if item.result.status is JobStatus.CANCELLED:
    print(item.result.stderr)

WorkflowEngine.run is synchronous. Put it on a worker thread in a responsive application, then set the shared event to stop an active FFmpeg process. See the Python API reference.

Real measurements

Evidence uses reproducible inputs and publishes the commands, probes, receipts, checksums, and limitations. For example, a public-domain Xiph VP9 clip reached 1,035,870 bytes under a 1 MiB target with a 7% overhead reserve; the default 5% reserve missed by 7,803 bytes. A separate compatibility conversion made an H.264/AAC output 78.2% larger than its VP9 input. The profile favors broader playback compatibility; smaller output is not guaranteed.

Automation and boundaries

Pipelines use typed workflows and never accept arbitrary shell strings. CI can use the digest-pinned GitHub Action. The separately maintained container channel is documented in the container guide.

PyFFmpegCore does not download or bundle FFmpeg, provide arbitrary filter-graph or frame APIs, run hosted transcoding, or sandbox hostile media. It does not upload media or enable telemetry by default. Review the security model before processing untrusted inputs.

Trust and contribution

If this makes a media job easier to inspect or maintain, star the repository. If something fails, open an issue with the command, OS, and FFmpeg version—never attach private media or credentials.

Metadata

Release files for pyffmpegcore 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyffmpegcore 0.3.2
File Size Uploaded
pyffmpegcore-0.3.2.tar.gz 340.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyffmpegcore 0.3.2
File Interpreter ABI Platform
pyffmpegcore-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 441.3 kB

Release files / pyffmpegcore-0.3.2.tar.gz

Download URL pyffmpegcore-0.3.2.tar.gz
Size 340.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e2eaef15fdc2a2ecba0e1e3ca63b34f4e4cc81320ad2dab27409da3a37d96592
BLAKE2b-256 checksum
How to use checksums
32e29069a823f4afa657868ba41910418244cc0efaadbc82f9e8d1b1f361967a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / pyffmpegcore-0.3.2-py3-none-any.whl

Download URL pyffmpegcore-0.3.2-py3-none-any.whl
Size 100.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d57ca4d8659df460149f37e4f76aa44d6a4160384804291bee8276a389dfa3c7
BLAKE2b-256 checksum
How to use checksums
f9ef9e33aeaffad3d6ffe7d72920a718d2605aa749e872383c3260cbc637d97a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.3

2 release files

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page