vectcut-api

2
0
Source

VectCutAPI is a powerful cloud-based video editing API tool that provides programmatic control over CapCut/JianYing (剪映) for professional video editing. Use this skill when users need to: (1) Create video draft projects programmatically, (2) Add video/audio/image materials with precise control, (3) Add text, subtitles, and captions, (4) Apply effects, transitions, and animations, (5) Add keyframe animations, (6) Process videos in batch, (7) Generate AI-powered videos, (8) Integrate with n8n workflows, (9) Build MCP video editing agents. The API supports HTTP REST and MCP protocols, works with both CapCut (international) and JianYing (China), and provides web preview without downloading.

Install

mkdir -p .claude/skills/vectcut-api && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3354" && unzip -o skill.zip -d .claude/skills/vectcut-api && rm skill.zip

Installs to .claude/skills/vectcut-api

About this skill

VectCutAPI 视频剪辑 API

概述

VectCutAPI 是一款强大的云端视频剪辑 API 工具,通过编程方式控制剪映/CapCut 进行专业视频编辑。它填补了 AI 生成素材与专业视频编辑之间的空白,提供精确的编辑控制能力。

核心优势

  1. 双协议支持 - HTTP REST API 和 MCP 协议
  2. 实时预览 - 网页预览无需下载
  3. 可二次编辑 - 导入剪映/CapCut 精修
  4. 云端处理 - 全云端操作生成视频

系统要求

  • Python 3.10+
  • 剪映 或 CapCut 国际版
  • FFmpeg (可选,用于某些视频处理)

快速启动

# 安装依赖
pip install -r requirements.txt      # HTTP API 基础依赖
pip install -r requirements-mcp.txt  # MCP 协议支持 (可选)

# 配置文件
cp config.json.example config.json

# 启动服务
python capcut_server.py  # HTTP API 服务器 (端口: 9001)
python mcp_server.py     # MCP 协议服务器

工作流程

标准视频制作流程

1. 创建草稿 (create_draft)
   - 设置分辨率: 1080x1920 (竖屏) / 1920x1080 (横屏) / 1080x1080 (方形)
   - 获取 draft_id

2. 添加素材轨道
   - add_video: 添加视频轨道
   - add_audio: 添加音频轨道
   - add_image: 添加图片素材

3. 添加文字元素
   - add_text: 添加标题、说明文字
   - add_subtitle: 导入 SRT 字幕文件

4. 应用特效
   - add_effect: 添加视频特效
   - add_sticker: 添加贴纸素材
   - add_video_keyframe: 添加关键帧动画

5. 保存草稿
   - save_draft: 生成可导入剪映的草稿文件

AI 视频生成工作流

AI 文案生成
    ↓
TTS 文字转语音 → audio_url
    ↓
图生视频 → video_url
    ↓
VectCutAPI 组合草稿
    ↓
导出或二次编辑

批量视频处理

使用 auto_video_editor.py 处理 Excel 表格驱动的批量视频制作。

API 接口

核心操作

接口方法功能
/create_draftPOST创建新草稿项目
/save_draftPOST保存草稿并生成 URL
/query_draft_statusPOST查询草稿状态
/query_scriptPOST查询草稿脚本内容
/generate_draft_urlPOST生成草稿预览 URL

素材添加

接口方法功能
/add_videoPOST添加视频轨道
/add_audioPOST添加音频轨道
/add_imagePOST添加图片素材
/add_textPOST添加文字元素
/add_subtitlePOST添加 SRT 字幕
/add_stickerPOST添加贴纸
/add_effectPOST添加视频特效
/add_video_keyframePOST添加关键帧动画

查询接口 (GET)

接口功能
/get_intro_animation_types获取入场动画类型
/get_outro_animation_types获取出场动画类型
/get_transition_types获取转场效果类型
/get_mask_types获取蒙版类型列表
/get_audio_effect_types获取音频特效类型
/get_font_types获取字体类型列表
/get_video_scene_effect_types获取场景特效类型

使用示例

创建竖屏视频草稿

import requests

# 1. 创建草稿
response = requests.post("http://localhost:9001/create_draft", json={
    "width": 1080,
    "height": 1920
})
draft_id = response.json()["output"]["draft_id"]

# 2. 添加背景视频
requests.post("http://localhost:9001/add_video", json={
    "draft_id": draft_id,
    "video_url": "https://example.com/background.mp4",
    "start": 0,
    "end": 10,
    "volume": 0.6
})

# 3. 添加标题文字
requests.post("http://localhost:9001/add_text", json={
    "draft_id": draft_id,
    "text": "欢迎使用 VectCutAPI",
    "start": 1,
    "end": 5,
    "font_size": 56,
    "font_color": "#FFD700",
    "shadow_enabled": True,
    "background_color": "#000000"
})

# 4. 保存草稿
response = requests.post("http://localhost:9001/save_draft", json={
    "draft_id": draft_id
})
draft_url = response.json()["output"]["draft_url"]
print(f"草稿已保存: {draft_url}")

添加转场效果

requests.post("http://localhost:9001/add_video", json={
    "draft_id": draft_id,
    "video_url": "https://example.com/video2.mp4",
    "transition": "fade_in",           # 转场类型
    "transition_duration": 0.5,        # 转场时长(秒)
    "target_start": 10                 # 在时间轴 10 秒处开始
})

添加关键帧动画

requests.post("http://localhost:9001/add_video_keyframe", json={
    "draft_id": draft_id,
    "track_name": "video_main",
    "property_types": ["scale_x", "scale_y", "alpha"],
    "times": [0, 2, 4],          # 关键帧时间点
    "values": ["1.0", "1.2", "0.8"]  # 对应属性值
})

添加 SRT 字幕

requests.post("http://localhost:9001/add_subtitle", json={
    "draft_id": draft_id,
    "srt_url": "https://example.com/subtitles.srt",
    "font_size": 32,
    "font_color": "#FFFFFF",
    "background_alpha": 0.7
})

MCP 协议集成

VectCutAPI 支持 MCP (Model Context Protocol) 协议,可直接由 AI Agent 调用。

MCP 工具列表

工具名称功能描述
create_draft创建新的视频草稿项目
add_video添加视频到草稿
add_audio添加音频到草稿
add_image添加图片素材
add_text添加文字元素
add_subtitle添加字幕文件
add_effect添加视觉特效
add_sticker添加贴纸元素
add_video_keyframe添加关键帧动画
get_video_duration获取视频时长
save_draft保存草稿项目

MCP 客户端配置

创建 mcp_config.json:

{
  "mcpServers": {
    "vectcut-api": {
      "command": "python",
      "args": ["mcp_server.py"],
      "cwd": "H:/ComfyUI/web/VectCutAPI",
      "env": {
        "PYTHONPATH": "H:/ComfyUI/web/VectCutAPI",
        "DEBUG": "0"
      }
    }
  }
}

参数说明

视频参数 (add_video)

参数类型默认值说明
draft_idstring必需草稿 ID
video_urlstring必需视频 URL
startfloat0视频开始时间(秒)
endfloat0视频结束时间(秒)
target_startfloat0在时间轴上的开始时间
speedfloat1.0播放速度
volumefloat1.0音量 (0-1)
scale_x/scale_yfloat1.0缩放比例
transform_x/transform_yfloat0位置偏移
transitionstring-转场类型
transition_durationfloat0.5转场时长(秒)
mask_typestring-蒙版类型
background_blurint-背景模糊级别(1-4)

文字参数 (add_text)

参数类型默认值说明
textstring必需文字内容
startfloat必需开始时间
endfloat必需结束时间
fontstring"思源黑体"字体名称
font_sizeint32字体大小
font_colorstring"#FFFFFF"字体颜色 (HEX)
stroke_enabledboolFalse是否启用描边
stroke_colorstring"#FFFFFF"描边颜色
stroke_widthfloat2.0描边宽度
shadow_enabledboolFalse是否启用阴影
shadow_colorstring"#000000"阴影颜色
background_colorstring-背景颜色
background_alphafloat1.0背景透明度
text_stylesarray-多样式文字 (见下方)

多样式文字 (text_styles)

"text_styles": [
    {"start": 0, "end": 2, "font_color": "#FF6B6B"},
    {"start": 2, "end": 4, "font_color": "#4ECDC4"},
    {"start": 4, "end": 6, "font_color": "#45B7D1"}
]

配置文件

config.json 结构

{
  "is_capcut_env": true,
  "draft_domain": "https://www.capcutapi.top",
  "port": 9001,
  "preview_router": "/draft/downloader",
  "is_upload_draft": false,
  "oss_config": {
    "bucket_name": "your-bucket",
    "access_key_id": "your-key-id",
    "access_key_secret": "your-secret",
    "endpoint": "https://your-endpoint.aliyuncs.com"
  }
}

高级功能

批量视频处理

使用 auto_video_editor.py 进行 Excel 驱动的批量处理:

python auto_video_editor.py input.xlsx

Excel 表格格式:

视频标题二段文案开头素材结尾素材封面素材
产品介绍...video1.mp4video2.mp4image.png

n8n 工作流集成

项目包含多个预配置的 n8n 工作流:

  • text-to-video-with-animation.json - 文字转视频工作流
  • auto-video-mixing.json - 自动视频混剪
  • form-upload-processing.json - 表单上传处理

资源

scripts/

可执行脚本,用于 VectCutAPI 操作。

  • vectcut_client.py - Python 客户端封装库

references/

参考文档和指南。

  • api_reference.md - 完整 API 接口参考
  • workflows.md - 工作流示例和最佳实践
  • animation_types.md - 动画类型参考
  • transition_types.md - 转场效果类型参考

assets/examples/

示例代码和模板。

  • basic_video.py - 基础视频制作示例
  • text_animation.py - 文字动画示例
  • subtitle_import.py - 字幕导入示例
  • batch_processing.py - 批量处理示例

常见问题

草稿文件位置

调用 save_draft 后会在当前目录生成 dfd_ 开头的文件夹,将其复制到剪映/CapCut 草稿目录即可。

支持的视频格式

  • MP4 (推荐)
  • MOV
  • AVI
  • MKV

支持的图片格式

  • PNG (推荐,支持透明)
  • JPG/JPEG
  • WebP

支持的音频格式

  • MP3 (推荐)
  • AAC
  • WAV
  • M4A

项目信息

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

641968

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

590705

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318395

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

450339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.