A composable FFmpeg-based video editing library
Project description
๐ฌ Media Manipulator Library
A modular, pluggable video editing library built with Python and FFmpeg. Supports programmatic video transformations like text (watermark) overlay and audio merging using strategy and interpreter design patterns.
๐ Features
- Add watermark (text overlay) to videos
- Overlay audio tracks onto videos
- Process nested JSON editing instructions
- In-memory and tempfile-based FFmpeg pipelines
- Clean, extendable strategy-based architecture
- Custom command interpreter for complex video editing workflows
- Developer-friendly logging
๐ฆ Installation
From PyPI (coming soon)
pip install media-manipulator-lib==0.1.5
https://pypi.org/project/media-manipulator-lib/0.1.5/
From source
git clone https://github.com/angel-one/media-manipulator-library
cd media-manipulator-library
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
๐งช Testing
pytest # all tests
pytest tests/unit # only unit tests
pytest tests/integration # only integration tests
๐ง Usage Example
from video_editor import process_json_command
command = {
"operation": "overlay",
"left": {
"operation": "overlay",
"left": {
"type": "video",
"value": base64.b64encode(open("video.mp4", "rb").read())
},
"right": {
"type": "text",
"value": "Aditya Sharma",
"style": {
"position_x":380,
"position_y":380,
"size": 52,
"style": ""
}
}
},
"right": {
"type": "audio",
"value": base64.b64encode(open("audio.mp3", "rb").read())
}
}
result = process_json_command(command)
with open("output.mp4", "wb") as f:
f.write(result["bytes"].getvalue())
๐ Project Structure
media-manipulator-lib/
โโโ media_manipulator/ # Main package
โ โโโ __init__.py
โ โโโ cli.py # CLI entry point (if used)
โ โโโ core/
โ โ โโโ __init__.py
โ โ โโโ interpreter.py # JSON โ command parser
โ โ โโโ processor.py # Operation executor
โ โ โโโ strategy_registry.py # Registers available strategies
โ โ โโโ strategies/ # Strategy pattern implementations
โ โ โโโ __init__.py
โ โ โโโ add.py
โ โ โโโ base.py
โ โ โโโ clip.py
โ โ โโโ concat.py
โ โ โโโ overlay.py
โ โโโ utils/
โ โ โโโ __init__.py
โ โ โโโ audio.py # Audio processing helpers
โ โ โโโ helpers.py # Generic utilities
โ โ โโโ logger.py # Logger setup
โ โ โโโ video.py # Video processing helpers
โโโ tests/ # Unit and integration tests
โโโ .gitignore
โโโ LICENSE
โโโ MANIFEST.in
โโโ pyproject.toml
โโโ README.md
โโโ requirements.txt # Optional (for dev setup)
โโโ setup.py
๐ ๏ธ Built With
- Python 3.11+
- FFmpeg + ffmpeg-python
- pytest for testing
- json for colored logging
๐ License
MIT License ยฉ 2025 Aditya Sharma / AngelOne
๐โโ๏ธ Contributing
Contributions welcome! Please submit issues or pull requests for improvements or new features.
๐ซ Contact
For questions or support, open a GitHub issue or reach out to aditya.3sharma@angelone.in
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 media_manipulator_lib-0.1.5.tar.gz.
File metadata
- Download URL: media_manipulator_lib-0.1.5.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3da1823c8b860fa843052066154ece801c55977fedc184ac928eb09f7520aba
|
|
| MD5 |
ac807b6ff4355e2d61d33190cf474304
|
|
| BLAKE2b-256 |
916ab96d331367b5720e696df11fe9142d02d8cb943febe352a2a1355f533ee8
|
File details
Details for the file media_manipulator_lib-0.1.5-py3-none-any.whl.
File metadata
- Download URL: media_manipulator_lib-0.1.5-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03d7835bdda85f79f75e08e496f989b9f48f73764613cbacf2589c937c569442
|
|
| MD5 |
88ee9acb81b31701852dbc74853d2722
|
|
| BLAKE2b-256 |
98f2f2cdd20afcb13ff5c155a3add2d70d44d6c672f9df8038bbdef5f7e38fd2
|