Skip to main content

videopython

PyPI Python License CI

Python library for structured, local-first video editing, processing, and AI workflows. Build edits as validated Python models or JSON plans, then render them through a bounded-memory streaming engine.

Full documentation: videopython.com

Installation

# Install FFmpeg first (macOS: brew install ffmpeg-full | Debian: apt-get install ffmpeg)
pip install videopython              # core video/audio editing
pip install "videopython[ai]"        # + all local AI features
pip install "videopython[mcp]"       # + MCP and its focused analysis/editing stack

[ai] and [mcp] are independent. Use [ai,mcp] when one environment needs every AI capability and the MCP server.

Python >=3.11, <3.15. AI features run locally without cloud inference APIs, but model weights are downloaded on first use. LLM-driven editing and scene captioning use a local Ollama server (ollama pull qwen3.6:27b). Image and video generation require an NVIDIA CUDA GPU. See the install guide for FFmpeg, Ollama, model downloads, and hardware details.

Videopython is pre-1.0. Public interfaces can still change before the stable release; see the roadmap for the stability criteria.

Quick start

An edit is a plan — a dict (or JSON) validated and executed against the source files:

from videopython.editing import VideoEdit

edit = VideoEdit.from_dict({
    "segments": [{
        "source": "raw.mp4",
        "start": 10.0,
        "end": 20.0,
        "operations": [
            {"op": "resize", "width": 1080, "height": 1920},
            {"op": "color_adjust", "saturation": 1.15, "contrast": 1.05},
            {"op": "fade", "mode": "in", "duration": 0.5},
        ],
    }],
})
edit.validate()                  # dry-run via metadata, no frames loaded
edit.run_to_file("output.mp4")   # streams ffmpeg decode → effects → encode

run_to_file() streams, so memory stays bounded even for hour-long sources. Walk through it in Tutorial 1.

A vertical clip rendered from a videopython JSON plan

A reproducible eight-second edit rendered from a JSON plan. View the plan, source, and replay script in the demo.

Automatic editing (local LLM)

Give AutoEditor your clips and a brief; a local Ollama vision model selects and orders the shots, and you get back a runnable VideoEdit:

from videopython.ai import AutoEditor, OllamaVisionLLM

editor = AutoEditor(planner=OllamaVisionLLM(model="qwen3.6:27b"))  # ollama pull qwen3.6:27b
edit = editor.edit(
    ["clip_a.mp4", "clip_b.mp4", "clip_c.mp4"],
    brief="A punchy 15-second teaser; lead with the most dynamic shot.",
)
edit.run_to_file("teaser.mp4")

The model picks scenes by id from a catalog built from scene detection + captions, so its temporal imprecision never reaches the render. See Let a local LLM edit for you.

AI generation

Image and video generation use large CUDA-only models. Speech generation can run on CPU or CUDA.

from videopython.ai import TextToImage, ImageToVideo, TextToSpeech

image = TextToImage().generate_image("A cinematic mountain sunrise")
video = ImageToVideo().generate_video(image=image)
audio = TextToSpeech().generate_audio("Welcome to videopython.")
video.add_audio(audio).save("ai_video.mp4")

Structured plans and automation

The same validation and rendering path works whether a plan is written directly, loaded from JSON, produced by a model, or submitted through MCP:

  1. Python or JSON — construct VideoEdit directly, as in the quick start.
  2. Your own LLM — use the generated JSON Schema and structured refine loop. Guide
  3. AutoEditor — use a local Ollama vision model to select and order scenes. Guide
  4. MCP — expose analysis, planning, validation, and rendering tools to any compatible client. Guide

For schema-driven integrations, every operation is a Pydantic model whose fields are the JSON wire format. VideoEdit.json_schema() returns a discriminated union over every exposed operation; pass strict=True for provider grammar modes. Plans parse permissively and report numeric bounds during validation, so a refine loop can use:

  • edit.check(meta) — collect every structured error in one pass, not just the first
  • edit.repair(meta) — auto-clamp mechanical violations (overruns, negatives) with a changelog
  • edit.normalize_dimensions(meta, target) — make heterogeneous segments concat-compatible

Why it is built this way: LLM-first design.

Features

  • videopython.base — Video, VideoMetadata, FrameIterator, Transcription, and shared result types (BoundingBox, FaceTrack, SceneBoundary, ...). No AI dependencies.
  • videopython.audio — Audio with overlay, concat, normalize, time-stretch, silence detection, segment classification.
  • videopython.editing — Operation/Effect foundation, VideoEdit plan runner with JSON Schema + streaming execution. Transforms (resize, crop, fps, speed, freeze, silence removal; cutting is the segment's own start/end) and effects (blur, zoom, color grading, vignette, Ken Burns, fade, overlays, animated subtitles).
  • videopython.ai (install with [ai]) — generation (TextToVideo, ImageToVideo, TextToImage, TextToSpeech, TextToMusic), understanding (AudioToText, AudioClassifier, SceneVLM, FaceShotTracker, FaceSmoothingTracker, ObjectDetector, SemanticSceneDetector), the FaceTrackingCrop transform, the ObjectDetectionOverlay effect, and the full-pipeline VideoAnalyzer. Scene captioning and dubbing translation run on a local Ollama model.
  • videopython.ai.auto_edit — AutoEditor + OllamaVisionLLM: plan and render an edit from sources + a one-line brief.
  • videopython.ai.dubbing — VideoDubber for voice-cloned revoicing with timing sync.
  • videopython.mcp (install with [mcp]) — videopython-mcp, an MCP stdio server exposing the auto-edit pipeline to compatible clients. The extra includes the analysis and AI editing dependencies, but not generation, dubbing, diarization, source separation, or TTS.

Documentation

The docs follow Diátaxis: four sections, each answering a different kind of question.

Tutorials Learn by doing — start here if you are new
How-to guides Recipes for a specific goal
Reference Classes, operations, parameters, wire format
Explanation Why the library is shaped the way it is

Development

See DEVELOPMENT.md for local setup, testing, docs, and the release workflow. See ROADMAP.md for project direction and the criteria for 1.0.

Metadata

Release files for videopython 0.58.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 videopython 0.58.0
File Size Uploaded
videopython-0.58.0.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for videopython 0.58.0
File Interpreter ABI Platform
videopython-0.58.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / videopython-0.58.0.tar.gz

Download URL videopython-0.58.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
519d9b9d8a9709304b1b441173d27c23ce60f585e551878c69cf53c6cad3d795
BLAKE2b-256 checksum
How to use checksums
e8367e83a32a4ada2071ce104f1f7608b778dd936c0f1d3ed32464eae871b16f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release files / videopython-0.58.0-py3-none-any.whl

Download URL videopython-0.58.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c3a8edc001fdafb2cd74a4cbcbca60bf2a705da5e3c4b00ced153bda94db2722
BLAKE2b-256 checksum
How to use checksums
50579e7b6e0a8ecae7958bf9662d27771b6736fe32c3b02564aa553e13b57cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.62.1

2 release files

This release

0.58.0 This release

2 release files

0.55.1

2 release files

0.53.0

2 release files

0.52.1

2 release files

0.52.0

2 release files

0.51.0

2 release files

0.50.1

2 release files

0.50.0

2 release files

0.49.0

2 release files

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.1

2 release files

0.44.0

2 release files

0.43.1

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.41.0

2 release files

0.40.0

2 release files

0.35.1

2 release files

0.35.0

2 release files

0.34.1

2 release files

0.34.0

2 release files

0.33.5

2 release files

0.33.4

2 release files

0.33.3

2 release files

0.33.2

2 release files

0.33.1

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.3

2 release files

0.31.2

2 release files

0.31.1

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.26.4

2 release files

0.26.3

2 release files

0.26.2

2 release files

0.25.6

2 release files

0.25.5

2 release files

0.25.4

2 release files

0.25.3

2 release files

0.25.2

2 release files

0.25.1

2 release files

0.25.0

2 release files

0.24.2

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.3

2 release files

0.23.2

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.8

2 release files

0.22.7

2 release files

0.22.6

2 release files

0.20.3

2 release files

0.20.2

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.3

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.6

2 release files

0.16.5

2 release files

0.16.4

2 release files

0.16.3

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.6

2 release files

0.15.5

2 release files

0.15.4

2 release files

0.15.3

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

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

0.0.1

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