videopython 0.55.4__tar.gz → 0.56.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {videopython-0.55.4 → videopython-0.56.0}/.gitignore +1 -1
- {videopython-0.55.4 → videopython-0.56.0}/PKG-INFO +21 -7
- {videopython-0.55.4 → videopython-0.56.0}/README.md +10 -4
- {videopython-0.55.4 → videopython-0.56.0}/pyproject.toml +24 -4
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/_revisions.py +1 -1
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/audio_ops.py +1 -1
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/models.py +1 -3
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/pipeline.py +1 -2
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/transforms.py +4 -6
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/audio.py +3 -2
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/temporal.py +0 -8
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/_dimensions.py +0 -8
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/_ffmpeg.py +1 -2
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/effects.py +2 -5
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/transcription_overlay.py +1 -1
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/video_edit.py +8 -10
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/mcp/__init__.py +1 -1
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/mcp/server.py +11 -6
- {videopython-0.55.4 → videopython-0.56.0}/LICENSE +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/_device.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/_ollama.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/_optional.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/_predictor.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/backend.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/catalog.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/editor.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/local.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/models.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/auto_edit/resolve.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/_tts_backend.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/config.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/dubber.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/quality.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/remux.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/separation.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/timing.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/translation.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/dubbing/voice_sample.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/effects.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/errors.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/generation/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/generation/audio.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/generation/image.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/generation/video.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/keyframe.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/ops.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/_detector.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/classification.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/faces.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/image.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/objects.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/analyzer.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/detectors.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/models.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/sampling.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/source_metadata.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/audio/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/audio/analysis.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/audio/audio.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/_video_io.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/description.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/draw_detections.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/exceptions.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Anton-OFL.txt +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Anton-Regular.ttf +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/BebasNeue-OFL.txt +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/BebasNeue-Regular.ttf +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/DejaVuSans.ttf +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/LICENSE_DEJAVU +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Lato-Bold.ttf +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Lato-OFL.txt +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Poppins-Bold.ttf +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/Poppins-OFL.txt +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/fonts/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/transcription.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/base/video.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/__init__.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/_ass.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/_easing.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/_schema.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/audio_ops.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/operation.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/streaming.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/editing/transforms.py +0 -0
- {videopython-0.55.4 → videopython-0.56.0}/src/videopython/py.typed +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: videopython
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.56.0
|
|
4
|
+
Summary: LLM-friendly Python video editing with JSON plans, local AI, and MCP tools.
|
|
5
5
|
Project-URL: Homepage, https://videopython.com
|
|
6
6
|
Project-URL: Repository, https://github.com/bartwojtowicz/videopython/
|
|
7
7
|
Project-URL: Documentation, https://videopython.com
|
|
8
8
|
Author-email: Bartosz Wójtowicz <bartoszwojtowicz@outlook.com>, Bartosz Rudnikowicz <bartoszrudnikowicz840@gmail.com>, Piotr Pukisz <piotr.pukisz@gmail.com>
|
|
9
9
|
License: Apache-2.0
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Keywords: ai,editing,generation,movie,opencv,python,shorts,video,videopython
|
|
11
|
+
Keywords: ai,ai-agents,editing,ffmpeg,generation,llm,mcp,movie,ollama,opencv,python,shorts,video,video-editing,videopython
|
|
12
12
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -43,7 +43,15 @@ Requires-Dist: transformers>=5.2.0; extra == 'ai'
|
|
|
43
43
|
Requires-Dist: transnetv2-pytorch>=1.0.5; extra == 'ai'
|
|
44
44
|
Requires-Dist: videopython-chatterbox>=0.1.7.post1; extra == 'ai'
|
|
45
45
|
Provides-Extra: mcp
|
|
46
|
+
Requires-Dist: imagehash>=4.3; extra == 'mcp'
|
|
46
47
|
Requires-Dist: mcp<2,>=1.27; extra == 'mcp'
|
|
48
|
+
Requires-Dist: numba>=0.62; extra == 'mcp'
|
|
49
|
+
Requires-Dist: ollama>=0.5.0; extra == 'mcp'
|
|
50
|
+
Requires-Dist: openai-whisper>=20240930; extra == 'mcp'
|
|
51
|
+
Requires-Dist: torch>=2.8.0; extra == 'mcp'
|
|
52
|
+
Requires-Dist: torchvision>=0.23.0; extra == 'mcp'
|
|
53
|
+
Requires-Dist: transformers>=5.2.0; extra == 'mcp'
|
|
54
|
+
Requires-Dist: transnetv2-pytorch>=1.0.5; extra == 'mcp'
|
|
47
55
|
Description-Content-Type: text/markdown
|
|
48
56
|
|
|
49
57
|
# videopython
|
|
@@ -51,20 +59,19 @@ Description-Content-Type: text/markdown
|
|
|
51
59
|
[](https://pypi.org/project/videopython/)
|
|
52
60
|
[](https://pypi.org/project/videopython/)
|
|
53
61
|
[](LICENSE)
|
|
62
|
+
[](https://github.com/BartWojtowicz/videopython/actions/workflows/ci.yml)
|
|
54
63
|
|
|
55
64
|
Minimal, LLM-friendly Python library for programmatic video editing, processing, and AI video workflows.
|
|
56
65
|
|
|
57
66
|
Full documentation: [videopython.com](https://videopython.com)
|
|
58
67
|
|
|
59
|
-
> **Disclaimer:** This project started as a hand-written hobby project, but most of the code is now produced by LLM agents. Humans still drive direction, approve changes, and own design decisions.
|
|
60
|
-
|
|
61
68
|
## Installation
|
|
62
69
|
|
|
63
70
|
```bash
|
|
64
71
|
# Install FFmpeg first (macOS: brew install ffmpeg | Debian: apt-get install ffmpeg)
|
|
65
72
|
pip install videopython # core video/audio editing
|
|
66
73
|
pip install "videopython[ai]" # + ALL local AI features (GPU recommended)
|
|
67
|
-
pip install "videopython[
|
|
74
|
+
pip install "videopython[mcp]" # focused MCP agent-editing stack
|
|
68
75
|
```
|
|
69
76
|
|
|
70
77
|
Python `>=3.11, <3.14`. AI features run locally — no cloud API keys required, but model weights are downloaded on first use. LLM-driven editing and scene captioning use a local [Ollama](https://ollama.com) server (`ollama pull qwen3.6:27b`). See the [install guide](https://videopython.com/install/) for FFmpeg, Ollama, and hardware details.
|
|
@@ -130,6 +137,9 @@ Putting an LLM in the loop works three ways, differing in who owns the model:
|
|
|
130
137
|
2. **`AutoEditor`** — a local Ollama vision model is the planner. [Guide](https://videopython.com/how-to/auto-editing/)
|
|
131
138
|
3. **MCP server** — `videopython-mcp` exposes the pipeline as [Model Context Protocol](https://modelcontextprotocol.io) tools, so an agent like Claude drives editing with its own model. [Guide](https://videopython.com/how-to/mcp-server/)
|
|
132
139
|
|
|
140
|
+
See the [reproducible agent-authored edit demo](https://videopython.com/how-to/agent-edit-demo/)
|
|
141
|
+
for a complete prompt, JSON plan, and rendered result that needs no model or API key.
|
|
142
|
+
|
|
133
143
|
Mode 1 in brief: every operation is a Pydantic model whose fields *are* the JSON wire format, so `VideoEdit.json_schema()` hands your model a ready-made tool schema — a discriminated union over every LLM-exposed op (pass `strict=True` for provider grammar modes). Plans parse permissively and own their numeric bounds at validation, so a refine loop converges fast:
|
|
134
144
|
|
|
135
145
|
- **`edit.check(meta)`** — collect *every* structured error in one pass, not just the first
|
|
@@ -146,7 +156,7 @@ Why it is built this way: [LLM-first design](https://videopython.com/explanation
|
|
|
146
156
|
- **`videopython.ai`** *(install with `[ai]`)* — generation (`TextToVideo`, `ImageToVideo`, `TextToImage`, `TextToSpeech`, `TextToMusic`), understanding (`AudioToText`, `AudioClassifier`, `SceneVLM`, `FaceTracker`, `ObjectDetector`, `SemanticSceneDetector`), the `FaceTrackingCrop` transform, the `ObjectDetectionOverlay` effect, and the full-pipeline `VideoAnalyzer`. Scene captioning and dubbing translation run on a local [Ollama](https://ollama.com) model.
|
|
147
157
|
- **`videopython.ai.auto_edit`** — `AutoEditor` + `OllamaVisionLLM`: plan and render an edit from sources + a one-line brief.
|
|
148
158
|
- **`videopython.ai.dubbing`** — `VideoDubber` for voice-cloned revoicing with timing sync.
|
|
149
|
-
- **`videopython.mcp`** *(install with `[
|
|
159
|
+
- **`videopython.mcp`** *(install with `[mcp]`)* — `videopython-mcp`, an MCP stdio server exposing the auto-edit pipeline so an agent drives editing. The extra includes the analysis and AI editing dependencies, but not generation, dubbing, diarization, source separation, or TTS.
|
|
150
160
|
|
|
151
161
|
## Documentation
|
|
152
162
|
|
|
@@ -162,3 +172,7 @@ The docs follow [Diátaxis](https://diataxis.fr): four sections, each answering
|
|
|
162
172
|
## Development
|
|
163
173
|
|
|
164
174
|
See [`DEVELOPMENT.md`](DEVELOPMENT.md) for local setup, testing, docs, and the release workflow.
|
|
175
|
+
|
|
176
|
+
## Project provenance
|
|
177
|
+
|
|
178
|
+
This project started as a hand-written hobby project, but most of the code is now produced by LLM agents. Humans drive direction, approve changes, and own design decisions.
|
|
@@ -3,20 +3,19 @@
|
|
|
3
3
|
[](https://pypi.org/project/videopython/)
|
|
4
4
|
[](https://pypi.org/project/videopython/)
|
|
5
5
|
[](LICENSE)
|
|
6
|
+
[](https://github.com/BartWojtowicz/videopython/actions/workflows/ci.yml)
|
|
6
7
|
|
|
7
8
|
Minimal, LLM-friendly Python library for programmatic video editing, processing, and AI video workflows.
|
|
8
9
|
|
|
9
10
|
Full documentation: [videopython.com](https://videopython.com)
|
|
10
11
|
|
|
11
|
-
> **Disclaimer:** This project started as a hand-written hobby project, but most of the code is now produced by LLM agents. Humans still drive direction, approve changes, and own design decisions.
|
|
12
|
-
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
15
14
|
```bash
|
|
16
15
|
# Install FFmpeg first (macOS: brew install ffmpeg | Debian: apt-get install ffmpeg)
|
|
17
16
|
pip install videopython # core video/audio editing
|
|
18
17
|
pip install "videopython[ai]" # + ALL local AI features (GPU recommended)
|
|
19
|
-
pip install "videopython[
|
|
18
|
+
pip install "videopython[mcp]" # focused MCP agent-editing stack
|
|
20
19
|
```
|
|
21
20
|
|
|
22
21
|
Python `>=3.11, <3.14`. AI features run locally — no cloud API keys required, but model weights are downloaded on first use. LLM-driven editing and scene captioning use a local [Ollama](https://ollama.com) server (`ollama pull qwen3.6:27b`). See the [install guide](https://videopython.com/install/) for FFmpeg, Ollama, and hardware details.
|
|
@@ -82,6 +81,9 @@ Putting an LLM in the loop works three ways, differing in who owns the model:
|
|
|
82
81
|
2. **`AutoEditor`** — a local Ollama vision model is the planner. [Guide](https://videopython.com/how-to/auto-editing/)
|
|
83
82
|
3. **MCP server** — `videopython-mcp` exposes the pipeline as [Model Context Protocol](https://modelcontextprotocol.io) tools, so an agent like Claude drives editing with its own model. [Guide](https://videopython.com/how-to/mcp-server/)
|
|
84
83
|
|
|
84
|
+
See the [reproducible agent-authored edit demo](https://videopython.com/how-to/agent-edit-demo/)
|
|
85
|
+
for a complete prompt, JSON plan, and rendered result that needs no model or API key.
|
|
86
|
+
|
|
85
87
|
Mode 1 in brief: every operation is a Pydantic model whose fields *are* the JSON wire format, so `VideoEdit.json_schema()` hands your model a ready-made tool schema — a discriminated union over every LLM-exposed op (pass `strict=True` for provider grammar modes). Plans parse permissively and own their numeric bounds at validation, so a refine loop converges fast:
|
|
86
88
|
|
|
87
89
|
- **`edit.check(meta)`** — collect *every* structured error in one pass, not just the first
|
|
@@ -98,7 +100,7 @@ Why it is built this way: [LLM-first design](https://videopython.com/explanation
|
|
|
98
100
|
- **`videopython.ai`** *(install with `[ai]`)* — generation (`TextToVideo`, `ImageToVideo`, `TextToImage`, `TextToSpeech`, `TextToMusic`), understanding (`AudioToText`, `AudioClassifier`, `SceneVLM`, `FaceTracker`, `ObjectDetector`, `SemanticSceneDetector`), the `FaceTrackingCrop` transform, the `ObjectDetectionOverlay` effect, and the full-pipeline `VideoAnalyzer`. Scene captioning and dubbing translation run on a local [Ollama](https://ollama.com) model.
|
|
99
101
|
- **`videopython.ai.auto_edit`** — `AutoEditor` + `OllamaVisionLLM`: plan and render an edit from sources + a one-line brief.
|
|
100
102
|
- **`videopython.ai.dubbing`** — `VideoDubber` for voice-cloned revoicing with timing sync.
|
|
101
|
-
- **`videopython.mcp`** *(install with `[
|
|
103
|
+
- **`videopython.mcp`** *(install with `[mcp]`)* — `videopython-mcp`, an MCP stdio server exposing the auto-edit pipeline so an agent drives editing. The extra includes the analysis and AI editing dependencies, but not generation, dubbing, diarization, source separation, or TTS.
|
|
102
104
|
|
|
103
105
|
## Documentation
|
|
104
106
|
|
|
@@ -114,3 +116,7 @@ The docs follow [Diátaxis](https://diataxis.fr): four sections, each answering
|
|
|
114
116
|
## Development
|
|
115
117
|
|
|
116
118
|
See [`DEVELOPMENT.md`](DEVELOPMENT.md) for local setup, testing, docs, and the release workflow.
|
|
119
|
+
|
|
120
|
+
## Project provenance
|
|
121
|
+
|
|
122
|
+
This project started as a hand-written hobby project, but most of the code is now produced by LLM agents. Humans drive direction, approve changes, and own design decisions.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "videopython"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.56.0"
|
|
4
|
+
description = "LLM-friendly Python video editing with JSON plans, local AI, and MCP tools."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Bartosz Wójtowicz", email = "bartoszwojtowicz@outlook.com" },
|
|
7
7
|
{ name = "Bartosz Rudnikowicz", email = "bartoszrudnikowicz840@gmail.com" },
|
|
@@ -19,7 +19,13 @@ keywords = [
|
|
|
19
19
|
"generation",
|
|
20
20
|
"editing",
|
|
21
21
|
"ai",
|
|
22
|
+
"ai-agents",
|
|
23
|
+
"ffmpeg",
|
|
24
|
+
"llm",
|
|
25
|
+
"mcp",
|
|
26
|
+
"ollama",
|
|
22
27
|
"shorts",
|
|
28
|
+
"video-editing",
|
|
23
29
|
]
|
|
24
30
|
classifiers = [
|
|
25
31
|
"License :: OSI Approved :: Apache Software License",
|
|
@@ -42,7 +48,10 @@ dependencies = [
|
|
|
42
48
|
|
|
43
49
|
[dependency-groups]
|
|
44
50
|
dev = [
|
|
51
|
+
"imagehash>=4.3",
|
|
52
|
+
"mcp>=1.27,<2",
|
|
45
53
|
"pre-commit>=3.8.0",
|
|
54
|
+
"pyloudnorm>=0.1.1",
|
|
46
55
|
"ruff>=0.1.14",
|
|
47
56
|
"mypy>=1.8.0",
|
|
48
57
|
"pytest>=7.4.0",
|
|
@@ -108,8 +117,19 @@ ai = [
|
|
|
108
117
|
# save()/load() through it and it is ABI-coupled to torch.
|
|
109
118
|
"torchcodec>=0.7.0",
|
|
110
119
|
]
|
|
111
|
-
#
|
|
112
|
-
|
|
120
|
+
# Agent-editing pipeline: analysis + AI editing operations, without generation,
|
|
121
|
+
# dubbing, diarization, source separation, or TTS. Pin MCP <2 — v2 is breaking.
|
|
122
|
+
mcp = [
|
|
123
|
+
"mcp>=1.27,<2",
|
|
124
|
+
"openai-whisper>=20240930",
|
|
125
|
+
"numba>=0.62",
|
|
126
|
+
"transnetv2-pytorch>=1.0.5",
|
|
127
|
+
"transformers>=5.2.0",
|
|
128
|
+
"imagehash>=4.3",
|
|
129
|
+
"ollama>=0.5.0",
|
|
130
|
+
"torch>=2.8.0",
|
|
131
|
+
"torchvision>=0.23.0",
|
|
132
|
+
]
|
|
113
133
|
|
|
114
134
|
[project.scripts]
|
|
115
135
|
videopython-mcp = "videopython.mcp.server:main"
|
|
@@ -12,7 +12,7 @@ model API (``https://huggingface.co/api/models/<repo_id>``), i.e. the latest
|
|
|
12
12
|
commit on the repo's ``main`` branch at the time it was captured.
|
|
13
13
|
|
|
14
14
|
Refreshing SHAs:
|
|
15
|
-
For each ``model_id`` in ``MODEL_REVISIONS``
|
|
15
|
+
For each ``model_id`` in ``MODEL_REVISIONS`` and the unpinned list below,
|
|
16
16
|
fetch ``https://huggingface.co/api/models/<model_id>`` and copy the JSON
|
|
17
17
|
``sha`` field into the dict. Bump deliberately -- the whole point of a pin
|
|
18
18
|
is that it does not move on its own. After editing, re-run the AI suite
|
|
@@ -30,7 +30,7 @@ def rms(data: np.ndarray) -> float:
|
|
|
30
30
|
# --- Source-prosody-driven expressiveness (Chatterbox TTS knobs) -----------
|
|
31
31
|
# Source-segment RMS / whole-vocals RMS below CALM lands in the calm bucket;
|
|
32
32
|
# above DRAMATIC in the dramatic bucket; in between gets Chatterbox's defaults.
|
|
33
|
-
#
|
|
33
|
+
# These thresholds were tuned against a representative speech clip.
|
|
34
34
|
CALM_RATIO_THRESHOLD = 0.7
|
|
35
35
|
DRAMATIC_RATIO_THRESHOLD = 1.3
|
|
36
36
|
_CALM = Expressiveness(exaggeration=0.3, cfg_weight=0.7)
|
|
@@ -120,9 +120,7 @@ class TranslatedSegment(BaseModel):
|
|
|
120
120
|
|
|
121
121
|
@model_validator(mode="after")
|
|
122
122
|
def _default_timing_from_segment(self) -> TranslatedSegment:
|
|
123
|
-
#
|
|
124
|
-
# original segment's timing." Preserved so legacy callers (and the
|
|
125
|
-
# dub cache wire format) keep working.
|
|
123
|
+
# Cached records use zero start and end to request the source segment timing.
|
|
126
124
|
if self.start == 0.0 and self.end == 0.0:
|
|
127
125
|
self.start = self.original_segment.start
|
|
128
126
|
self.end = self.original_segment.end
|
|
@@ -40,8 +40,7 @@ class LocalDubbingPipeline:
|
|
|
40
40
|
tts_backend: SpeechBackend | None = None,
|
|
41
41
|
**kwargs: Any,
|
|
42
42
|
):
|
|
43
|
-
# ``
|
|
44
|
-
# kwargs. Either ``config=`` or the flat kwargs are accepted (not both).
|
|
43
|
+
# Either ``config=`` or flat configuration fields are accepted, not both.
|
|
45
44
|
self.config = DubbingConfig.from_args(config, **kwargs)
|
|
46
45
|
# Injected speech backend (a SpeechBackend, e.g. a remote/out-of-process
|
|
47
46
|
# synthesizer). When None, _init_tts lazily constructs the local
|
|
@@ -52,13 +52,11 @@ class FaceTrackingCrop(Operation):
|
|
|
52
52
|
)
|
|
53
53
|
face_index: int = Field(0, ge=0, description='Index of face to track when using ``face_selection="index"``.')
|
|
54
54
|
padding: float = Field(0.3, ge=0, description="Extra space around face (0.3 = 30% padding on each side).")
|
|
55
|
-
vertical_offset: float = Field(
|
|
56
|
-
-0.1, description='Legacy vertical position offset used by ``framing_rule="offset"``.'
|
|
57
|
-
)
|
|
55
|
+
vertical_offset: float = Field(-0.1, description='Vertical position offset used by ``framing_rule="offset"``.')
|
|
58
56
|
framing_rule: Literal["offset", "center", "headroom", "thirds", "dynamic"] = Field(
|
|
59
57
|
"offset",
|
|
60
58
|
description=(
|
|
61
|
-
'Subject framing strategy. "offset":
|
|
59
|
+
'Subject framing strategy. "offset": apply ``vertical_offset``; '
|
|
62
60
|
'"center": keep face centered; "headroom": extra room above the face; '
|
|
63
61
|
'"thirds": face near the upper-third line; "dynamic": currently same as "headroom".'
|
|
64
62
|
),
|
|
@@ -70,7 +68,7 @@ class FaceTrackingCrop(Operation):
|
|
|
70
68
|
"last_position",
|
|
71
69
|
description=(
|
|
72
70
|
'Behavior when no face detected. "center" and "full_frame" both center the crop '
|
|
73
|
-
'
|
|
71
|
+
'while "last_position" holds the last tracked crop.'
|
|
74
72
|
),
|
|
75
73
|
)
|
|
76
74
|
detection_interval: int = Field(3, ge=1, description="Frames between face detections.")
|
|
@@ -156,7 +154,7 @@ class FaceTrackingCrop(Operation):
|
|
|
156
154
|
positions.append((x, y))
|
|
157
155
|
elif self.fallback == "last_position":
|
|
158
156
|
positions.append(last)
|
|
159
|
-
else: # "center" / "full_frame"
|
|
157
|
+
else: # "center" / "full_frame"
|
|
160
158
|
positions.append(default)
|
|
161
159
|
return positions
|
|
162
160
|
|
|
@@ -83,7 +83,7 @@ def _attach_confidence_by_overlap(
|
|
|
83
83
|
"""Stamp Whisper confidence (avg_logprob, no_speech_prob, compression_ratio)
|
|
84
84
|
onto ``target_segments`` from the ``source_segments`` they overlap most with.
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
Re-attaches per-segment confidence after diarization rebuilds segments
|
|
87
87
|
from words and drops the original Whisper-segment metadata. Whisper's
|
|
88
88
|
confidence is window-level, not phoneme-level, so overlap-by-time is the
|
|
89
89
|
right granularity — re-deriving per-word and re-aggregating wouldn't be
|
|
@@ -114,7 +114,8 @@ class AudioToText(ManagedPredictor):
|
|
|
114
114
|
runs before Whisper to gate language detection on a 30s window built from
|
|
115
115
|
voiced regions only — fixes Whisper's tendency to lock onto the wrong
|
|
116
116
|
language when the file opens with silence, music, or non-vocal credits.
|
|
117
|
-
|
|
117
|
+
Set ``enable_vad=False`` to detect language from the leading audio without
|
|
118
|
+
voice-activity gating.
|
|
118
119
|
|
|
119
120
|
Three Whisper decoder kwargs are surfaced for anti-hallucination tuning:
|
|
120
121
|
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"""Temporal understanding for video analysis.
|
|
2
|
-
|
|
3
|
-
Provides ML-based scene detection (TransNetV2). Action recognition was
|
|
4
|
-
removed in 0.29.0 -- it was never wired into ``VideoAnalyzer``.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
1
|
from __future__ import annotations
|
|
8
2
|
|
|
9
3
|
from pathlib import Path
|
|
@@ -101,7 +95,6 @@ class SemanticSceneDetector(ManagedPredictor):
|
|
|
101
95
|
if len(video.frames) == 1:
|
|
102
96
|
return [SceneBoundary(start=0.0, end=video.total_seconds, start_frame=0, end_frame=1)]
|
|
103
97
|
|
|
104
|
-
# Save video to temp file for TransNetV2 processing
|
|
105
98
|
with tempfile.NamedTemporaryFile(suffix=".mp4", delete=True) as tmp:
|
|
106
99
|
video.save(tmp.name)
|
|
107
100
|
return self.detect_streaming(tmp.name)
|
|
@@ -120,7 +113,6 @@ class SemanticSceneDetector(ManagedPredictor):
|
|
|
120
113
|
"""
|
|
121
114
|
self._init_local()
|
|
122
115
|
|
|
123
|
-
# Use TransNetV2's detect_scenes which handles everything internally
|
|
124
116
|
raw_scenes = self._model.detect_scenes(str(path), threshold=self.threshold)
|
|
125
117
|
|
|
126
118
|
# Convert to SceneBoundary objects
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
"""Pure helpers for video dimension math.
|
|
2
|
-
|
|
3
|
-
Centralises the libx264+yuv420p even-dimension constraint and the
|
|
4
|
-
two "round to even" calculations that previously lived (with subtly
|
|
5
|
-
different semantics) in ``base/video.py``, ``ai/transforms.py``, and
|
|
6
|
-
``editing/transforms.py``.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
1
|
from __future__ import annotations
|
|
10
2
|
|
|
11
3
|
|
|
@@ -50,8 +50,7 @@ def probe(path: str | Path, *, extra_args: Sequence[str] | None = None) -> dict[
|
|
|
50
50
|
Args:
|
|
51
51
|
path: Path to the media file.
|
|
52
52
|
extra_args: Optional extra ffprobe flags inserted before ``-print_format``.
|
|
53
|
-
Defaults to ``("-show_streams", "-show_format")`` when omitted
|
|
54
|
-
which mirrors the historical "everything" probe used by Audio.
|
|
53
|
+
Defaults to ``("-show_streams", "-show_format")`` when omitted.
|
|
55
54
|
|
|
56
55
|
Returns:
|
|
57
56
|
The decoded ffprobe JSON payload.
|
|
@@ -646,8 +646,7 @@ class _AnchoredOverlay(Effect):
|
|
|
646
646
|
"""Shared base for anchored RGBA overlays (:class:`TextOverlay`, :class:`ImageOverlay`).
|
|
647
647
|
|
|
648
648
|
Owns anchored placement, off-frame clipping, and alpha blending in one
|
|
649
|
-
``_blend_params`` source of truth
|
|
650
|
-
parity-hole class of bug was fixed in 0.34.1). Subclasses declare their own
|
|
649
|
+
``_blend_params`` source of truth. Subclasses declare their own
|
|
651
650
|
``position``/``anchor`` field defaults and implement
|
|
652
651
|
:meth:`_overlay_for_frame` to produce the RGBA bitmap; everything
|
|
653
652
|
downstream is shared. It declares no ``op`` ``Literal``, so it is an
|
|
@@ -712,9 +711,7 @@ class _AnchoredOverlay(Effect):
|
|
|
712
711
|
) -> tuple[np.ndarray, np.ndarray, tuple[int, int, int, int]] | None:
|
|
713
712
|
"""Placement + blend inputs for the streaming path.
|
|
714
713
|
|
|
715
|
-
|
|
716
|
-
eager/stream parity-hole class of bug was fixed in 0.34.1). Returns
|
|
717
|
-
``None`` when the overlay lands fully off-frame (the effect is a no-op).
|
|
714
|
+
Returns ``None`` when the overlay lands fully off-frame.
|
|
718
715
|
"""
|
|
719
716
|
overlay = self._overlay_for_frame(frame_w, frame_h)
|
|
720
717
|
oh, ow = overlay.shape[:2]
|
|
@@ -265,7 +265,7 @@ class TranscriptionOverlay(Effect):
|
|
|
265
265
|
font_px = self.font_size if self.font_size is not None else max(1, round(self.font_scale * height))
|
|
266
266
|
# libass interprets Fontsize as the GDI cell height (ascender +
|
|
267
267
|
# descender) while PIL sizes the em square; scale by the font's
|
|
268
|
-
# cell/em ratio so font_scale
|
|
268
|
+
# cell/em ratio so font_scale has the same apparent size in both paths
|
|
269
269
|
# (1.5x divergence for a tall display font like Anton without this).
|
|
270
270
|
metrics_font = load_font(self.font_filename or self.font, 100)
|
|
271
271
|
if isinstance(metrics_font, ImageFont.FreeTypeFont):
|
|
@@ -153,7 +153,7 @@ def _resolve_source_context(context: dict[str, Any] | None, source: str) -> dict
|
|
|
153
153
|
``source`` is absent the key is dropped so the consuming op raises its own
|
|
154
154
|
clear "requires ..." error (or surfaces as ``CONTEXT_SOURCE_MISSING`` in
|
|
155
155
|
:meth:`VideoEdit.check`). Any non-dict value is a broadcast value shared by
|
|
156
|
-
every segment and passes through unchanged
|
|
156
|
+
every segment and passes through unchanged.
|
|
157
157
|
"""
|
|
158
158
|
if not context:
|
|
159
159
|
return context
|
|
@@ -184,7 +184,7 @@ def _segment_context(
|
|
|
184
184
|
1. **Per-source resolution** (:func:`_resolve_source_context`): a context
|
|
185
185
|
value may be a per-source ``dict`` keyed by ``str(segment.source)``;
|
|
186
186
|
it collapses to this segment's source. A bare value broadcasts to all
|
|
187
|
-
segments
|
|
187
|
+
segments. This lets a multi-clip plan carry
|
|
188
188
|
``{"transcription": {"a.mp4": tx_a, "b.mp4": tx_b}}`` and feed each
|
|
189
189
|
segment its OWN transcription.
|
|
190
190
|
2. **Re-basing**: a cut segment is decoded 0-based -- its first frame is
|
|
@@ -293,9 +293,8 @@ def _segment_end_exceeds_source(index: int, seg: SegmentConfig, meta: VideoMetad
|
|
|
293
293
|
def _segment_bounds_errors(index: int, seg: SegmentConfig, meta: VideoMetadata) -> list[_LocatedError]:
|
|
294
294
|
"""Every numeric-bound failure of a segment's ``start``/``end``, in order.
|
|
295
295
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
hard ``from_dict`` failure. Order is the raise order for ``validate``:
|
|
296
|
+
A bad range becomes a collectable, repairable :class:`PlanError`. Order is
|
|
297
|
+
the raise order for ``validate``:
|
|
299
298
|
negative ``start``, negative ``end``, ``end <= start``, then ``end`` past
|
|
300
299
|
the source. A segment with any of these cannot be cut, so the caller skips
|
|
301
300
|
its op chain.
|
|
@@ -331,11 +330,10 @@ def _segment_bounds_errors(index: int, seg: SegmentConfig, meta: VideoMetadata)
|
|
|
331
330
|
def _window_errors(op: Operation, duration: float, location: str) -> list[_LocatedError]:
|
|
332
331
|
"""Every bound failure of an :attr:`Effect.window`, in raise order.
|
|
333
332
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
overruns, so the final check stays silent for it (matching ``run_to_file()``).
|
|
333
|
+
Checks negative ``start``, negative ``stop``, ``stop < start``, ``start``
|
|
334
|
+
past duration, and ``stop`` past duration. A ``stop`` clamped to ``duration``
|
|
335
|
+
by ``clamp_windows`` no longer overruns, so the final check stays silent for
|
|
336
|
+
it (matching ``run_to_file()``).
|
|
339
337
|
"""
|
|
340
338
|
if not isinstance(op, Effect) or op.window is None:
|
|
341
339
|
return []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""videopython MCP server: the auto-edit primitives exposed as MCP tools.
|
|
2
2
|
|
|
3
|
-
Run with the ``videopython-mcp`` console script (needs the ``[
|
|
3
|
+
Run with the ``videopython-mcp`` console script (needs the ``[mcp]`` extra).
|
|
4
4
|
The MCP client's own model is the planner; this server only exposes the steps
|
|
5
5
|
(analyze -> catalog -> validate/repair/run over an EditPlan by scene id).
|
|
6
6
|
"""
|
|
@@ -12,6 +12,7 @@ from __future__ import annotations
|
|
|
12
12
|
import json
|
|
13
13
|
import sys
|
|
14
14
|
from contextlib import redirect_stdout
|
|
15
|
+
from importlib import metadata as importlib_metadata
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import TYPE_CHECKING, Any, Literal
|
|
17
18
|
|
|
@@ -30,6 +31,7 @@ if TYPE_CHECKING:
|
|
|
30
31
|
from videopython.base import PlanError, PlanRepair
|
|
31
32
|
|
|
32
33
|
mcp = FastMCP("videopython")
|
|
34
|
+
mcp._mcp_server.version = importlib_metadata.version("videopython")
|
|
33
35
|
|
|
34
36
|
# Session state for one stdio client (one process per client).
|
|
35
37
|
_analyses: dict[str, VideoAnalysis] = {}
|
|
@@ -40,12 +42,13 @@ _MAX_INLINE_KEYFRAMES = 12 # cap inlined keyframes in build_catalog; pull the r
|
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
@mcp.tool()
|
|
43
|
-
def analyze_video(path: str, profile: Literal["full", "editing"] = "
|
|
45
|
+
def analyze_video(path: str, profile: Literal["full", "editing"] = "editing") -> dict[str, Any]:
|
|
44
46
|
"""Analyze a source video (scenes, transcript, captions) and cache it for build_catalog.
|
|
45
47
|
|
|
46
|
-
``profile="editing"`` skips audio classification
|
|
47
|
-
|
|
48
|
-
summary; call this once per source,
|
|
48
|
+
The default ``profile="editing"`` skips audio classification; the catalog
|
|
49
|
+
(captions + transcript + face flag) is unaffected. ``profile="full"`` adds
|
|
50
|
+
audio classification. Returns a short summary; call this once per source,
|
|
51
|
+
then build_catalog.
|
|
49
52
|
"""
|
|
50
53
|
# Heavy analyzer deps (e.g. transnetv2-pytorch) bare-print to stdout, which here is
|
|
51
54
|
# the stdio JSON-RPC channel; send that to stderr so the transport stays clean.
|
|
@@ -174,9 +177,11 @@ def edit_plan_schema() -> str:
|
|
|
174
177
|
|
|
175
178
|
def _get_analyzer(profile: str = "full") -> VideoAnalyzer:
|
|
176
179
|
if profile not in _analyzers:
|
|
177
|
-
from videopython.ai.video_analysis import VideoAnalysisConfig, VideoAnalyzer
|
|
180
|
+
from videopython.ai.video_analysis import AUDIO_TO_TEXT, VideoAnalysisConfig, VideoAnalyzer
|
|
178
181
|
|
|
179
|
-
|
|
182
|
+
config = VideoAnalysisConfig.for_profile(profile)
|
|
183
|
+
config.analyzer_params[AUDIO_TO_TEXT] = {"enable_vad": False}
|
|
184
|
+
_analyzers[profile] = VideoAnalyzer(config=config)
|
|
180
185
|
return _analyzers[profile]
|
|
181
186
|
|
|
182
187
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/understanding/classification.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{videopython-0.55.4 → videopython-0.56.0}/src/videopython/ai/video_analysis/source_metadata.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|