mirror of
https://github.com/Hommy-master/capcut-mate.git
synced 2026-08-28 23:27:50 +08:00
优化文档。
This commit is contained in:
+24
-20
@@ -10,12 +10,16 @@ POST /openapi/capcut-mate/v1/add_audios
|
||||
|
||||
批量向现有草稿中添加音频素材。该接口支持添加多个音频文件到剪映草稿,为视频创建背景音乐、音效、旁白等音频内容。音频将被添加到独立的音频轨道中,不会影响视频内容。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"audio_infos": "[{\"audio_url\":\"https://example.com/audio1.mp3\",\"start\":0,\"end\":5000000,\"duration\":10000000,\"volume\":0.8,\"fade_in\":1000000,\"fade_out\":1000000}]"
|
||||
"audio_infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/audio1.mp3\",\"start\":0,\"end\":5000000,\"duration\":10000000,\"volume\":0.8,\"fade_in\":1000000,\"fade_out\":1000000}]"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -106,7 +110,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_audios \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"audio_infos": "[{\"audio_url\":\"https://example.com/bgm.mp3\",\"start\":0,\"end\":10000000,\"duration\":15000000,\"volume\":0.8}]"
|
||||
"audio_infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/bgm.mp3\",\"start\":0,\"end\":10000000,\"duration\":15000000,\"volume\":0.8}]"
|
||||
}'
|
||||
```
|
||||
|
||||
@@ -117,7 +121,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_audios \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"audio_infos": "[{\"audio_url\":\"https://example.com/intro.mp3\",\"start\":0,\"end\":3000000,\"duration\":5000000,\"volume\":1.0,\"fade_in\":500000},{\"audio_url\":\"https://example.com/bgm.mp3\",\"start\":3000000,\"end\":30000000,\"duration\":35000000,\"volume\":0.6}]"
|
||||
"audio_infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/intro.mp3\",\"start\":0,\"end\":3000000,\"duration\":5000000,\"volume\":1.0,\"fade_in\":500000},{\"audio_url\":\"https://assets.jcaigc.cn/bgm.mp3\",\"start\":3000000,\"end\":30000000,\"duration\":35000000,\"volume\":0.6}]"
|
||||
}'
|
||||
```
|
||||
|
||||
@@ -128,7 +132,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_audios \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"audio_infos": "[{\"audio_url\":\"https://example.com/outro.mp3\",\"start\":25000000,\"end\":30000000,\"duration\":8000000,\"volume\":0.9,\"fade_in\":1000000,\"fade_out\":2000000}]"
|
||||
"audio_infos": "[{\"audio_url\":\"https://assets.jcaigc.cn/outro.mp3\",\"start\":25000000,\"end\":30000000,\"duration\":8000000,\"volume\":0.9,\"fade_in\":1000000,\"fade_out\":2000000}]"
|
||||
}'
|
||||
```
|
||||
|
||||
@@ -151,7 +155,7 @@ const addAudios = async (draftUrl, audioConfig) => {
|
||||
const basicAudio = {
|
||||
audio_infos: JSON.stringify([
|
||||
{
|
||||
audio_url: "https://example.com/bgm.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/bgm.mp3",
|
||||
start: 0,
|
||||
end: 10000000,
|
||||
duration: 15000000,
|
||||
@@ -164,7 +168,7 @@ const basicAudio = {
|
||||
const audioSequence = {
|
||||
audio_infos: JSON.stringify([
|
||||
{
|
||||
audio_url: "https://example.com/intro.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/intro.mp3",
|
||||
start: 0,
|
||||
end: 3000000,
|
||||
duration: 5000000,
|
||||
@@ -172,14 +176,14 @@ const audioSequence = {
|
||||
fade_in: 500000
|
||||
},
|
||||
{
|
||||
audio_url: "https://example.com/main-bgm.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/main-bgm.mp3",
|
||||
start: 2000000,
|
||||
end: 25000000,
|
||||
duration: 30000000,
|
||||
volume: 0.6
|
||||
},
|
||||
{
|
||||
audio_url: "https://example.com/outro.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/outro.mp3",
|
||||
start: 24000000,
|
||||
end: 28000000,
|
||||
duration: 6000000,
|
||||
@@ -193,14 +197,14 @@ const audioSequence = {
|
||||
const soundEffects = {
|
||||
audio_infos: JSON.stringify([
|
||||
{
|
||||
audio_url: "https://example.com/applause.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/applause.mp3",
|
||||
start: 5000000,
|
||||
end: 8000000,
|
||||
duration: 4000000,
|
||||
volume: 0.7
|
||||
},
|
||||
{
|
||||
audio_url: "https://example.com/transition.mp3",
|
||||
audio_url: "https://assets.jcaigc.cn/transition.mp3",
|
||||
start: 12000000,
|
||||
end: 13500000,
|
||||
duration: 2000000,
|
||||
@@ -373,7 +377,7 @@ const audioManager = new AudioManager();
|
||||
|
||||
// 创建背景音乐
|
||||
const bgm = audioManager.createBackgroundMusic(
|
||||
"https://example.com/bgm.mp3",
|
||||
"https://assets.jcaigc.cn/bgm.mp3",
|
||||
60000000, // 60秒
|
||||
0.6,
|
||||
true // 循环播放
|
||||
@@ -382,19 +386,19 @@ const bgm = audioManager.createBackgroundMusic(
|
||||
// 创建音频序列
|
||||
const sequence = audioManager.createAudioSequence([
|
||||
{
|
||||
url: "https://example.com/intro.mp3",
|
||||
url: "https://assets.jcaigc.cn/intro.mp3",
|
||||
playDuration: 5000000,
|
||||
totalDuration: 5000000,
|
||||
volume: 1.0
|
||||
},
|
||||
{
|
||||
url: "https://example.com/main.mp3",
|
||||
url: "https://assets.jcaigc.cn/main.mp3",
|
||||
playDuration: 20000000,
|
||||
totalDuration: 25000000,
|
||||
volume: 0.8
|
||||
},
|
||||
{
|
||||
url: "https://example.com/outro.mp3",
|
||||
url: "https://assets.jcaigc.cn/outro.mp3",
|
||||
playDuration: 3000000,
|
||||
totalDuration: 3000000,
|
||||
volume: 1.0,
|
||||
@@ -405,13 +409,13 @@ const sequence = audioManager.createAudioSequence([
|
||||
// 创建音效
|
||||
const effects = audioManager.createSoundEffects([
|
||||
{
|
||||
url: "https://example.com/whoosh.mp3",
|
||||
url: "https://assets.jcaigc.cn/whoosh.mp3",
|
||||
startTime: 10000000,
|
||||
duration: 1500000,
|
||||
volume: 0.5
|
||||
},
|
||||
{
|
||||
url: "https://example.com/ding.mp3",
|
||||
url: "https://assets.jcaigc.cn/ding.mp3",
|
||||
startTime: 25000000,
|
||||
duration: 1000000,
|
||||
volume: 0.8
|
||||
@@ -526,7 +530,7 @@ processor = AudioProcessor()
|
||||
|
||||
# 背景音乐
|
||||
bgm_config = processor.create_background_music(
|
||||
"https://example.com/bgm.mp3",
|
||||
"https://assets.jcaigc.cn/bgm.mp3",
|
||||
60000000, # 60秒
|
||||
volume=0.6,
|
||||
loop=True
|
||||
@@ -535,13 +539,13 @@ bgm_config = processor.create_background_music(
|
||||
# 音频序列
|
||||
sequence_config = processor.create_audio_sequence([
|
||||
{
|
||||
"url": "https://example.com/intro.mp3",
|
||||
"url": "https://assets.jcaigc.cn/intro.mp3",
|
||||
"play_duration": 5000000,
|
||||
"total_duration": 5000000,
|
||||
"volume": 1.0
|
||||
},
|
||||
{
|
||||
"url": "https://example.com/main.mp3",
|
||||
"url": "https://assets.jcaigc.cn/main.mp3",
|
||||
"play_duration": 20000000,
|
||||
"total_duration": 25000000,
|
||||
"volume": 0.8
|
||||
@@ -551,7 +555,7 @@ sequence_config = processor.create_audio_sequence([
|
||||
# 音效
|
||||
effects_config = processor.create_sound_effects([
|
||||
{
|
||||
"url": "https://example.com/whoosh.mp3",
|
||||
"url": "https://assets.jcaigc.cn/whoosh.mp3",
|
||||
"start_time": 10000000,
|
||||
"duration": 1500000,
|
||||
"volume": 0.5
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
- **路径**: `/openapi/capcut-mate/v1/add_captions`
|
||||
- **Content-Type**: `application/json`
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
## 接口概述
|
||||
向现有剪映草稿中添加视频特效轨道和特效片段。支持批量添加多种视频特效,包括边框特效、滤镜特效、动态特效等,为视频内容增加丰富的视觉效果。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 接口信息
|
||||
- **请求方式**: POST
|
||||
- **接口路径**: `/openapi/capcut-mate/v1/add_effects`
|
||||
|
||||
+12
-8
@@ -10,12 +10,16 @@ POST /openapi/capcut-mate/v1/add_images
|
||||
|
||||
批量向现有草稿中添加图片素材。该接口支持多个图片的批量处理,包括透明度调整、缩放变换、位置偏移、动画效果等功能。在剪映系统中,图片被作为VideoSegment处理。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"image_infos": "[{\"image_url\":\"https://example.com/image1.jpg\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":5000000,\"animation\":\"淡入淡出\",\"transition\":\"溶解\",\"transition_duration\":500000}]",
|
||||
"image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/image1.jpg\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":5000000,\"animation\":\"淡入淡出\",\"transition\":\"溶解\",\"transition_duration\":500000}]",
|
||||
"alpha": 1.0,
|
||||
"scale_x": 1.0,
|
||||
"scale_y": 1.0,
|
||||
@@ -108,7 +112,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_images \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"image_infos": "[{\"image_url\":\"https://example.com/photo1.jpg\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":5000000}]"
|
||||
"image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/photo1.jpg\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":5000000}]"
|
||||
}'
|
||||
```
|
||||
|
||||
@@ -119,7 +123,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_images \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"image_infos": "[{\"image_url\":\"https://example.com/logo.png\",\"width\":800,\"height\":600,\"start\":1000000,\"end\":4000000,\"duration\":3000000,\"animation\":\"缩放入场\",\"transition\":\"淡入淡出\"}]",
|
||||
"image_infos": "[{\"image_url\":\"https://assets.jcaigc.cn/logo.png\",\"width\":800,\"height\":600,\"start\":1000000,\"end\":4000000,\"duration\":3000000,\"animation\":\"缩放入场\",\"transition\":\"淡入淡出\"}]",
|
||||
"alpha": 0.9,
|
||||
"scale_x": 1.2,
|
||||
"scale_y": 1.2,
|
||||
@@ -147,7 +151,7 @@ const addImages = async (draftUrl, imageConfig) => {
|
||||
const basicImages = {
|
||||
image_infos: JSON.stringify([
|
||||
{
|
||||
image_url: "https://example.com/cover.jpg",
|
||||
image_url: "https://assets.jcaigc.cn/cover.jpg",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 0,
|
||||
@@ -161,7 +165,7 @@ const basicImages = {
|
||||
const slideshow = {
|
||||
image_infos: JSON.stringify([
|
||||
{
|
||||
image_url: "https://example.com/slide1.jpg",
|
||||
image_url: "https://assets.jcaigc.cn/slide1.jpg",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 0,
|
||||
@@ -171,7 +175,7 @@ const slideshow = {
|
||||
transition: "淡入淡出"
|
||||
},
|
||||
{
|
||||
image_url: "https://example.com/slide2.jpg",
|
||||
image_url: "https://assets.jcaigc.cn/slide2.jpg",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 3000000,
|
||||
@@ -187,7 +191,7 @@ const slideshow = {
|
||||
const watermark = {
|
||||
image_infos: JSON.stringify([
|
||||
{
|
||||
image_url: "https://example.com/logo.png",
|
||||
image_url: "https://assets.jcaigc.cn/logo.png",
|
||||
width: 300,
|
||||
height: 100,
|
||||
start: 0,
|
||||
@@ -260,7 +264,7 @@ processor = ImageProcessor()
|
||||
|
||||
slideshow_config = processor.create_slideshow([
|
||||
{
|
||||
"url": "https://example.com/slide1.jpg",
|
||||
"url": "https://assets.jcaigc.cn/slide1.jpg",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"animation": "淡入淡出"
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
## 接口描述
|
||||
向剪映草稿添加关键帧,支持多种动画属性的关键帧设置。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 接口信息
|
||||
- **方法**: POST
|
||||
- **路径**: `/openapi/capcut-mate/v1/add_keyframes`
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
## 接口概述
|
||||
向现有草稿中的指定片段添加遮罩效果。遮罩是视频编辑中的重要功能,通过遮罩可以控制图像的可见区域,创造出各种视觉效果。支持多种遮罩类型(线性、镜面、圆形、矩形、爱心、星形),每种遮罩都可以精确配置位置、大小、羽化、旋转等属性。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 接口信息
|
||||
- **请求方式**: POST
|
||||
- **接口路径**: `/openapi/capcut-mate/v1/add_masks`
|
||||
|
||||
+5
-1
@@ -10,6 +10,10 @@ POST /openapi/capcut-mate/v1/add_sticker
|
||||
|
||||
向现有草稿中添加贴纸。该接口用于在指定的时间段内添加贴纸素材到剪映草稿中,支持贴纸的缩放和位置调整。贴纸可以用于增强视频的视觉效果,如表情、装饰、文字等。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
@@ -418,7 +422,7 @@ import random
|
||||
from typing import List, Dict
|
||||
|
||||
class StickerProcessor:
|
||||
def __init__(self, base_url: str = "https://api.example.com"):
|
||||
def __init__(self, base_url: str = "https://api.assets.jcaigc.cn"):
|
||||
self.base_url = base_url
|
||||
|
||||
def add_sticker(self, draft_url: str, sticker_config: Dict) -> Dict:
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
## 接口概述
|
||||
为文本创建富文本样式,支持关键词高亮、颜色设置、字体大小调整等功能。该接口可以将普通文本转换为包含样式信息的富文本格式,实现关键词突出显示、多样化的文本展示效果。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 接口信息
|
||||
- **请求方式**: POST
|
||||
- **接口路径**: `/openapi/capcut-mate/v1/add_text_style`
|
||||
|
||||
+21
-17
@@ -10,12 +10,16 @@ POST /openapi/capcut-mate/v1/add_videos
|
||||
|
||||
批量向现有草稿中添加视频素材。该接口是一个功能强大的视频添加工具,支持多个视频的批量处理,包括时间范围控制、透明度调整、遮罩效果、转场动画、音量控制、缩放变换等高级功能。特别适合创建复杂的多视频组合场景,如画中画效果、视频拼接、过渡动画等。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"video_infos": "[{\"video_url\":\"https://example.com/video1.mp4\",\"width\":1024,\"height\":1024,\"start\":0,\"end\":5000000,\"duration\":5000000,\"mask\":\"圆形\",\"transition\":\"淡入淡出\",\"transition_duration\":500000,\"volume\":0.8}]",
|
||||
"video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/video1.mp4\",\"width\":1024,\"height\":1024,\"start\":0,\"end\":5000000,\"duration\":5000000,\"mask\":\"圆形\",\"transition\":\"淡入淡出\",\"transition_duration\":500000,\"volume\":0.8}]",
|
||||
"alpha": 0.5,
|
||||
"scale_x": 1.0,
|
||||
"scale_y": 1.0,
|
||||
@@ -132,7 +136,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_videos \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"video_infos": "[{\"video_url\":\"https://example.com/video1.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":10000000}]"
|
||||
"video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/video1.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":10000000}]"
|
||||
}'
|
||||
```
|
||||
|
||||
@@ -143,7 +147,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_videos \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"video_infos": "[{\"video_url\":\"https://example.com/video1.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":10000000},{\"video_url\":\"https://example.com/video2.mp4\",\"width\":1280,\"height\":720,\"start\":5000000,\"end\":10000000,\"duration\":8000000}]",
|
||||
"video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/video1.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":5000000,\"duration\":10000000},{\"video_url\":\"https://assets.jcaigc.cn/video2.mp4\",\"width\":1280,\"height\":720,\"start\":5000000,\"end\":10000000,\"duration\":8000000}]",
|
||||
"alpha": 0.8
|
||||
}'
|
||||
```
|
||||
@@ -155,7 +159,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_videos \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"video_infos": "[{\"video_url\":\"https://example.com/video1.mp4\",\"width\":1024,\"height\":1024,\"start\":0,\"end\":5000000,\"duration\":10000000,\"mask\":\"圆形\",\"transition\":\"淡入淡出\",\"transition_duration\":500000,\"volume\":0.8}]",
|
||||
"video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/video1.mp4\",\"width\":1024,\"height\":1024,\"start\":0,\"end\":5000000,\"duration\":10000000,\"mask\":\"圆形\",\"transition\":\"淡入淡出\",\"transition_duration\":500000,\"volume\":0.8}]",
|
||||
"alpha": 1.0,
|
||||
"scale_x": 1.2,
|
||||
"scale_y": 1.2
|
||||
@@ -169,7 +173,7 @@ curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/add_videos \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"draft_url": "YOUR_DRAFT_URL",
|
||||
"video_infos": "[{\"video_url\":\"https://example.com/main.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":10000000,\"duration\":15000000},{\"video_url\":\"https://example.com/pip.mp4\",\"width\":640,\"height\":360,\"start\":2000000,\"end\":8000000,\"duration\":10000000}]",
|
||||
"video_infos": "[{\"video_url\":\"https://assets.jcaigc.cn/main.mp4\",\"width\":1920,\"height\":1080,\"start\":0,\"end\":10000000,\"duration\":15000000},{\"video_url\":\"https://assets.jcaigc.cn/pip.mp4\",\"width\":640,\"height\":360,\"start\":2000000,\"end\":8000000,\"duration\":10000000}]",
|
||||
"transform_x": 300,
|
||||
"transform_y": -200,
|
||||
"scale_x": 0.3,
|
||||
@@ -196,7 +200,7 @@ const addVideos = async (draftUrl, videoConfig) => {
|
||||
const basicVideos = {
|
||||
video_infos: JSON.stringify([
|
||||
{
|
||||
video_url: "https://example.com/video1.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/video1.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 0,
|
||||
@@ -210,7 +214,7 @@ const basicVideos = {
|
||||
const videoSequence = {
|
||||
video_infos: JSON.stringify([
|
||||
{
|
||||
video_url: "https://example.com/intro.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/intro.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 0,
|
||||
@@ -220,7 +224,7 @@ const videoSequence = {
|
||||
transition_duration: 500000
|
||||
},
|
||||
{
|
||||
video_url: "https://example.com/main.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/main.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 3000000,
|
||||
@@ -229,7 +233,7 @@ const videoSequence = {
|
||||
volume: 0.8
|
||||
},
|
||||
{
|
||||
video_url: "https://example.com/outro.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/outro.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 15000000,
|
||||
@@ -245,7 +249,7 @@ const videoSequence = {
|
||||
const pipEffect = {
|
||||
video_infos: JSON.stringify([
|
||||
{
|
||||
video_url: "https://example.com/background.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/background.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
start: 0,
|
||||
@@ -253,7 +257,7 @@ const pipEffect = {
|
||||
duration: 15000000
|
||||
},
|
||||
{
|
||||
video_url: "https://example.com/overlay.mp4",
|
||||
video_url: "https://assets.jcaigc.cn/overlay.mp4",
|
||||
width: 640,
|
||||
height: 360,
|
||||
start: 2000000,
|
||||
@@ -406,14 +410,14 @@ const videoManager = new VideoManager();
|
||||
// 创建视频序列
|
||||
const sequence = videoManager.createVideoSequence([
|
||||
{
|
||||
url: "https://example.com/intro.mp4",
|
||||
url: "https://assets.jcaigc.cn/intro.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
playDuration: 3000000,
|
||||
totalDuration: 5000000
|
||||
},
|
||||
{
|
||||
url: "https://example.com/main.mp4",
|
||||
url: "https://assets.jcaigc.cn/main.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
playDuration: 10000000,
|
||||
@@ -425,13 +429,13 @@ const sequence = videoManager.createVideoSequence([
|
||||
// 创建画中画
|
||||
const pip = videoManager.createPictureInPicture(
|
||||
{
|
||||
url: "https://example.com/background.mp4",
|
||||
url: "https://assets.jcaigc.cn/background.mp4",
|
||||
width: 1920,
|
||||
height: 1080,
|
||||
duration: 10000000
|
||||
},
|
||||
{
|
||||
url: "https://example.com/overlay.mp4",
|
||||
url: "https://assets.jcaigc.cn/overlay.mp4",
|
||||
width: 640,
|
||||
height: 360,
|
||||
duration: 6000000,
|
||||
@@ -537,14 +541,14 @@ processor = VideoProcessor()
|
||||
# 视频序列
|
||||
videos = [
|
||||
{
|
||||
"url": "https://example.com/intro.mp4",
|
||||
"url": "https://assets.jcaigc.cn/intro.mp4",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"play_duration": 3000000,
|
||||
"total_duration": 5000000
|
||||
},
|
||||
{
|
||||
"url": "https://example.com/main.mp4",
|
||||
"url": "https://assets.jcaigc.cn/main.mp4",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"play_duration": 10000000,
|
||||
|
||||
@@ -10,6 +10,10 @@ POST /openapi/capcut-mate/v1/create_draft
|
||||
|
||||
创建剪映草稿。该接口用于创建一个新的剪映草稿项目,可以自定义视频的宽度和高度。创建成功后会返回草稿URL和帮助文档URL,为后续的视频编辑操作提供基础。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
@@ -57,7 +61,7 @@ POST /openapi/capcut-mate/v1/create_draft
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://cm.jcaigc.cn/openapi/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"tip_url": "https://help.example.com/draft-usage"
|
||||
"tip_url": "https://help.assets.jcaigc.cn/draft-usage"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -233,7 +237,7 @@ import requests
|
||||
from typing import Optional, Dict
|
||||
|
||||
class DraftCreator:
|
||||
def __init__(self, base_url: str = "https://api.example.com"):
|
||||
def __init__(self, base_url: str = "https://api.assets.jcaigc.cn"):
|
||||
self.base_url = base_url
|
||||
|
||||
def create_draft(self, width: int = 1920, height: int = 1080) -> Dict:
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/easy_create_material`
|
||||
**功能描述**:在现有草稿中添加多种类型的素材内容,包括音频、视频、图片和文字。该接口可以一次性向草稿添加多种媒体素材,自动处理素材的时长、尺寸等属性,并智能管理不同类型的媒体轨道。是视频创作的核心接口之一。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
@@ -37,10 +41,10 @@
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"audio_url": "https://example.com/audio.mp3",
|
||||
"audio_url": "https://assets.jcaigc.cn/audio.mp3",
|
||||
"text": "Hello World",
|
||||
"img_url": "https://s.coze.cn/t/JTa5Ne6_liY/",
|
||||
"video_url": "https://example.com/video.mp4",
|
||||
"video_url": "https://assets.jcaigc.cn/video.mp4",
|
||||
"text_color": "#ff0000",
|
||||
"font_size": 20,
|
||||
"text_transform_y": 100
|
||||
@@ -52,7 +56,7 @@
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"audio_url": "https://example.com/background_music.mp3",
|
||||
"audio_url": "https://assets.jcaigc.cn/background_music.mp3",
|
||||
"text": "欢迎观看",
|
||||
"text_color": "#0066ff",
|
||||
"font_size": 18
|
||||
@@ -64,7 +68,7 @@
|
||||
```json
|
||||
{
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"audio_url": "https://example.com/audio.wav"
|
||||
"audio_url": "https://assets.jcaigc.cn/audio.wav"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
+5
-1
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/gen_video`
|
||||
**功能描述**:提交视频生成任务。该接口采用异步处理模式,立即返回任务ID,视频生成在后台进行。支持任务排队,确保系统稳定性。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
@@ -360,7 +364,7 @@ import aiohttp
|
||||
from typing import Dict, Optional, Callable
|
||||
|
||||
class VideoGenerator:
|
||||
def __init__(self, base_url: str = "https://api.example.com"):
|
||||
def __init__(self, base_url: str = "https://api.assets.jcaigc.cn"):
|
||||
self.base_url = base_url
|
||||
|
||||
def generate_video(self, draft_url: str, timeout: int = 300) -> Dict:
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/gen_video_status`
|
||||
**功能描述**:查询视频生成任务的状态和进度。配合 gen_video 接口使用,用于实时跟踪视频生成任务的执行情况,包括任务状态、进度百分比、完成结果等信息。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
@@ -63,7 +67,7 @@
|
||||
"draft_url": "https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/get_draft?draft_id=2025092811473036584258",
|
||||
"status": "completed",
|
||||
"progress": 100,
|
||||
"video_url": "https://video-output.example.com/generated/video_abc123def456ghi789.mp4",
|
||||
"video_url": "https://video-output.assets.jcaigc.cn/generated/video_abc123def456ghi789.mp4",
|
||||
"error_message": "",
|
||||
"created_at": "2024-09-24T10:30:00.000Z",
|
||||
"started_at": "2024-09-24T10:30:05.000Z",
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/get_audio_duration`
|
||||
**功能描述**:获取音频文件的时长,支持各种常见的音频格式。使用FFprobe工具进行精确的音频分析,返回音频文件的准确时长,单位为微秒。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
@@ -27,7 +31,7 @@
|
||||
|
||||
```json
|
||||
{
|
||||
"mp3_url": "https://example.com/audio/sample.mp3"
|
||||
"mp3_url": "https://assets.jcaigc.cn/audio/sample.mp3"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -35,7 +39,7 @@
|
||||
|
||||
```json
|
||||
{
|
||||
"mp3_url": "https://example.com/audio/music.wav"
|
||||
"mp3_url": "https://assets.jcaigc.cn/audio/music.wav"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -155,7 +159,7 @@ const getAudioDuration = async (audioUrl) => {
|
||||
};
|
||||
|
||||
// 使用示例
|
||||
getAudioDuration('https://example.com/audio/sample.mp3')
|
||||
getAudioDuration('https://assets.jcaigc.cn/audio/sample.mp3')
|
||||
.then(duration => {
|
||||
console.log(`音频时长(微秒): ${duration}`);
|
||||
console.log(`音频时长(秒): ${duration / 1000000}`);
|
||||
@@ -189,7 +193,7 @@ def get_audio_duration(mp3_url):
|
||||
return None
|
||||
|
||||
# 使用示例
|
||||
audio_url = "https://example.com/audio/sample.mp3"
|
||||
audio_url = "https://assets.jcaigc.cn/audio/sample.mp3"
|
||||
duration_info = get_audio_duration(audio_url)
|
||||
|
||||
if duration_info:
|
||||
@@ -235,9 +239,9 @@ def get_audio_duration_batch(audio_urls):
|
||||
|
||||
# 使用示例
|
||||
audio_urls = [
|
||||
"https://example.com/audio1.mp3",
|
||||
"https://example.com/audio2.wav",
|
||||
"https://example.com/audio3.aac"
|
||||
"https://assets.jcaigc.cn/audio1.mp3",
|
||||
"https://assets.jcaigc.cn/audio2.wav",
|
||||
"https://assets.jcaigc.cn/audio3.aac"
|
||||
]
|
||||
|
||||
results = get_audio_duration_batch(audio_urls)
|
||||
|
||||
+5
-1
@@ -10,6 +10,10 @@ GET /openapi/capcut-mate/v1/get_draft
|
||||
|
||||
获取草稿文件列表。该接口用于获取指定草稿ID对应的所有文件列表,可以查看草稿中包含的素材文件、配置文件等信息。通常用于草稿内容的预览、文件管理或状态检查。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### Query参数
|
||||
@@ -346,7 +350,7 @@ from urllib.parse import urlparse, parse_qs
|
||||
from typing import Dict, List, Optional, Callable
|
||||
|
||||
class DraftManager:
|
||||
def __init__(self, base_url: str = "https://api.example.com"):
|
||||
def __init__(self, base_url: str = "https://api.assets.jcaigc.cn"):
|
||||
self.base_url = base_url
|
||||
|
||||
def get_draft(self, draft_id: str) -> Dict:
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/get_image_animations`
|
||||
**功能描述**:获取图片出入场动画列表,返回所有支持的且满足条件的图片出入场动画。支持根据动画类型(入场、出场、循环)和会员模式(所有、VIP、免费)进行筛选。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
**接口地址**:`POST /openapi/capcut-mate/v1/get_text_animations`
|
||||
**功能描述**:获取文字出入场动画列表,返回所有支持的且满足条件的文字出入场动画。支持根据动画类型(入场、出场、循环)和会员模式(所有、VIP、免费)进行筛选。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
### 请求体 (application/json)
|
||||
|
||||
+5
-1
@@ -10,6 +10,10 @@ POST /openapi/capcut-mate/v1/save_draft
|
||||
|
||||
保存剪映草稿。该接口用于保存当前的草稿状态,确保编辑的内容得到持久化存储。通常在完成一系列编辑操作后调用此接口,以防止编辑内容丢失。
|
||||
|
||||
## 更多文档
|
||||
|
||||
📖 更多详细文档和教程请访问:[https://docs.jcaigc.cn](https://docs.jcaigc.cn)
|
||||
|
||||
## 请求参数
|
||||
|
||||
```json
|
||||
@@ -195,7 +199,7 @@ import threading
|
||||
from typing import Dict, List, Callable
|
||||
|
||||
class DraftSaver:
|
||||
def __init__(self, base_url: str = "https://api.example.com"):
|
||||
def __init__(self, base_url: str = "https://assets.jcaigc.cn"):
|
||||
self.base_url = base_url
|
||||
self._auto_save_threads = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user