Skip to main content

🎬 Video Editing 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/your-username/video-editing-lib.git
cd video-editing-lib
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

video-editing-lib/
├── video_editor/              # Main package
│   ├── __init__.py
│   ├── processor.py           # Command executor
│   ├── interpreter.py         # JSON → command parser
│   └── strategies/           # VideoEditStrategy 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

Release files for video-editor-lib 0.1.0

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

Source distribution (sdist)

Source distribution for video-editor-lib 0.1.0
File Size Uploaded
video_editor_lib-0.1.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for video-editor-lib 0.1.0
File Interpreter ABI Platform
video_editor_lib-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.7 kB

Release files / video_editor_lib-0.1.0.tar.gz

Download URL video_editor_lib-0.1.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2ad64c01756230fa7c955faba2cc33faff2c90705bb4d02b3ba637624b8d0a7a
BLAKE2b-256 checksum
How to use checksums
587c945a81debddf884a93bfca5912d1854c2c2368bdf24cf535bbdca7fb5e60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / video_editor_lib-0.1.0-py3-none-any.whl

Download URL video_editor_lib-0.1.0-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfbd4cf3b458affb1942567181cca4181de52293de6c30f96ab7eed671d29027
BLAKE2b-256 checksum
How to use checksums
af997834f0b19f7cd1229dfd7de319a0992da54223655ab0225f5e353faab3f1
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.0 This release

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