A highly optimized CLI tool to simplify complex ffmpeg operations via YAML-defined workflows.
Project description
ffxpy
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
ffmpegoverhead completely. - Production-Ready Visualization: Beautiful, real-time progress bars with live transcoding metrics (speed, FPS) powered by
rich. - Pre-flight Validation: Uses
ffprobeto 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"
overwrite: true
jobs:
- command: split
setting:
end: "00:00:15"
- command: split
setting:
start: "01:20:00"
end: "01:21:00"
- command: merge
setting:
output_path: "highlights.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
โ๏ธ Configuration & Options
ffxpy uses a unified settings system. You can configure it via:
- YAML Flow file: Under the
settingkey. - Environment Variables: Use the
FFXPY_prefix (e.g.,FFXPY_VIDEO_CODEC=libx264). - CLI Arguments: Standard flags like
--video-codec.
Core Settings
| Option | Description | Default |
|---|---|---|
input_path |
Source video file path | - |
output_path |
Final output file path | - |
working_dir |
Base directory for relative paths | Input file dir |
overwrite |
Overwrite existing files | false |
dry_run |
Preview ffmpeg commands without execution | false |
concurrency |
Number of parallel jobs (Smart Auto-detection) | CPU-based |
Encoding & Processing
| Option | Description | Default |
|---|---|---|
video_codec |
Video codec (e.g., libx264, h264_nvenc, copy) |
copy |
video_bitrate |
Video bitrate (e.g., 5M, 2000k) |
- |
audio_codec |
Audio codec (e.g., aac, copy) |
copy |
audio_bitrate |
Audio bitrate (e.g., 192k) |
- |
scale |
Resize video (e.g., 1920:1080, 1280:-1) |
- |
preset |
ffmpeg preset (e.g., fast, slow, p1 to p7) |
- |
skip_existing |
Skip the job if output file already exists | false |
keep_temp |
Do not delete temporary split files after merge | false |
Path & Tool Discovery
ffmpeg_path: Manual path toffmpegexecutable.ffprobe_path: Manual path toffprobe_pathexecutable.output_dir: Directory where all outputs will be saved.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ffxpy-0.3.2.tar.gz.
File metadata
- Download URL: ffxpy-0.3.2.tar.gz
- Upload date:
- Size: 14.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79efdd5515dd9c7832df1a23aed1c19dfc6d8429a77f6210d14a9a3beb25adbc
|
|
| MD5 |
fdce8583738ae869c181f0bc889e3560
|
|
| BLAKE2b-256 |
076612c3275b490271b1e017f56f828c6524a7b6240dfff660160fcddd89b9ae
|
File details
Details for the file ffxpy-0.3.2-py3-none-any.whl.
File metadata
- Download URL: ffxpy-0.3.2-py3-none-any.whl
- Upload date:
- Size: 16.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d4a1424f8efbfeff2d10198b58d2854a8613b7ec483c5a6fdf3de35865e4065
|
|
| MD5 |
a5a3b610b5a24560b1f271a462aebda8
|
|
| BLAKE2b-256 |
eacf1f181500db7d8aa973adc6ac96f25812ca6aeae9827e743f670c85e49fda
|