Skip to main content

A highly optimized CLI tool to simplify complex ffmpeg operations via YAML-defined workflows.

Project description

ffxpy

license Python 3.9+ PyPI Downloads Buy Me A Coffee

ffxpy is a highly optimized CLI tool to automate complex ffmpeg tasks. It orchestrates splitting, merging, and transcoding through simple YAML workflows with intelligent resource management.

๐Ÿš€ Why ffxpy?

  • Zero-Config Turbo Mode: Automatically balances concurrencyโ€”up to 16 parallel jobs for I/O-bound tasks (copy), and restricted to 2 for CPU-intensive encoding to keep your system responsive.
  • Smart Merge Optimization: Detects single-file merge tasks and uses direct file moves to bypass ffmpeg overhead completely.
  • Production-Ready Visualization: Beautiful, real-time progress bars with live transcoding metrics (speed, FPS) powered by rich.
  • Pre-flight Validation: Uses ffprobe to verify video assets and time ranges before starting long-running jobs.

๐Ÿ“ฆ Installation

For the best experience, we recommend using uv:

# Install as a global tool
uv tool install ffxpy

# Or run it instantly without installation
uvx ffxpy flow highlights.yml

๐Ÿ›  Usage & Scenarios

1. Automated Workflows (Recommended ๐ŸŒŸ)

The most powerful way to use ffxpy is via YAML-defined workflows. It features a beautiful, real-time multi-tasking interface:

# highlights.yml
setting:
  input_path: "stream_archive.mp4"

jobs:
  - name: "Intro Clip"
    command: split
    setting: { end: "00:00:15", output_path: "part1.mp4" }
  
  - name: "Best Action"
    command: split
    setting: { start: "01:20:00", end: "01:21:00", output_path: "part2.mp4" }

  - name: "Concatenate Highlights"
    command: merge
    setting: { output_path: "highlights_v1.mp4" }

Real-time Progress:

Turbo Mode: All jobs are "copy", boosting to maximum I/O performance (8)
Starting flow with concurrency=8
Validating workflow...
Overall Progress โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100%        0:00:07 0:00:00
Job #0           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (188x) 0:00:02 0:00:00
Job #1           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (85x)  0:00:00 0:00:00
Job #2           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (165x) 0:00:01 0:00:00
Job #3           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (114x) 0:00:00 0:00:00
Job #4           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (101x) 0:00:00 0:00:00
Job #5           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (163x) 0:00:00 0:00:00
Job #6           โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (201x) 0:00:04 0:00:00

2. Simple Command Line Operations

# Precision splitting (supports ISO durations or HH:MM:SS)
ffx split input.mp4 --start 00:00:10 --end 00:00:20 -o clip.mp4

# Smart merging of split parts
ffx merge --with-split -o final_merged.mp4

3. Advanced Transcoding during Merge

ffxpy isn't just for copying; you can transcode while merging:

ffx merge --with-split --video-codec libx264 --video-bitrate 5M --scale 1280:720

โš™๏ธ Options Reference

  • --working-dir, -w: Base directory for all relative paths.
  • --output-path, -o: Explicit output path for the final result.
  • --overwrite, -y: Force overwrite existing files.
  • --dry-run, -n: Preview all generated ffmpeg commands without execution.
  • --concurrency, -c: Manual override for smart concurrency logic.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffxpy-0.3.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffxpy-0.3.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file ffxpy-0.3.0.tar.gz.

File metadata

  • Download URL: ffxpy-0.3.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ffxpy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 619137ad5cc84f01c995ef9d8207b430b6fbe41c4e3b544dfce321c33fa60264
MD5 9157c85c1c6cdc24d752e1b70e51bd0f
BLAKE2b-256 f62b7f4519620b79ec9b09872f0cdc8846a29845e53addcd0e71a928a9a26426

See more details on using hashes here.

File details

Details for the file ffxpy-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ffxpy-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ffxpy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fffd251eb3b25c924895872908c9ae72a68371f4ca32a5d775803bed61fd1661
MD5 c7bf1173ec39adfb2833be0eb94f229b
BLAKE2b-256 197500081529e9632ff437442327079da1152ef8a8c0f8d28d671e1289e86998

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page