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.1.tar.gz (10.5 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.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: media_manipulator_lib-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 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.1.tar.gz
Algorithm Hash digest
SHA256 6d039a8bbba5582652691e3b49894273e62d37156dc6ae89983f4dbaab778036
MD5 7a1b3035608ba22c088c6d63e15e771b
BLAKE2b-256 fa7fffe38e4f4065962f39832263e4cf879d3748e38e40a4f82fde17b978e94c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for media_manipulator_lib-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0873b2ed3a7b2509d072d24690b93ca68abb3a1347cac61a41a5db88ec95f97e
MD5 2316b3e1e7175edacb11e3d7a47ded56
BLAKE2b-256 1b9356b45ba613a7e565b4257b4796a90c278ea6d9b44160579dfbce0d9ff755

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