ffmpeg-mcp-studio 0.2.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.
- ffmpeg_mcp_studio-0.2.0/.gitignore +44 -0
- ffmpeg_mcp_studio-0.2.0/LICENSE +21 -0
- ffmpeg_mcp_studio-0.2.0/PKG-INFO +368 -0
- ffmpeg_mcp_studio-0.2.0/README.md +331 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/__init__.py +6 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/assets/__init__.py +0 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/assets/fonts/Montserrat.ttf +0 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/assets/fonts/OFL.txt +93 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/composition/__init__.py +0 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/composition/models.py +138 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/composition/presets.py +201 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/composition/renderer.py +315 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/configs/__init__.py +3 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/configs/logging_config.py +36 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/__init__.py +0 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/beats.py +51 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/captions.py +124 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/formats.py +30 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/loudness.py +38 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/paths.py +64 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/probe.py +67 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/runner.py +78 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/silence.py +42 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/styles.py +39 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/text_render.py +143 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/core/transcribe.py +101 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/__init__.py +0 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/audio.py +53 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/color.py +59 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/reframe.py +37 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/speed.py +96 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/text.py +113 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/effects/zoom.py +57 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/exceptions/__init__.py +3 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/exceptions/build_exception_message.py +24 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/main.py +97 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/__init__.py +63 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/add_background_music.py +64 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/add_captions.py +79 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/add_text_overlay.py +63 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/apply_color_filter.py +38 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/apply_zoom.py +43 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/change_speed.py +40 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/clip_video.py +73 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/compose_video.py +252 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/concat_clips_with_transition.py +114 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/crop_video.py +75 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/detect_beats.py +18 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/export_for_platform.py +80 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/extract_audio.py +45 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/extract_frames.py +118 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/get_video_metadata.py +31 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/make_gif.py +61 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/normalize_video_clips.py +119 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/overlay_image.py +137 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/overlays_video.py +95 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/reframe_video.py +41 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/remove_silences.py +54 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/render_preview.py +67 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/scale_video.py +70 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/transcribe_audio.py +43 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/services/trim_and_concatenate_video.py +137 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/utils/__init__.py +4 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/utils/calculate_video_offset.py +28 -0
- ffmpeg_mcp_studio-0.2.0/ffmpeg_mcp/utils/validate_input_video_path.py +37 -0
- ffmpeg_mcp_studio-0.2.0/pyproject.toml +105 -0
- ffmpeg_mcp_studio-0.2.0/server.json +31 -0
- ffmpeg_mcp_studio-0.2.0/tests/__init__.py +0 -0
- ffmpeg_mcp_studio-0.2.0/tests/conftest.py +62 -0
- ffmpeg_mcp_studio-0.2.0/tests/test_composition.py +108 -0
- ffmpeg_mcp_studio-0.2.0/tests/test_tools.py +124 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Python bytecode
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
*.pdb
|
|
7
|
+
|
|
8
|
+
# Virtualenv
|
|
9
|
+
.venv/
|
|
10
|
+
venv/
|
|
11
|
+
env/
|
|
12
|
+
ENV/
|
|
13
|
+
*.env
|
|
14
|
+
|
|
15
|
+
# Ruff cache
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Jupyter Notebooks
|
|
20
|
+
.ipynb_checkpoints/
|
|
21
|
+
|
|
22
|
+
# IDEs
|
|
23
|
+
.vscode/
|
|
24
|
+
.idea/
|
|
25
|
+
|
|
26
|
+
# OS generated files
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Logs
|
|
31
|
+
*.log
|
|
32
|
+
|
|
33
|
+
# Tests
|
|
34
|
+
tests/.pytest_cache/
|
|
35
|
+
|
|
36
|
+
# Notebooks
|
|
37
|
+
notebooks/
|
|
38
|
+
|
|
39
|
+
# Experiments
|
|
40
|
+
*/experiments/
|
|
41
|
+
*processed_elements/
|
|
42
|
+
# Build artifacts
|
|
43
|
+
dist/
|
|
44
|
+
build/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 yubraaj11
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ffmpeg-mcp-studio
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: AI video editor MCP server powered by FFmpeg: auto captions, Instagram Reels / YouTube Shorts / TikTok formatting, beat-synced cuts, jump cuts, transitions, music and one-call video production for Claude, Cursor and any MCP client.
|
|
5
|
+
Project-URL: Homepage, https://github.com/yubraaj11/ffmpeg-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/yubraaj11/ffmpeg-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/yubraaj11/ffmpeg-mcp/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/yubraaj11/ffmpeg-mcp#readme
|
|
9
|
+
Author: yubraaj11
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai-agents,ai-video-editor,auto-captions,beat-sync,claude,claude-desktop,content-creation,cursor,fastmcp,ffmpeg,instagram-reels,jump-cut,llm,mcp,mcp-server,model-context-protocol,short-form-video,speech-to-text,subtitles,tiktok,video-automation,video-editing,video-editor,whisper,youtube-shorts
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
22
|
+
Classifier: Topic :: Multimedia :: Video
|
|
23
|
+
Classifier: Topic :: Multimedia :: Video :: Conversion
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
25
|
+
Requires-Python: >=3.12
|
|
26
|
+
Requires-Dist: colorlog>=6.9.0
|
|
27
|
+
Requires-Dist: faster-whisper>=1.2.1
|
|
28
|
+
Requires-Dist: fastmcp>=2.11.3
|
|
29
|
+
Requires-Dist: ffmpeg-python>=0.2.0
|
|
30
|
+
Requires-Dist: librosa>=1.0.1
|
|
31
|
+
Requires-Dist: numpy>=2.5.5
|
|
32
|
+
Requires-Dist: pillow>=13.0.0
|
|
33
|
+
Requires-Dist: pydantic>=2.11.7
|
|
34
|
+
Requires-Dist: soundfile>=0.14.0
|
|
35
|
+
Requires-Dist: tqdm>=4.67.1
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
# ffmpeg-mcp 🎬⚡
|
|
43
|
+
|
|
44
|
+
**The AI video editor for Claude, Cursor and every MCP client. Edit, caption and produce videos just by asking.**
|
|
45
|
+
|
|
46
|
+
`ffmpeg-mcp` is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that turns **FFmpeg** into an AI video editing toolkit your LLM can drive. It covers **automatic captions and subtitles** (local Whisper speech-to-text), **Instagram Reels, YouTube Shorts and TikTok** formatting, **beat-synced montages**, **jump cuts**, punch-in zooms, speed ramps, transitions, colour grading, background music with ducking, and **one-call video production** from raw clips to an upload-ready MP4. It also has the classic tools: clip, crop, scale, overlay, concatenate, extract frames and audio, and make GIFs. No command-line flags to memorize.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uvx ffmpeg-mcp-studio # that's it - add it to your MCP client (see Quick Start)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/ffmpeg-mcp-studio/)
|
|
53
|
+
[](https://github.com/yubraaj11/ffmpeg-mcp/actions/workflows/ci.yml)
|
|
54
|
+
[](https://github.com/yubraaj11/ffmpeg-mcp/blob/main/LICENSE)
|
|
55
|
+
[](https://modelcontextprotocol.io)
|
|
56
|
+
[](https://www.python.org/)
|
|
57
|
+
[](https://github.com/jlowin/fastmcp)
|
|
58
|
+
[](https://ffmpeg.org/)
|
|
59
|
+
[](#-contributing)
|
|
60
|
+
[](https://github.com/yubraaj11/ffmpeg-mcp)
|
|
61
|
+
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- mcp-name: io.github.yubraaj11/ffmpeg-mcp -->
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## ✨ Why ffmpeg-mcp?
|
|
69
|
+
|
|
70
|
+
FFmpeg is incredibly powerful and incredibly hard to remember. `ffmpeg-mcp` hands that power to your AI assistant so you can say what you want in plain English:
|
|
71
|
+
|
|
72
|
+
> *"Grab the first 10 seconds of `demo.mov`, scale it to 1080p, slap my logo in the top-right corner, and turn it into a GIF."*
|
|
73
|
+
|
|
74
|
+
…and the model orchestrates the right tools for you. Each tool is a small, validated Python function — easy to read, reuse, and extend.
|
|
75
|
+
|
|
76
|
+
- 🗣️ **Natural-language video editing** — works in any MCP client (Claude Desktop, Cursor, Cline, …)
|
|
77
|
+
- 🎞️ **Creator editing** — Reels/Shorts reframing, word-by-word animated captions, titles, punch-in zooms, speed ramps, beat-synced cuts, jump cuts, colour looks and ducked music
|
|
78
|
+
- 🎬 **Full video production** — one declarative timeline (or a one-call preset) renders a finished, upload-ready video
|
|
79
|
+
- 🧱 **29 focused tools** — composable building blocks instead of one giant black box
|
|
80
|
+
- ✅ **Input validation built in** — paths are checked for existence, emptiness, and validity before FFmpeg runs
|
|
81
|
+
- 🧩 **Hackable** — add a new tool by writing one function and registering it
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 🎯 Use Cases
|
|
86
|
+
|
|
87
|
+
- **Talking-head Reels & Shorts**: vertical crop, karaoke-style animated captions, punch-in zooms and automatic jump cuts from one recording.
|
|
88
|
+
- **Beat-synced montages**: travel, event and product clips cut exactly on the beat of your song.
|
|
89
|
+
- **Podcast & interview clips**: transcribe, cut highlights, burn in subtitles and export for every platform.
|
|
90
|
+
- **Product promos & ads**: titles, logo watermark, colour look, music and transitions in one timeline.
|
|
91
|
+
- **Batch content repurposing**: turn landscape YouTube footage into 9:16 TikTok/Reels/Shorts with blurred-background fill.
|
|
92
|
+
- **Everyday FFmpeg chores**: trim, crop, scale, GIFs, frame grabs and audio extraction, by just asking.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🛠️ Available Tools
|
|
97
|
+
|
|
98
|
+
| Tool | What it does | Key parameters |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| `get_video_metadata` | Probe a file for streams, codecs, duration, etc. | `input_video_path` |
|
|
101
|
+
| `extract_frames` | Save frames as images (evenly, by interval, or 1/sec) | `input_video_path`, `number_of_frames?`, `timestamp_offset?` |
|
|
102
|
+
| `extract_audio` | Pull audio out to a `.wav` file | `input_video_path` |
|
|
103
|
+
| `scale_video` | Upscale to `1080p` / `2k` / `4k`, aspect-preserving | `input_video_path`, `resolution="1080p"` |
|
|
104
|
+
| `crop_video` | Crop to a region | `input_video_path`, `width`, `height`, `x_offset`, `y_offset`, `safe_crop` |
|
|
105
|
+
| `clip_video` | Cut a sub-clip by start + duration | `input_video_path`, `start_timestamp`, `duration` |
|
|
106
|
+
| `make_gif` | Turn a segment into an optimized GIF | `input_video_path`, `start_timestamp`, `duration` |
|
|
107
|
+
| `overlay_image` | Composite an image (logo/watermark) with timing & opacity | `input_video_path`, `overlay_image_path`, `positioning`, `opacity`, `start_time`, `duration` |
|
|
108
|
+
| `overlays_video` | Overlay a (looping) video onto another | `input_video_path`, `overlay_video_path`, `positioning`, `scale` |
|
|
109
|
+
| `trim_and_concat_operation` | Trim multiple clips and stitch them together | `inputs: [{path, start_time?, end_time?}]`, `width`, `height` |
|
|
110
|
+
| `get_normalized_clips` | Normalize clips to a common res/fps/codec (in parallel) | `input_video_clips`, `resolution`, `frame_rate`, `crf` |
|
|
111
|
+
| `concat_clips_with_transition` | Concatenate clips with an `xfade` transition | `input_video_clips`, `transition_type="fade"`, `transition_duration` |
|
|
112
|
+
|
|
113
|
+
> `?` marks optional parameters. `concat_clips_with_transition` supports many transitions — `fade`, `wipeleft`, `slideup`, `circlecrop`, `dissolve`, `pixelize`, `radial`, and [dozens more](https://trac.ffmpeg.org/wiki/Xfade).
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### 🎞️ Creator editing tools
|
|
117
|
+
|
|
118
|
+
| Tool | What it does | Key parameters |
|
|
119
|
+
| --- | --- | --- |
|
|
120
|
+
| `reframe_video` | Convert to 9:16 / 1:1 / 4:5 / 16:9 | `target_format`, `mode` (`crop` / `blur_fill` / `pad`), `focus_x?`, `focus_y?` |
|
|
121
|
+
| `add_text_overlay` | Styled, auto-wrapped title or label with an animation | `text`, `start_time`, `duration?`, `style`, `position`, `animation` |
|
|
122
|
+
| `transcribe_audio` | Local speech-to-text with word timestamps (faster-whisper) → `.json` + `.srt` | `input_media_path`, `model_size="base"`, `language?` |
|
|
123
|
+
| `add_captions` | Burned-in word-synced captions (karaoke highlight, one word at a time, phrases) | `style`, `mode`, `words_per_line`, `transcript_path?` |
|
|
124
|
+
| `change_speed` | Constant speed, slow-mo segments or gradual speed ramps (pitch preserved) | `speed?` or `speed_ramp: [{start, end, speed \| speed_start+speed_end}]` |
|
|
125
|
+
| `apply_zoom` | Punch-in zooms and ken-burns push | `zooms: [{start, end, zoom, center_x, center_y, ease}]`, `ken_burns?` |
|
|
126
|
+
| `apply_color_filter` | Looks: `warm`, `cool`, `vintage`, `bw`, `vivid`, `cinematic`, `matte`, `moody`, or a `.cube` LUT | `preset?`, `lut_path?`, `intensity` |
|
|
127
|
+
| `add_background_music` | Music bed that loops/trims, fades and auto-ducks under speech | `music_path`, `volume`, `duck_voice`, `start_offset`, `replace_audio` |
|
|
128
|
+
| `detect_beats` | Tempo, beat and downbeat times of a song | `audio_path`, `start_offset?` |
|
|
129
|
+
| `remove_silences` | Jump-cut out pauses and dead air | `noise_db`, `min_silence`, `padding` |
|
|
130
|
+
| `export_for_platform` | Upload-ready file: right size, H.264/AAC, fast-start, −14 LUFS | `platform` (`instagram_reel`, `tiktok`, `youtube_shorts`, …) |
|
|
131
|
+
| `render_preview` | Contact sheet of timestamped thumbnails to check an edit | `number_of_frames`, `timestamps?` |
|
|
132
|
+
|
|
133
|
+
### 🎬 Full video production
|
|
134
|
+
|
|
135
|
+
| Tool | What it does |
|
|
136
|
+
| --- | --- |
|
|
137
|
+
| `get_editing_capabilities` | Lists every format, platform, style, colour preset, transition and position the tools accept |
|
|
138
|
+
| `render_composition` | Renders a whole edit from a JSON timeline: per-clip trim → speed → reframe → zoom → colour, joined with transitions, then captions, titles, logos, music and platform export. `dry_run=true` returns the resolved timeline without rendering |
|
|
139
|
+
| `make_reel_from_clips` | One call: videos/photos → captioned, titled, transitioned 9:16 Reel with music |
|
|
140
|
+
| `beat_sync_montage` | One call: cuts between clips exactly on the song's beats, with pulse zooms on downbeats |
|
|
141
|
+
| `talking_head_reel` | One call: talking-to-camera recording → vertical crop, karaoke captions, punch-ins, optional jump cuts, ducked music |
|
|
142
|
+
|
|
143
|
+
Example `render_composition` spec:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"format": "reel",
|
|
148
|
+
"clips": [
|
|
149
|
+
{"path": "/videos/hook.mp4", "end": 4, "zoom": [{"start": 1.5, "end": 4, "zoom": 1.2, "ease": "snap"}]},
|
|
150
|
+
{"path": "/videos/broll.mp4", "start": 2, "end": 6, "speed_ramp": [{"start": 1, "end": 3, "speed": 0.4}], "color": "cinematic"},
|
|
151
|
+
{"path": "/photos/product.jpg", "image_duration": 2.5, "transition_in": {"type": "slideup", "duration": 0.3}}
|
|
152
|
+
],
|
|
153
|
+
"default_transition": {"type": "fade", "duration": 0.4},
|
|
154
|
+
"text_overlays": [{"text": "3 editing tricks", "start": 0, "duration": 2.5, "style": "title", "animation": "slide_up"}],
|
|
155
|
+
"image_overlays": [{"path": "/brand/logo.png", "position": "top_right", "width": 160, "opacity": 0.9}],
|
|
156
|
+
"captions": {"style": "karaoke", "mode": "phrase_highlight"},
|
|
157
|
+
"music": {"path": "/music/track.mp3", "volume": 0.25, "duck": true},
|
|
158
|
+
"export": {"platform": "instagram_reel"}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Times: clip `start`/`end` and `speed_ramp` are in source seconds; `zoom` is in seconds within the clip's output; text/image overlays are on the final timeline. Auto-generated transcripts are saved to the `transcripts/` folder in the output directory. Fix any misheard words in the JSON and pass it back as `captions.transcript_path`.
|
|
163
|
+
|
|
164
|
+
> Text and captions are rendered with Pillow using the bundled [Montserrat](https://github.com/yubraaj11/ffmpeg-mcp/blob/main/ffmpeg_mcp/assets/fonts/OFL.txt) font, so they work even on FFmpeg builds without `libass`/`freetype`. The first caption run downloads the faster-whisper model (~145 MB for `base`).
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 📦 Requirements
|
|
169
|
+
|
|
170
|
+
- **Python 3.12+**
|
|
171
|
+
- **[FFmpeg](https://ffmpeg.org/download.html)** installed and on your `PATH` (provides `ffmpeg` + `ffprobe`)
|
|
172
|
+
- **[uv](https://docs.astral.sh/uv/)** package manager
|
|
173
|
+
|
|
174
|
+
Verify FFmpeg is available:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
ffmpeg -version
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🚀 Quick Start
|
|
183
|
+
|
|
184
|
+
### Option A: run with `uvx` (recommended)
|
|
185
|
+
|
|
186
|
+
No clone needed. [`uvx`](https://docs.astral.sh/uv/guides/tools/) downloads and runs the server in an isolated environment:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
uvx ffmpeg-mcp-studio
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Add it to your MCP client:
|
|
193
|
+
|
|
194
|
+
<details open>
|
|
195
|
+
<summary><b>Claude Desktop / Cursor / Windsurf</b> (<code>claude_desktop_config.json</code>, <code>.cursor/mcp.json</code>, ...)</summary>
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"mcpServers": {
|
|
200
|
+
"ffmpeg-mcp": {
|
|
201
|
+
"command": "uvx",
|
|
202
|
+
"args": ["ffmpeg-mcp-studio"],
|
|
203
|
+
"env": { "FFMPEG_MCP_OUTPUT_DIR": "/Users/you/Movies/ffmpeg-mcp" }
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
</details>
|
|
210
|
+
|
|
211
|
+
<details>
|
|
212
|
+
<summary><b>Claude Code</b></summary>
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
claude mcp add ffmpeg-mcp -- uvx ffmpeg-mcp-studio
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
</details>
|
|
219
|
+
|
|
220
|
+
<details>
|
|
221
|
+
<summary><b>Cline</b> (VS Code)</summary>
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"mcpServers": {
|
|
226
|
+
"ffmpeg-mcp": {
|
|
227
|
+
"command": "uvx",
|
|
228
|
+
"args": ["ffmpeg-mcp-studio"],
|
|
229
|
+
"timeout": 600,
|
|
230
|
+
"transportType": "stdio"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
</details>
|
|
237
|
+
|
|
238
|
+
To run the latest unreleased code straight from GitHub: `uvx --from git+https://github.com/yubraaj11/ffmpeg-mcp ffmpeg-mcp-studio`. You can also `pip install ffmpeg-mcp-studio` and run `ffmpeg-mcp-studio`.
|
|
239
|
+
|
|
240
|
+
### Option B: run from source (for development)
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
git clone https://github.com/yubraaj11/ffmpeg-mcp.git
|
|
244
|
+
cd ffmpeg-mcp
|
|
245
|
+
uv sync --frozen
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"mcpServers": {
|
|
251
|
+
"ffmpeg-mcp": {
|
|
252
|
+
"command": "uv",
|
|
253
|
+
"args": ["--directory", "/path/to/ffmpeg-mcp", "run", "ffmpeg-mcp-studio"]
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Where outputs go
|
|
260
|
+
|
|
261
|
+
| Setting | Output folder |
|
|
262
|
+
| --- | --- |
|
|
263
|
+
| `FFMPEG_MCP_OUTPUT_DIR` env var set | that folder |
|
|
264
|
+
| Installed via `uvx` / `pip` | `~/ffmpeg-mcp-output/` |
|
|
265
|
+
| Running from a source checkout | `ffmpeg_mcp/processed_elements/` |
|
|
266
|
+
|
|
267
|
+
> Long renders (captions, full compositions) can take a minute or more. If your client has a tool timeout, raise it (e.g. `"timeout": 600` in Cline).
|
|
268
|
+
|
|
269
|
+
### Restart your client and start editing
|
|
270
|
+
|
|
271
|
+
> *"Extract 5 evenly-spaced frames from `intro.mp4`."*
|
|
272
|
+
>
|
|
273
|
+
> *"Make a 3-second GIF from `clip.mov` starting at 12s."*
|
|
274
|
+
>
|
|
275
|
+
> *"Concatenate `a.mp4`, `b.mp4`, and `c.mp4` with a 1-second `wipeleft` transition between them."*
|
|
276
|
+
>
|
|
277
|
+
> *"Turn `talk.mov` into a Reel with karaoke captions, cut out the pauses, and put `lofi.mp3` quietly underneath."*
|
|
278
|
+
>
|
|
279
|
+
> *"Make a 15-second beat-synced montage of everything in `~/trip/` to `song.mp3`, starting at the drop at 0:42."*
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 🧰 Project Layout
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
ffmpeg_mcp/
|
|
287
|
+
├── main.py # MCP server entry point — registers all tools
|
|
288
|
+
├── services/ # one module per tool
|
|
289
|
+
├── core/ # paths, probing, ffmpeg runner, text rendering, styles, transcription, beats
|
|
290
|
+
├── effects/ # reusable filter builders: reframe, speed, zoom, color, audio, text
|
|
291
|
+
├── composition/ # timeline models, multi-stage renderer, preset recipes
|
|
292
|
+
├── utils/ # validation decorators & helpers
|
|
293
|
+
├── assets/fonts/ # bundled OFL font for titles and captions
|
|
294
|
+
├── configs/ # colored logging setup
|
|
295
|
+
└── exceptions/ # structured error messages
|
|
296
|
+
tests/ # pytest suite on synthetic media
|
|
297
|
+
server.json # MCP Registry manifest
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Single-effect tools and the composition renderer share the same filter builders in `effects/`, so each effect has a single implementation.
|
|
301
|
+
|
|
302
|
+
Every tool returns either the output file path or a structured JSON error (`status`, `error_type`, `message`, `time`), so failures are easy for the model to read and recover from.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## ❓ FAQ
|
|
307
|
+
|
|
308
|
+
**How do I add automatic captions or subtitles to a video with Claude?**
|
|
309
|
+
Install the server, then ask: *"Add karaoke captions to `/path/talk.mp4`"*. It transcribes locally with Whisper (`add_captions`) and burns in word-synced captions. Use `transcribe_audio` if you only want an `.srt` file.
|
|
310
|
+
|
|
311
|
+
**Can it make Instagram Reels, YouTube Shorts or TikToks?**
|
|
312
|
+
Yes. `make_reel_from_clips`, `talking_head_reel` and `beat_sync_montage` output 1080×1920 videos, and `export_for_platform` produces upload-ready files (H.264/AAC, fast-start, −14 LUFS) for `instagram_reel`, `tiktok`, `youtube_shorts` and more.
|
|
313
|
+
|
|
314
|
+
**Does it upload my videos anywhere?**
|
|
315
|
+
No. Everything, including speech-to-text, runs locally with FFmpeg. Only the Whisper model is downloaded once from Hugging Face.
|
|
316
|
+
|
|
317
|
+
**Which MCP clients does it work with?**
|
|
318
|
+
Any client that supports stdio MCP servers: Claude Desktop, Claude Code, Cursor, Windsurf, Cline, Continue, Zed and others.
|
|
319
|
+
|
|
320
|
+
**Do I need FFmpeg installed?**
|
|
321
|
+
Yes. Install `ffmpeg` (which includes `ffprobe`) and make sure it is on your `PATH` (`brew install ffmpeg`, `apt install ffmpeg`, or `winget install ffmpeg`).
|
|
322
|
+
|
|
323
|
+
**Is it an alternative to CapCut or Instagram Edits?**
|
|
324
|
+
It covers many of the same creator features (captions, beat sync, speed ramps, zooms, transitions, music), driven by your AI assistant and scriptable through a JSON timeline instead of a GUI.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 🤝 Contributing
|
|
329
|
+
|
|
330
|
+
Contributions are very welcome! Adding a tool is roughly:
|
|
331
|
+
|
|
332
|
+
1. Write a function in `ffmpeg_mcp/services/your_tool.py`.
|
|
333
|
+
2. Export it from `ffmpeg_mcp/services/__init__.py`.
|
|
334
|
+
3. Register it in `main.py` with `mcp.tool(name_or_fn=your_tool)`.
|
|
335
|
+
|
|
336
|
+
Please run the linter and tests before opening a PR:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
uv run ruff check .
|
|
340
|
+
uv run pytest
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Releasing (maintainers)
|
|
344
|
+
|
|
345
|
+
1. Bump `version` in `pyproject.toml` and both `version` fields in `server.json`.
|
|
346
|
+
2. Merge to `main`, then tag: `git tag v0.2.0 && git push origin v0.2.0`.
|
|
347
|
+
3. The **Release** workflow checks the versions match, builds, publishes to PyPI (using the `PYPI_API_TOKEN` secret) and then to the MCP Registry.
|
|
348
|
+
|
|
349
|
+
Found a bug or have an idea? [Open an issue](https://github.com/yubraaj11/ffmpeg-mcp/issues) — and if this project saves you from another `ffmpeg` man-page dive, consider leaving a ⭐.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## 📄 License
|
|
354
|
+
|
|
355
|
+
[MIT](https://github.com/yubraaj11/ffmpeg-mcp/blob/main/LICENSE). The bundled Montserrat font is licensed under the [SIL Open Font License](https://github.com/yubraaj11/ffmpeg-mcp/blob/main/ffmpeg_mcp/assets/fonts/OFL.txt).
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## 📚 Built With
|
|
360
|
+
|
|
361
|
+
- [`fastmcp`](https://github.com/jlowin/fastmcp) — the MCP server framework
|
|
362
|
+
- [`ffmpeg-python`](https://github.com/kkroening/ffmpeg-python) — Python bindings for FFmpeg
|
|
363
|
+
- [`pydantic`](https://docs.pydantic.dev/) — data validation
|
|
364
|
+
- [`colorlog`](https://github.com/borntyping/python-colorlog) — colored logs
|
|
365
|
+
- [`faster-whisper`](https://github.com/SYSTRAN/faster-whisper) — local speech-to-text for captions
|
|
366
|
+
- [`librosa`](https://librosa.org/) — beat tracking
|
|
367
|
+
- [`Pillow`](https://python-pillow.org/) — title and caption rendering
|
|
368
|
+
</content>
|