Skip to main content

🎬 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

Release files for media-manipulator-lib 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for media-manipulator-lib 0.1.5
File Size Uploaded
media_manipulator_lib-0.1.5.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for media-manipulator-lib 0.1.5
File Interpreter ABI Platform
media_manipulator_lib-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 kB

Release files / media_manipulator_lib-0.1.5.tar.gz

Download URL media_manipulator_lib-0.1.5.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a3da1823c8b860fa843052066154ece801c55977fedc184ac928eb09f7520aba
BLAKE2b-256 checksum
How to use checksums
916ab96d331367b5720e696df11fe9142d02d8cb943febe352a2a1355f533ee8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / media_manipulator_lib-0.1.5-py3-none-any.whl

Download URL media_manipulator_lib-0.1.5-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03d7835bdda85f79f75e08e496f989b9f48f73764613cbacf2589c937c569442
BLAKE2b-256 checksum
How to use checksums
98f2f2cdd20afcb13ff5c155a3add2d70d44d6c672f9df8038bbdef5f7e38fd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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