RapidVideoMaker
创建账户

API RapidVideoMaker

REST API 允许从任何 HTTP 客户端处理视频文件——Python 脚本、n8n 工作流、第三方工具。五种模式:合并视频(多个 MP4/MOV)、编辑音频(1 MP4/MOV + 1 MP3)、创建视频(1 JPG/PNG + 1 MP3)、视频叠加(2 MP4/MOV 画中画)。处理为异步:提交文件后轮询结果。

免费获取您的API令牌
创建账户以获取您的API令牌 — 每天包含20次请求。
创建免费账户 已有账户?登录

完整工作流程

每个集成都遵循相同的4步序列:

1
创建任务 — POST /api/v1/render.php
使用Bearer令牌将文件作为multipart/form-data发送。1张JPG/PNG图像 + 1个MP3 + mode=image_to_video → 视频生成。1个MP4/MOV + 1个MP3 → 音频编辑。多个MP4/MOV → 合并。服务器返回唯一的job_id。或 1 张图片 + options.text + options.voice:语音由文字生成,无需 MP3。
2
等待任务 — GET /api/v1/jobs.php?job_id=…
定期(每5-10秒)轮询此端点。任务会经历queued → processing → ready(或error)。
3
获取下载URL
当状态变为ready时,响应包含可用的download_url字段。
4
下载文件 — GET /api/download.php?job_id=…
下载最终MP4/MOV。文件在任务完成后2小时内可用,之后自动删除。

认证

每个请求必须包含您的API令牌。接受两种格式:

# 认证 — 每个请求必须包含您的API令牌。接受两种格式: Authorization: Bearer rvm_your_token_here # Alternative X-API-Key: rvm_your_token_here

您的令牌可在会员区获取 — 每个账户一个令牌,注册时自动创建。

配额

每个会员账户有每天20个请求,在网页界面和API之间共享。失败的任务不消耗配额。计数器在UTC午夜重置。

POST响应包含quota_used和quota_remaining。超过限制时,服务器响应429。

界面 + API = 相同计数器。从网页界面创建的视频和API请求各消耗同一日配额中的1个积分。

队列

一次处理一个任务。如果同时提交多个任务,它们会排队按顺序处理。等待时,状态响应包含:

适用速率限制:/api/v1/jobs.php端点每个令牌最多接受每分钟12次调用。建议:调用间隔10秒。

可用转场效果

直接合并传入transition_type=none(默认),或使用以下类型之一在剪辑间淡入淡出:

none fade fadeblack dissolve wipeleft wiperight slideleft slideright zoomin circleclose

时长(transition_duration)在0.2到2.0秒之间。

端点

POST /api/v1/render.php 创建视频处理任务

五种模式,通过 mode 字段指定(多个 MP4 省略 mode 自动检测 fusion):

用法API模式所需文件描述
合并视频 fusion 2-20个MP4/MOV文件 剪辑按提供的顺序首尾相连组装。剪辑之间可选择性添加转场效果。
编辑音频 add_audio 或 mix_audio 1个MP4/MOV + 1个MP3 替换或丰富视频的音轨。视频轨道永不重新编码。

add_audio — 原始音频被删除并完全替换为MP3。
mix_audio — 原始音频被保留,MP3被叠加。
创建视频 image_to_video 1 张 JPG/PNG + 1 个 MP3 —— 或 1 张 JPG/PNG + 一段文字(options.text + options.voice):生成语音 由一张静态图片和您的 MP3 —— 或仅由一段文字(options.text,语音由 options.voice 生成)—— 生成视频。文字叠加(固定、逐词或卡拉 OK)、淡入淡出、分辨率和 fps 可通过 options 字段配置。
视频叠加 overlay_video 2 MP4/MOV 将第二个视频叠加在主视频上方。位置、大小、透明度和音频可通过 options 字段配置。
添加文字 add_text 1 个 MP4/MOV 在现有视频上叠加文字(保持分辨率、帧率和音频)。文字设置与 image_to_video 相同,另外可指定文字出现的时间。options.text 为必填项。
文字转MP3 text_to_mp3 (仅文本) 将文本转换为语音并返回MP3文件。无需上传文件 — 将 mode=text_to_mp3、text 和 lang 作为表单字段发送。支持网站的全部20种语言。
严格验证:每种模式需要精确的文件数量和类型。add_audio和mix_audio只接受1个MP4/MOV + 1个MP3。image_to_video只接受1张JPG/PNG + 1个MP3。例外:使用 options.text + options.voice 时,image_to_video 只接受 1 张图片——语音由文字生成(无需 MP3)。
时长规则:在音频和image_to_video模式下,结果时长锁定为MP3时长。使用 options.voice 时,image_to_video 的时长等于由文字生成的语音时长(+0.6 秒)。

公共参数(multipart/form-data)

字段类型必填描述
videos[]File[]是要处理的文件。根据模式不同:2-20个MP4/MOV,或1个MP4/MOV + 1个MP3,或1张图像(JPG/PNG)+ 1个MP3。每个文件最大500 MB。
modestring*image_to_video | add_audio | mix_audio | overlay_video | text_to_mp3。这些非fusion模式必填。仅上传MP4/MOV文件且省略mode时始终触发fusion(流复制拼接)——即使正好上传2个MP4/MOV,也绝不会触发overlay_video。音频编辑:add_audio删除原始音频,mix_audio保留原始音频并叠加。如果提供了mode字段,上传的文件必须完全匹配——否则请求将被拒绝。 也接受 add_text:它是唯一只接收单个 MP4/MOV 文件的模式,并且需要 options.text。
orderJSON仅限fusion模式 — 定义剪辑顺序的索引JSON数组。
transition_typestring仅限fusion模式。默认:none。
transition_durationfloat仅限fusion模式。时长0.2-2.0秒。默认:0.5。
optionsJSONimage_to_video, add_text, mix_audio 和 overlay_video 的渲染参数 JSON 对象(见下方表格)。
timingsFile / stringimage_to_video / add_text:卡拉OK时间轴文件(SRT 或 LRC,最大 200 KB)——文件字段或纯文本。显示的文字取自文件;强制 text_mode=karaoke;不能与 voice 同时使用。
callback_urlstring任务完成时调用的公共URL(http/https)。响应包含webhook_secret。

options参数 — image_to_video模式

全部可选。未提供的值 → 由工作进程应用默认值。

键类型默认值描述
textstring""作为叠加显示的文本。空 = 无文本。最多500个字符。
fontstring"default"文字字体,按标识符指定。可用值:default, dejavu-sans-bold, dejavu-serif, liberation-serif, dejavu-mono, amiri, noto-sans-sc (简体中文), noto-sans-tc (繁體中文), noto-sans-jp (日本語), noto-sans-kr (한국어), noto-sans-hebrew (עברית), noto-sans-thai (ไทย)。default = 标准字体(支持表情符号);amiri = Naskh 字体,适合阿拉伯语文字。其他任何值都会返回 invalid_option 错误。表情符号仅在 default 下显示。
font_sizeint60字体大小(像素)。范围:10-300。
text_colorstring"white"文本颜色(例如:white、yellow、#ffffff)。
text_positionstring"center"文本位置:center、top、bottom。
boxbooltrue文本后面的半透明背景。
box_colorstring"black@0.4"FFmpeg格式的颜色 + 不透明度:color@opacity。
fade_durationfloat0.5淡入/淡出时长(秒),0-2。0 = 无效果。
widthint1080视频宽度(像素),64-3840,强制为偶数。
heightint1920视频高度(像素),64-3840,强制为偶数。
fpsint24帧率(1-60)。
image_fitstring"contain"contain: 完整显示图片或视频,并用所选背景填充空白区域。 solid(默认)或blur。模糊背景要求image_fit=contain。文字保持清晰。 cover: 图片缩放填充框架,居中 — 边缘被裁剪。
bg_colorstring"black"background_mode=solid: 图像未填满目标分辨率时的背景颜色。
background_modestring"solid"solid(默认)或blur。模糊背景要求image_fit=contain。文字保持清晰。
blur_strengthnumber201至50的数值,默认20。仅对背景应用高斯模糊。
enable_image_motionboolfalse启用照片动画。false时图像保持静态。
image_motion_effectstring"ken_burns"动画效果。接受的值:zoom_in、zoom_out、pan_left_to_right、ken_burns等。
motion_intensityfloat1.0照片动画强度(0.25-2.0)。乘以缩放幅度和平移速度。
text_effectstring"none"文本叠加动画。接受的值:none、fade_in、slide_up、bounce。
text_effect_intensityfloat1.0文本动画强度(0.25-2.0)。text_effect为none时忽略。
text_border_widthint0字符周围黑色轮廓的厚度(像素),0 = 禁用。
text_border_colorstring"black"文字描边的颜色(格式同 text_color,默认 "black")。当 text_border_width > 0 时生效。
text_modestring"static"文字显示模式。static(默认):从第一帧起显示全文。word_by_word:按 word_reveal_speed 的速率逐词显示。与 text_effect 互斥:若 text_mode=word_by_word,则 text_effect 将被忽略。 "karaoke":文字随音频节奏逐页变色(最多 1000 个字符)。配合 voice 时逐词同步,否则按词的长度分配到整段音频。
word_reveal_speedfloat1.5逐词显示速度,单位为词/秒(0.3–5.0,默认 1.5)。仅在 text_mode=word_by_word 时使用。与 OpenAI TTS 同步的推荐值:2.0。
word_animstring"none"每个单词出现的动画。none(默认):即时显示。fade:每个新单词以0.2秒淡入并与前一块交叉淡化。仅在 text_mode=word_by_word 时有效。
karaoke_stylestring"fill"卡拉OK样式:fill(已读的词变为高亮颜色)、sweep(每个词逐渐填充;从右向左书写的文字按整词)或 highlight(仅当前词变色)。
highlight_colorstring"#FFD200"卡拉OK模式下已读词 / 当前词的颜色(格式同 text_color)。
karaoke_linesint2卡拉OK模式下每页显示的行数(1–4)。
voicestring""语音 ID(与 text_to_mp3 相同的列表,例如 zh-CN-XiaoxiaoNeural):在同一任务中由 text 生成语音。此时 image_to_video 只需要图片(同时上传的 MP3 会被拒绝)。卡拉OK模式下每个词都与语音同步。
voice_rateint0生成语音的语速,以 % 表示(−50 至 +50)。

使用您自己的时间轴制作卡拉OK(SRT / LRC)

在 timings 字段中发送 SRT 或 LRC 文件:每一行在各自的时间出现,并构成卡拉OK的一页(最多 500 行、5000 个字符)。SRT:行在结束时间消失。LRC:行一直显示到下一行(空行会结束它);支持 [offset:] 和增强型 LRC 的逐词时间 <mm:ss.xx>,否则每行按其时长分配。在 add_text 中,时间以视频开头为准,并按 text_start 偏移。

# lyrics.srt 1 00:00:01,000 --> 00:00:03,500 First line of the song 2 00:00:04,000 --> 00:00:07,200 Second line, on its own page # lyrics.lrc — enhanced LRC: optional per-word times <mm:ss.xx> [00:01.00]<00:01.00>First <00:01.60>line <00:02.10>here [00:04.00]Second line [00:07.50]

options 参数 — overlay_video 模式

均为可选。上传顺序很重要:第一个文件是主视频(背景),第二个文件是叠加视频(前景)。使用 chroma_key 可去除叠加视频的绿幕背景。

键类型默认值描述
positionstring"bottom-right"叠加视频的放置位置:top-left、top-right、bottom-left、bottom-right 或 center。
scalefloat0.30叠加视频宽度占主视频宽度的比例。0.25 = 25%。范围:0.05–1.0。
opacityfloat1.0叠加视频的透明度。1.0 = 完全不透明,0.0 = 不可见。
marginint10叠加视频与画面边缘的像素距离。当 position=center 时忽略。范围:0–200。
audiostring"main"保留哪条音轨。main:仅主视频音频。overlay:仅叠加视频音频。mix:两者混合。
chroma_keyboolfalse设为 true 可去除叠加视频的纯绿色(#00FF00)背景 — 适用于绿幕前拍摄的摄像头或动画。
chroma_similarityfloat0.20绿幕容差。低 = 严格匹配(保留主体边缘)。高 = 更宽泛的去除(适应光线不均)。推荐:数字绿 0.10–0.20,物理屏幕 0.25–0.45。范围:0.01–0.60。

options 参数 — add_text 模式

文字为必填项。默认保留视频原始格式、帧率和音频。output_format可配合image_fit、bg_color和background_mode调整画布。width、height、fps及照片运动选项仍被忽略。视频最长15分钟。

{"text":"Hello","output_format":"portrait","image_fit":"contain","background_mode":"blur","blur_strength":20}
键类型默认值描述
textstring是要叠加的文字。必填,1–200 个字符。
text_startfloat0文字出现的秒数(≥ 0)。必须早于视频结束时间。
text_durationfloat0文字保持可见的时长,单位为秒(0.1–3600)。0 = 直到视频结束。
fontstring"default"文字字体,按标识符指定。可用值:default, dejavu-sans-bold, dejavu-serif, liberation-serif, dejavu-mono, amiri, noto-sans-sc (简体中文), noto-sans-tc (繁體中文), noto-sans-jp (日本語), noto-sans-kr (한국어), noto-sans-hebrew (עברית), noto-sans-thai (ไทย)。default = 标准字体(支持表情符号);amiri = Naskh 字体,适合阿拉伯语文字。其他任何值都会返回 invalid_option 错误。表情符号仅在 default 下显示。
font_sizeint60字号按短边为 1080 px 的视频给出,并会自动缩放到实际分辨率——同一数值在 720p 和 4K 下的视觉效果一致。范围:10–300。
fade_durationfloat0.5文字(而非视频)的淡入/淡出时长,单位为秒。范围:0–2。
text_color, box, box_color, text_position, text_border_width, text_border_color, text_effect, text_effect_intensity, text_mode, word_reveal_speed, word_anim, karaoke_style, highlight_color, karaoke_lines, voice, voice_rate——与 image_to_video 相同(见上表)。
original_volumefloat0.3使用 voice 时:语音下方视频原声的音量(0–2,默认 0.3;0 = 替换)。语音从 text_start 开始;文字一直显示到语音结束,如果超出视频结尾,将定格最后一帧。
background_modestring"solid"solid(默认)或blur。模糊背景要求image_fit=contain。文字保持清晰。
blur_strengthnumber201至50的数值,默认20。仅对背景应用高斯模糊。
output_formatstring"original"仅限add_text:original(默认)、portrait(1080×1920)、square(1080×1080)、landscape(1920×1080)。模糊背景要求使用original以外的格式。
image_fitstring"contain"contain: 完整显示图片或视频,并用所选背景填充空白区域。 solid(默认)或blur。模糊背景要求image_fit=contain。文字保持清晰。 cover: 图片缩放填充框架,居中 — 边缘被裁剪。
bg_colorstring"black"background_mode=solid: 图像未填满目标分辨率时的背景颜色。

options参数 — 音频编辑(mix_audio)

仅在mode=mix_audio时可用。add_audio时忽略。

键类型默认值描述
mp3_volumefloat1.0叠加MP3的音量(0.0 = 静音,1.0 = 原始音量,2.0 = 双倍)。

text_to_mp3 模式 — 直接参数(无 options JSON)

与其他模式不同,这些字段直接作为表单字段发送,而不是在 options JSON 对象内。只有 text 是必需的。

键类型默认值描述
textstring—要转换为语音的文本。必需。最多 5,000 个字符。
langstring"en"当 voice 缺失或无效时用于选择默认语音的语言代码。网站 20 种语言之一(见下表)。未知时回退到 en。
voicestring自动edge-tts 语音 ID(见下表)。若缺失或无效,将自动使用 lang 的第一个语音。
slowboolfalse设置为 true(或 1)可将语速降低 25%。其他任何值都视为 false。
无需上传文件:与其他模式不同,text_to_mp3 不需要 videos[]。将 mode=text_to_mp3 与 text / lang / voice / slow 作为普通表单字段一起发送。

可用语音(edge-tts, Microsoft Neural),按语言代码分组:

语言可用语音
en en-US-AvaNeural, en-US-AndrewNeural, en-GB-LibbyNeural, en-AU-NatashaNeural, en-AU-WilliamMultilingualNeural
fr fr-FR-DeniseNeural, fr-FR-HenriNeural, fr-FR-EloiseNeural, fr-CA-SylvieNeural, fr-CA-ThierryNeural
es es-ES-ElviraNeural, es-ES-AlvaroNeural, es-MX-DaliaNeural, es-AR-ElenaNeural, es-AR-TomasNeural
ar ar-SA-ZariyahNeural, ar-SA-HamedNeural, ar-EG-SalmaNeural, ar-MA-MounaNeural, ar-MA-JamalNeural
pt pt-BR-FranciscaNeural, pt-BR-AntonioNeural, pt-PT-RaquelNeural
de de-DE-KatjaNeural, de-DE-ConradNeural, de-DE-AmalaNeural, de-AT-IngridNeural, de-AT-JonasNeural
it it-IT-ElsaNeural, it-IT-DiegoNeural, it-IT-IsabellaNeural
nl nl-NL-ColetteNeural, nl-NL-MaartenNeural, nl-BE-DenaNeural, nl-BE-ArnaudNeural
ru ru-RU-SvetlanaNeural, ru-RU-DmitryNeural
tr tr-TR-EmelNeural, tr-TR-AhmetNeural
hi hi-IN-SwaraNeural, hi-IN-MadhurNeural
bn bn-IN-TanishaaNeural, bn-IN-BashkarNeural, bn-BD-NabanitaNeural, bn-BD-PradeepNeural
ur ur-PK-UzmaNeural, ur-PK-AsadNeural, ur-IN-GulNeural, ur-IN-SalmanNeural
id id-ID-GadisNeural, id-ID-ArdiNeural
ja ja-JP-NanamiNeural, ja-JP-KeitaNeural
ko ko-KR-SunHiNeural, ko-KR-InJoonNeural
zh-CN zh-CN-XiaoxiaoNeural, zh-CN-YunxiNeural, zh-CN-XiaoyiNeural
zh-TW zh-TW-HsiaoChenNeural, zh-TW-YunJheNeural
vi vi-VN-HoaiMyNeural, vi-VN-NamMinhNeural
pl pl-PL-ZofiaNeural, pl-PL-MarekNeural

成功响应(HTTP 200)

{ "success": true, "job_id": "a3f1c8d2e5b09471...", "mode": "fusion", // "fusion" | "add_audio" | "mix_audio" | "image_to_video" | "overlay_video" | "add_text" | "text_to_mp3" "file_count": 2, "transition": null, "quota_used": 1, "quota_remaining": 9, "status_url": "https://rapidvideomaker.com/api/v1/jobs.php?job_id=a3f1c8..." }
对于 text_to_mp3,响应中没有 file_count 或 transition 字段(未上传任何文件)——其余部分相同:job_id、quota_used、quota_remaining、status_url、webhook_secret。

curl示例 — image_to_video模式

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@scene.jpg" \ -F "videos[]=@narration.mp3" \ -F "mode=image_to_video" \ -F 'options={"text":"Chapter 1","font_size":72,"text_color":"white","text_position":"bottom","box":true,"box_color":"black@0.4","fade_duration":0.5,"width":1080,"height":1920,"image_fit":"contain","bg_color":"black","enable_image_motion":true,"image_motion_effect":"ken_burns","motion_intensity":1.0,"text_effect":"slide_up","text_effect_intensity":1.0}' # image_fit : "contain" | "cover" # background_mode : "solid" | "blur" (blur requires contain) # blur_strength : 1–50, default 20 # bg_color : ignored if image_fit="cover" # enable_image_motion : true = animation on, false (default) = static image # image_motion_effect : zoom_in | zoom_out | pan_left_to_right | pan_right_to_left | pan_top_to_bottom | pan_bottom_to_top | zoom_pan_soft | ken_burns # motion_intensity : 0.25–2.0 — photo animation amplitude (default 1.0) # text_effect : none | fade_in | slide_up | slide_down | slide_left | bounce (ignored if text_mode=word_by_word) # text_effect_intensity : 0.25–2.0 — text animation intensity (default 1.0) # text_border_width : 0–10 px — outline around characters (0 = disabled) # text_border_color : outline color, default "black" (e.g. "#FF3366", "white@0.8") # text_mode : "static" (default) | "word_by_word" — reveal words one by one # word_reveal_speed : 0.3–5.0 w/s — speed for word_by_word mode (default 1.5, ~2.0 for OpenAI TTS) # word_anim : "none" (default) | "fade" — fade-in crossfade on each word (word_by_word only)

带生成语音的卡拉OK文字(image_to_video,无需 MP3)

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@scene.jpg" \ -F "mode=image_to_video" \ -F 'options={"text":"Every word lights up as the voice reads it.","voice":"en-US-AvaNeural","text_mode":"karaoke","karaoke_style":"sweep","highlight_color":"#FFD200","karaoke_lines":2,"text_position":"bottom","font_size":72}' # no MP3: the voice is generated from "text" and gives the timing of every word # text_mode="karaoke" : text up to 1000 characters, shown page by page (karaoke_lines: 1–4) # karaoke_style : "fill" (default) | "sweep" | "highlight" # voice_rate : -50…+50 (%), default 0 # with your own MP3 (no "voice"): karaoke timing is spread over the audio by word length # add_text: same options + "original_volume" (0–2, default 0.3) = original sound under the voice

使用 SRT 文件的卡拉OK(image_to_video + 您的 MP3)

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@cover.jpg" \ -F "videos[]=@song.mp3" \ -F "timings=@lyrics.srt" \ -F "mode=image_to_video" \ -F 'options={"karaoke_style":"sweep","karaoke_lines":2,"text_position":"bottom","font_size":72}' # timings : SRT or LRC file (200 KB max), or its content as a plain text field: -F "timings=<lyrics.lrc" # the displayed text comes from the file ("text" is ignored), text_mode is forced to "karaoke" # not compatible with "voice" (the timings follow your own audio) # add_text: times are relative to the video start, shifted by "text_start"

curl示例 — 音频编辑

# Replace audio (deletes original) curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@my_video.mp4" \ -F "videos[]=@my_music.mp3" \ -F "mode=add_audio" # Keep original audio + overlay MP3 curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@my_video.mp4" \ -F "videos[]=@my_music.mp3" \ -F "mode=mix_audio" \ -F 'options={"mp3_volume":0.7}' # mp3_volume : 0.0 (muted) → 1.0 (original volume, default) → 2.0 (amplified)

curl 示例 — overlay_video 模式

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@main_video.mp4" \ -F "videos[]=@overlay_video.mp4" \ -F "mode=overlay_video" \ -F 'options={"position":"bottom-right","scale":0.25,"opacity":1.0,"margin":20,"audio":"main"}' # Green screen overlay curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@main_video.mp4" \ -F "videos[]=@webcam_greenscreen.mp4" \ -F "mode=overlay_video" \ -F 'options={"position":"bottom-left","scale":0.35,"chroma_key":true,"chroma_similarity":0.15,"audio":"mix"}' # position : top-left | top-right | bottom-left | bottom-right | center (default: bottom-right) # scale : 0.05–1.0 — overlay width as fraction of main video (default 0.30) # opacity : 0.0–1.0 — overlay transparency (default 1.0) # margin : 0–200 px — gap from frame edge, ignored if center (default 10) # audio : main | overlay | mix — audio to keep (default: main) # chroma_key : true | false — remove green (#00FF00) background from overlay (default false) # chroma_similarity : 0.01–0.60 — green screen tolerance (default 0.20)

curl 示例 — add_text 模式

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@my_video.mp4" \ -F "mode=add_text" \ -F 'options={"text":"Hello world","text_position":"bottom","font_size":72,"text_color":"#ffd700","text_start":2,"text_duration":5,"text_effect":"slide_up"}' # text : required, 1–200 characters # text_start : second at which the text appears (default 0) # text_duration : seconds the text stays visible, 0 = until the end (default 0) # the video keeps its resolution, frame rate and audio track

curl示例 — 视频合并

curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@clip1.mp4" \ -F "videos[]=@clip2.mp4" \ -F "transition_type=fade" \ -F "transition_duration=0.5"

curl 示例 — text_to_mp3 模式

# No file upload — text + lang + voice as plain form fields curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "mode=text_to_mp3" \ -F "text=Welcome to Rapid Video Maker." \ -F "lang=en" \ -F "voice=en-US-AvaNeural" \ -F "slow=false" # voice omitted or invalid -> falls back to the first voice of "lang" curl -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "mode=text_to_mp3" \ -F "text=Bienvenue sur Rapid Video Maker." \ -F "lang=fr"
GET /api/v1/jobs.php?job_id=<hex32> 任务状态

状态包含实际阶段和已用时间。估计仅供参考;客户端超时不代表任务失败。请继续查询同一任务ID。文件在完成两小时后到期。

可能的状态

状态含义额外字段
queued 在队列中,尚未处理 queue_position, queue_total, eta_minutes
processing FFmpeg处理中 processing_stage, processing_elapsed_seconds, stage_elapsed_seconds, last_activity_at, processed_media_seconds, eta_overrun
ready 已完成 — 文件可用 download_url, media_available, created_at, expires_at
error 处理失败 error (message), quota_refund_status: pending | confirmed | not_required
cancelled 已取消 quota_refund_status: pending | confirmed | not_required

按状态的响应

{ "job_id": "a3f1c8...", "status": "queued", "queue_position": 2, "queue_total": 3, "eta_minutes": 7 }
{ "job_id": "a3f1c8...", "status": "ready", "download_url": "https://rapidvideomaker.com/api/download.php?job_id=a3f1c8...", "created_at": "2026-06-02T10:00:00+00:00", "expires_at": "2026-06-02T12:00:00+00:00" }

curl示例

curl -H "Authorization: Bearer rvm_your_token" \ "https://rapidvideomaker.com/api/v1/jobs.php?job_id=a3f1c8..."
GET /api/v1/jobs.php 列出使用此令牌创建的所有任务(分页,按日期倒序)

公共参数(multipart/form-data)

参数类型默认值描述
pageinteger1页码(从 1 开始)
limitinteger20每页结果数(最多 50,默认 20)

按状态的响应

{ "success": true, "jobs": [ { "job_id": "a3f1c8...", "status": "ready", "mode": "fusion", "created_at": "2026-06-02T10:00:00+00:00", "expires_at": "2026-06-02T12:00:00+00:00", "download_url": "https://..." }, ... ], "total": 12, "page": 1, "limit": 20 }
GET /api/download.php?job_id=<hex32> 下载最终文件

以流的形式传输最终文件。视频模式的Content-Type为video/mp4,text_to_mp3为audio/mpeg。不需要令牌。仅在状态为ready时可用。

文件在任务完成后保留2小时,然后删除。状态变为ready后请立即下载。

可选参数

参数描述
filename下载文件的建议名称(例如:my-video.mp4)
preview设置为1可内联播放(省略Content-Disposition: attachment)而不是触发下载——用于浏览器内预览。

curl示例

curl -o "output.mp4" \ "https://rapidvideomaker.com/api/download.php?job_id=a3f1c8...&filename=output.mp4"

Webhooks

Webhook是轮询的替代方案:不是每隔X秒检查状态,而是提供URL,服务器在任务完成时自动通知您。

工作原理

  1. 在POST到/api/v1/render.php时传入callback_url
  2. 响应包含webhook_secret — 保存它以验证签名
  3. 当任务达到ready或error时,服务器向您的URL发送签名的JSON POST
  4. 使用HMAC-SHA256(webhook_secret, raw_body)验证签名
约束:callback_url必须是可公开访问的URL(http或https)。私有、回环和保留IP地址在服务器端被阻止。超时:10秒。

接收到的有效载荷

{ "job_id": "a3f1c8...", "status": "ready", "download_url": "https://rapidvideomaker.com /api/download.php?job_id=a3f1c8...", "timestamp": "2026-04-04T12:00:00+00:00" }
{ "job_id": "a3f1c8...", "status": "error", "error": "FFmpeg xfade failed:...", "timestamp": "2026-04-04T12:00:00+00:00" }

服务器发送的标头

标头值
Content-Typeapplication/json
X-RVM-Signaturesha256=<hmac_hex> — 原始主体的HMAC-SHA256签名
X-RVM-Job-Id相关的job_id

签名验证

# Python import hmac, hashlib def verify_webhook(secret: str, body: bytes, signature_header: str) -> bool: expected = "sha256=" + hmac.new( secret.encode(), body, hashlib.sha256 ).hexdigest() return hmac.compare_digest(expected, signature_header) # Flask/FastAPI endpoint: sig = request.headers.get("X-RVM-Signature", "") if not verify_webhook(WEBHOOK_SECRET, request.data, sig): return "Invalid signature", 403 data = request.get_json()

错误代码

HTTPJSON代码原因
401unauthorized令牌缺失、无效或已撤销
400missing_files未收到文件
400too_few_files发送的文件少于2个
400too_many_files发送的文件超过20个
400invalid_mime不支持的文件 — 仅接受MP4、MP3和JPG/PNG
400wrong_file_count文件数量与所选模式不匹配
400wrong_file_types文件类型与所选模式不匹配
400invalid_file_combination没有指定模式的文件组合不匹配任何支持的模式
400invalid_optionsoptions字段不是有效的JSON
400invalid_optionoptions中的某个值无效
400file_too_large文件超过500 MB
400text_required缺少 options.text 字段或其为空(add_text 模式)
400video_too_long视频超过 15 分钟(add_text 模式)
400text_start_out_of_rangetext_start 超出视频结尾
400invalid_voice未知的 voice ID。
400invalid_timings无法读取时间轴文件(格式无法识别、没有带时间的行、结束早于开始、过长等)。
400invalid_orderorder数组不是有效的排列
400invalid_job_idjob_id格式不正确(必须是32个字符的十六进制)
404job_not_found未找到任务 — job_id未知或从未存在
410job_expired任务已过期 — 曾经存在但2小时恢复窗口已过
429quota_exceeded已达到每天20个成功任务的限制
429rate_limited/api/v1/jobs.php每分钟超过12次调用
500server_error内部服务器错误

集成示例

各模式示例 — 使用pip install requests安装requests。

公共配置

import requests, time, sys, json API_BASE = "https://rapidvideomaker.com" API_TOKEN = "rvm_your_token_here" HEADERS = {"Authorization": f"Bearer {API_TOKEN}"}

image_to_video模式 — 图像 + 音频 → 视频

with open("scene.jpg", "rb") as fi, open("narration.mp3", "rb") as fa: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[ ("videos[]", ("scene.jpg", fi, "image/jpeg")), ("videos[]", ("narration.mp3", fa, "audio/mpeg")), ], data={ "mode": "image_to_video", "options": json.dumps({ "text": "Chapter 1", "font_size": 72, "text_color": "white", "text_position": "bottom", "box": True, "box_color": "black@0.4", "fade_duration": 0.5, "width": 1080, "height": 1920, "image_fit": "contain", # "contain" | "cover" "background_mode": "solid", # or "blur" with contain "blur_strength": 20, "bg_color": "black", # ignored if image_fit="cover" "enable_image_motion": True, "image_motion_effect": "ken_burns", "motion_intensity": 1.0, # 0.25–2.0 — photo animation amplitude "text_effect": "slide_up", # none | fade_in | slide_up | slide_down | slide_left | bounce (ignored if text_mode=word_by_word) "text_effect_intensity": 1.0, # 0.25–2.0 — text animation intensity # word-by-word reveal (mutually exclusive with text_effect): # "text_mode": "word_by_word", "word_reveal_speed": 2.0, "word_anim": "fade" }), }, )

音频编辑

# Replace audio (deletes original) — mode=add_audio with open("video.mp4", "rb") as fv, open("music.mp3", "rb") as fa: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[ ("videos[]", ("video.mp4", fv, "video/mp4")), ("videos[]", ("music.mp3", fa, "audio/mpeg")), ], data={"mode": "add_audio"}, ) # Keep original audio + overlay MP3 — mode=mix_audio with open("video.mp4", "rb") as fv, open("music.mp3", "rb") as fa: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[ ("videos[]", ("video.mp4", fv, "video/mp4")), ("videos[]", ("music.mp3", fa, "audio/mpeg")), ], data={"mode": "mix_audio", "options": json.dumps({"mp3_volume": 0.7})}, # mp3_volume : 0.0 = muted, 1.0 = original volume (default), 2.0 = amplified )

overlay_video 模式 — 画中画

with open("main.mp4", "rb") as fm, open("overlay.mp4", "rb") as fo: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[ ("videos[]", ("main.mp4", fm, "video/mp4")), ("videos[]", ("overlay.mp4", fo, "video/mp4")), ], data={ "mode": "overlay_video", "options": json.dumps({ "position": "bottom-right", # top-left | top-right | bottom-left | bottom-right | center "scale": 0.25, # 0.05–1.0 — overlay width fraction "opacity": 1.0, # 0.0–1.0 — transparency "margin": 20, # 0–200 px — gap from frame edge "audio": "main", # main | overlay | mix # green screen: "chroma_key": True, "chroma_similarity": 0.15 }), }, )

add_text 模式 — 在视频上添加文字

with open("video.mp4", "rb") as fv: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[("videos[]", ("video.mp4", fv, "video/mp4"))], data={ "mode": "add_text", "options": json.dumps({ "text": "Hello world", # required "text_position": "bottom", # center | top | bottom "font": "amiri", # font id (see the table above) "font_size": 72, "text_start": 2, # appears at 2 s "text_duration": 5, # stays 5 s (0 = until the end) }), }, )

视频合并

with open("clip1.mp4", "rb") as f1, open("clip2.mp4", "rb") as f2: resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, files=[ ("videos[]", ("clip1.mp4", f1, "video/mp4")), ("videos[]", ("clip2.mp4", f2, "video/mp4")), ], data={"transition_type": "fade", "transition_duration": "0.5"}, )

text_to_mp3 模式 — 文本转语音

# No files — text + lang (+ optional voice / slow) as form fields resp = requests.post( f"{API_BASE}/api/v1/render.php", headers=HEADERS, data={ "mode": "text_to_mp3", "text": "Welcome to Rapid Video Maker.", "lang": "en", # one of the 20 site language codes "voice": "en-US-AvaNeural", # optional — falls back to the first voice of "lang" "slow": "false", # "true" = -25% speech rate }, )

轮询 + 下载(所有模式通用)

resp.raise_for_status() job_id = resp.json()["job_id"] print(f"Job created: {job_id}") for _ in range(120): # timeout 10 min (120 × 5s) r = requests.get( f"{API_BASE}/api/v1/jobs.php", headers=HEADERS, params={"job_id": job_id}, ) data = r.json() status = data["status"] if status == "queued": pos = data.get("queue_position", "?") eta = data.get("eta_minutes", "?") print(f"Queued — position {pos}, ETA ~{eta} min") elif status == "processing": print("Processing…") elif status == "ready": download_url = data["download_url"] break elif status == "error": sys.exit(f"Error: {data.get('error')}") time.sleep(5) else: sys.exit("Timeout: job not completed after 10 min") r = requests.get(download_url, stream=True) with open("output.mp4", "wb") as f: for chunk in r.iter_content(65536): f.write(chunk) print("Downloaded: output.mp4")

n8n中的两种方法:轮询(状态循环)或Webhook(服务器调用n8n)。推荐Webhook。

方法A — Webhook(推荐)

仅3个节点,无循环。

节点1 — Webhook触发器
添加Webhook节点作为工作流输入(方法POST)。

节点2 — 创建任务(HTTP请求)

方法POST
URLhttps://rapidvideomaker.com/api/v1/render.php
认证Header Auth — Authorization: Bearer rvm_…
请求体内容类型Form-Data Multipart
Body params每个剪辑的二进制字段videos[] + 文本字段callback_url

将响应中的webhook_secret保存在工作流变量中以验证签名。

节点3 — 处理结果(在Webhook触发的工作流中)
当n8n收到服务器的POST时,$json.status为ready或error。

验证签名:将{{ $headers['x-rvm-signature'] }}与您的webhook_secret的HMAC-SHA256进行比较。

方法B — 轮询(无Webhook)

5个节点,每10秒状态循环。

节点1 — 创建任务 — 同上配置,无callback_url。

节点2 — 等待 — 10秒。

节点3 — 轮询状态(HTTP请求GET)

URLhttps://rapidvideomaker.com/api/v1/jobs.php
查询参数job_id = {{ $('节点1').item.json.job_id }}
认证标头认证 — 相同令牌

节点4 — If:{{ $json.status }} === 'ready' → true:节点5 / false:返回节点2。

在Set节点中添加迭代计数器,以在60次尝试后退出循环,避免无限循环。

节点5 — 下载:在{{ $json.download_url }}上发起HTTP请求GET。

步骤1 — 创建任务(选择模式)

# fusion JOB=$(curl -s -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@clip1.mp4" -F "videos[]=@clip2.mp4") # add_audio (replace audio) JOB=$(curl -s -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@video.mp4" -F "videos[]=@music.mp3" \ -F "mode=add_audio") # mix_audio (overlay music at 70% volume) JOB=$(curl -s -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@video.mp4" -F "videos[]=@music.mp3" \ -F "mode=mix_audio" -F 'options={"mp3_volume":0.7}') # image_to_video JOB=$(curl -s -X POST https://rapidvideomaker.com/api/v1/render.php \ -H "Authorization: Bearer rvm_your_token" \ -F "videos[]=@scene.jpg" -F "videos[]=@narration.mp3" \ -F "mode=image_to_video" \ -F 'options={"text":"Chapter 1","font_size":72,"text_position":"bottom","fade_duration":0.5,"width":1080,"height":1920}') JOB_ID=$(echo $JOB | grep -o '"job_id":"[^"]*"' | cut -d'"' -f4) echo "Job ID: $JOB_ID"

步骤2 — 轮询

while true; do STATUS=$(curl -s \ -H "Authorization: Bearer rvm_your_token" \ "https://rapidvideomaker.com/api/v1/jobs.php?job_id=$JOB_ID") STATE=$(echo $STATUS | grep -o '"status":"[^"]*"' | cut -d'"' -f4) echo "Status: $STATE" [ "$STATE" = "ready" ] && break [ "$STATE" = "error" ] && { echo "Error"; exit 1; } sleep 10 done

步骤3 — 下载

DOWNLOAD_URL=$(echo $STATUS | grep -o '"download_url":"[^"]*"' | cut -d'"' -f4) curl -o output.mp4 "$DOWNLOAD_URL"

最佳实践

结果文件在任务完成后保留2小时,之后自动删除。