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.0.tar.gz (10.6 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.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: media_manipulator_lib-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 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.0.tar.gz
Algorithm Hash digest
SHA256 5805a867678084b8e9efe9553e48d3f7d382b62ad5952587cd6bddffd50f3938
MD5 8d1dbf0740d14fb42fc24d851927a275
BLAKE2b-256 a316af5f39e68b1812cfcfd72c8c1542618b4cec66b8db4b5d1cbbb50d525d8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for media_manipulator_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2f5d84cce72e3cd5df485007d99d2b3a6f5e2ce9c40e18102163e4b8000011e
MD5 20bae212d1b62106deab86e4194aa368
BLAKE2b-256 2642984de83a2f0fbfc805ce9154fa575cdef35edfdf67c68294fd625470f553

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