Skip to main content

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 using colorlog

📦 Installation

From PyPI (coming soon)

pip install video-editing-lib

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",
            "bytes": open("video.mp4", "rb").read()
        },
        "right": {
            "type": "text",
            "value": "Watermark Text",
            "position": "bottom"
        }
    },
    "right": {
        "type": "audio",
        "bytes": 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
│   ├── processor.py           # Command executor
│   ├── interpreter.py         # JSON → command parser
│   └── strategies/           # mediaManipulatorStrategy implementations
├── tests/                    # Unit and integration tests
├── README.md
├── pyproject.toml
├── setup.py
└── requirements.txt          # Optional (for dev setup)

🛠️ Built With

  • Python 3.11+
  • FFmpeg + ffmpeg-python
  • pytest for testing
  • colorlog 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 itsadityasharma7124@gmail.com

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

media_manipulator_lib-0.1.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

media_manipulator_lib-0.1.2-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file media_manipulator_lib-0.1.2.tar.gz.

File metadata

  • Download URL: media_manipulator_lib-0.1.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for media_manipulator_lib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4e46fcc25c042c64812abef40e67edfe39bba48c41867e614db76bfc8b9ef104
MD5 5c063870e315c4824f7726a91c053222
BLAKE2b-256 7b80f3165c9e8d2dedcbedd7d88b8b64b6d24fa59f9640a5fa5f820a8896a1f3

See more details on using hashes here.

File details

Details for the file media_manipulator_lib-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for media_manipulator_lib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4dfba1017883b0ac83021545c82ae5305537a91e5435aad21ffb901b1ec64247
MD5 3b92f4b89a72c9abd39d68b53e8fe9c1
BLAKE2b-256 7e484fca045a9805006a982f6aa401720b2a660ee25a3dce8f9bb383c6a3491f

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