A comprehensive collection of 11 modular command-line utilities for video, audio, and image processing. Each tool is self-contained with its own dependencies and documentation, built on top of ffmpeg, OpenCV, and other established multimedia libraries.
Python Video Tools provides a toolkit of focused, single-purpose CLI utilities for common multimedia processing tasks. Rather than a monolithic application, each tool is an independent module that can be used in isolation or combined in shell pipelines for complex workflows.
Key design principles:
- Modular -- Each tool is self-contained in its own directory with dedicated dependencies
- CLI-first -- All tools are invoked from the command line with clear argument interfaces
- Batch-capable -- Tools support processing multiple files in a single invocation
- Cross-platform -- Compatible with macOS, Linux, and Windows (where dependencies are available)
| Tool | Description | Key Dependencies |
|---|---|---|
| video-segment-tools | Extract, split, and merge video segments by timestamp | ffmpeg |
| video-grid-composer | Compose multiple videos into side-by-side, stacked, or grid layouts | ffmpeg |
| video-compressor | Reduce video file size with configurable quality presets | ffmpeg |
| video-speed-changer | Adjust playback speed and frame rate | ffmpeg |
| video-overlay | Overlay images or videos onto a base video | moviepy |
| video-player | Browser-based video player with a Flask backend | Flask |
| Tool | Description | Key Dependencies |
|---|---|---|
| audio-extractor | Extract audio tracks from video files as MP3 | ffmpeg |
| audio-remover | Strip audio tracks from video files | ffmpeg |
| Tool | Description | Key Dependencies |
|---|---|---|
| face-cropper | Detect and crop faces from images, generate slideshows | dlib, OpenCV |
| frame-extractor | Extract still frames from video at specified intervals | OpenCV |
| image-combiner | Combine multiple images in horizontal, vertical, or grid layouts | Pillow |
| Technology | Version | Role |
|---|---|---|
| Python | 3.9+ | Runtime |
| ffmpeg | Latest | Video/audio encoding and manipulation |
| OpenCV | 4.x | Computer vision and frame extraction |
| moviepy | 1.x | Video compositing and overlay |
| dlib | Latest | Face detection |
| Pillow (PIL) | Latest | Image manipulation |
| NumPy | Latest | Numerical operations for image processing |
| Flask | Latest | Web-based video player backend |
Python 3.9 or later is required. Verify your installation:
python3 --versionMost tools depend on ffmpeg for video and audio processing.
macOS:
brew install ffmpegUbuntu / Debian:
sudo apt install ffmpegWindows:
Download from ffmpeg.org and add to your system PATH.
The face-cropper tool requires dlib, which may need CMake for compilation:
macOS:
brew install cmake
pip install dlibUbuntu / Debian:
sudo apt install cmake libboost-all-dev
pip install dlibgit clone https://github.com/sohei-t/python-video-tools.git
cd python-video-toolsEach tool manages its own dependencies. Install them per-tool as needed:
# Example: install dependencies for the face-cropper tool
cd face-cropper
pip install -r requirements.txtOr install common dependencies for all tools:
pip install opencv-python numpy pillow moviepy flask dlibcd audio-extractor
python audio_extractor.py input.mp4 -o output.mp3cd video-compressor
python video_compressor.py input.mp4 -o compressed.mp4 --quality mediumcd video-grid-composer
python video_grid_composer.py video1.mp4 video2.mp4 video3.mp4 video4.mp4 -o grid.mp4 --layout 2x2cd frame-extractor
python frame_extractor.py input.mp4 -o frames/ --interval 5cd face-cropper
python face_cropper.py photo.jpg -o faces/cd video-speed-changer
python video_speed_changer.py input.mp4 -o fast.mp4 --speed 2.0cd image-combiner
python image_combiner.py img1.png img2.png -o combined.png --direction horizontalcd audio-remover
python audio_remover.py input.mp4 -o silent.mp4The project uses pytest for automated testing:
# Install test dependencies
pip install pytest pillow
# Run all tests
pytest tests/ -vTests are located in the tests/ directory and cover core functionality for each tool.
Contributions are welcome. To add a new tool or improve an existing one:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-new-tool - Add your tool in a new directory with its own
README.mdandrequirements.txt - Add tests in the
tests/directory - Ensure code passes formatting checks:
pip install black isort
black .
isort .- Open a pull request
MIT License. See LICENSE for details.
Author: @sohei-t