videopython¶
Minimal, LLM-friendly Python library for programmatic video editing, processing, and AI workflows.
from videopython.editing import VideoEdit
edit = VideoEdit.from_dict({
"segments": [
{"source": "intro.mp4", "start": 0, "end": 3,
"operations": [{"op": "resize", "width": 1080, "height": 1920}]},
{"source": "raw.mp4", "start": 10, "end": 25,
"operations": [
{"op": "resize", "width": 1080, "height": 1920},
{"op": "resample_fps", "fps": 30},
{"op": "fade", "mode": "in", "duration": 0.5},
]},
],
})
edit.run_to_file("output.mp4")
An edit is a plain data structure — a dict, or the JSON an LLM emits — validated before any frame is touched and rendered by a streaming engine whose frame buffers do not grow with source length.
Where to go next¶
The documentation is split by what you are trying to do.
Tutorials¶
Learn by doing. Start here if you are new: two short lessons that take you from an installed package to a rendered video.
How-to guides¶
Recipes for a specific goal — a vertical social clip, an hour-long source, a dubbed track, an LLM or agent driving the edit.
Reference¶
The API surface: classes, operations, parameters, and the JSON wire format. Look things up here, don't read it front to back.
Explanation¶
Why the library is shaped the way it is — the streaming engine, the plan lifecycle, the LLM-first design, and the local AI stack.
What is in the box¶
- Editing — multi-segment plans with cuts, resize, crop, speed, freeze, silence removal, and pixel effects (blur, color grading, Ken Burns, fades, overlays, subtitles).
- Local AI — generate images, video, speech and music; transcribe with diarization; detect scenes, faces and objects; caption shots with a vision model. No cloud API keys.
- LLM control — every operation is a Pydantic model, so the JSON Schema is the tool schema. Callers can validate, repair mechanical errors, and normalize plans before rendering.
- Agent control —
videopython-mcpexposes the whole auto-edit pipeline as Model Context Protocol tools.
See Install for package extras, FFmpeg, Ollama, and hardware requirements.