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.
  • Unified Web UI: Professional browser-based studio for visual timeline editing, cropping, and workflow orchestration.

๐Ÿ“ฆ 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

# Start the Visual Studio
ffx ui

๐Ÿ›  Usage & Scenarios

1. Visual Studio (Web UI) ๐ŸŽจ

The most intuitive way to use ffxpy. Launch the local server and edit your videos in the browser:

ffx ui
  • Timeline Editing: Visual In/Out point selection with keyframe snapping.
  • Interactive Cropping: Draggable area selection directly on the video player.
  • Concurrent Queue: Manage multiple tasks and watch them execute in parallel with live metrics.

2. Automated Workflows (Recommended for batch ๐ŸŒŸ)

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

# Interactive or CLI cropping
ffx crop input.mp4 --crop 1920:1080:0:0 -o output.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:

  1. YAML Flow file: Under the setting key.
  2. Environment Variables: Use the FFXPY_ prefix (e.g., FFXPY_VIDEO_CODEC=libx264).
  3. 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 to ffmpeg executable.
  • ffprobe_path: Manual path to ffprobe_path executable.
  • 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

ffxpy-0.4.0.tar.gz (209.6 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.4.0-py3-none-any.whl (128.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ffxpy-0.4.0.tar.gz
  • Upload date:
  • Size: 209.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.4.0.tar.gz
Algorithm Hash digest
SHA256 ab95958f74d625888284a31b4b775695d0b38464472747d3c5449c781ee85fbc
MD5 ab285667e0e7376469d974f2991b9bb3
BLAKE2b-256 e5a49eb028109a6120dabbde33138843910032ce1f52f652815e5e5ae52513d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ffxpy-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 128.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 105034313236fc4864f2d431e33dcc1de36835ece96a782024606ead4d91d28a
MD5 5eb72d74bd01bc4c2de063046466ff0d
BLAKE2b-256 487c762b5a7bec91013f3386dfd745f4a705c7b2aea28fd9f18fb37310f2490e

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