Skip to main content

vexy-vid

High-performance video cropping and trimming CLI tool with automatic detection.

Features

  • Crop — crop video to specific dimensions with alignment control
  • Trim — remove edges from video (like reversed CSS padding)
  • Scale — resize video after cropping/trimming
  • Automatic letterbox (black bar) detection and removal
  • Automatic subtitle region detection and removal
  • Hardware-accelerated encoding with automatic fallback
  • PyAV-based frame extraction (50-100% faster than OpenCV)
  • Numba-optimized pixel analysis (10-50x speedup)
  • Parallel frame processing with buffer pooling

Requirements

  • Python 3.10+
  • ffmpeg binary installed on your system (brew install ffmpeg / apt install ffmpeg)

Note: ffmpeg is a system dependency and cannot be installed via pip. All other dependencies are installed automatically.

Installation

# Install with uv (recommended)
uv pip install vexy-vid

# Or with pip
pip install vexy-vid

# Development install
uv pip install -e ".[dev]"

Usage

Crop — crop to specific dimensions

# Crop to exact pixels
vexy-vid crop --crop 1280x720 --input video.mp4

# Crop to aspect ratio
vexy-vid crop --crop 16:9 --Halign 0 --Valign 100 --input video.mp4

# Crop to percentage
vexy-vid crop --crop 50%x50% --input video.mp4

# Crop and scale
vexy-vid crop --crop 16:9 --scale 1920x1080 --input video.mp4

Trim — remove edges

# Remove pixels from edges
vexy-vid trim --top 100 --bottom 50 --input video.mp4

# Remove percentage from sides
vexy-vid trim --left 10% --right 10% --input video.mp4

# Auto-detect and remove letterbox bars
vexy-vid trim --Letterbox --input video.mp4

# Auto-detect and remove subtitle region
vexy-vid trim --subtitles --bottom 20 --input video.mp4

# Trim and scale
vexy-vid trim --Letterbox --scale 1920x1080 --input video.mp4

Common flags

Flag Description
--input / -i Input video path (or pipe via stdin)
--output / -o Output video path (auto-generated if omitted)
--quality / -q Encoding quality: 0 (fast), 1 (balanced), 2 (quality)
--verbose / -v Enable verbose logging

Size spec formats (for --crop and --scale)

Format Example Description
WxH 1280x720 Exact pixel dimensions
W:H 16:9 Aspect ratio
P%xP% 50%x50% Percentage of original
Wx 1280x Width only (height = 100%)
xH x720 Height only (width = 100%)
Mixed 1280x50% Pixels and percentage

Performance

Optimizations over the original implementation:

  • PyAV multi-threaded decoding — 50-100% faster frame extraction
  • Hardware encoder detection — 300-500% encoding speedup (NVENC, QSV, AMF)
  • Producer-consumer pipeline — 200-400% parallel processing improvement
  • Buffer pool memory management — 25-50% reduced allocation overhead
  • Numba SIMD pixel operations — 10-50x analysis speedup
  • Intelligent caching — instant reprocessing of identical videos

License

Apache License 2.0

Release files for vexy-vid 1.0.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 vexy-vid 1.0.2
File Size Uploaded
vexy_vid-1.0.2.tar.gz 21.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vexy-vid 1.0.2
File Interpreter ABI Platform
vexy_vid-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 47.0 kB

Release files / vexy_vid-1.0.2.tar.gz

Download URL vexy_vid-1.0.2.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
28cf3cd04a0ac0e4f6df60462a5e6cef3dac09698fa8cb417824715c6ca86238
BLAKE2b-256 checksum
How to use checksums
7a952859d4b80641c20bb0e695c4f2e6960f60128bbc9e61f002186560e625e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / vexy_vid-1.0.2-py3-none-any.whl

Download URL vexy_vid-1.0.2-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c7670016162cb71469267478ab2212c7340f73735d035e22d0dcd8e561a68ff
BLAKE2b-256 checksum
How to use checksums
8e0362eaa0f1b33abbe6892f2f2f5e71835d49f9210b87e8b13ebe42a5866c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.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