快速开始
这是从零写出一个可用 v2 文档的最快路径。
1. 最小结构
先从这个骨架开始:
{
"meta": {
"version": "2.0.0",
"width": 1920,
"height": 1080,
"fps": 30,
"background": "#0b1020"
},
"tracks": [
{
"id": "main",
"clips": []
}
]
}
必填项:
meta.versionmeta.widthmeta.heightmeta.fpstracks
2. 添加第一个可见元素
{
"type": "text",
"start": 0,
"duration": 3,
"text": "Hello, world",
"transform": {
"x": "50%",
"y": "50%"
},
"style": {
"fontSize": 72,
"fontWeight": 700,
"fill": "#ffffff",
"textAlign": "center"
}
}
把这段 clip 放进 tracks[0].clips。
3. 第一个完整示例
{
"meta": {
"version": "2.0.0",
"title": "My First Video",
"width": 1920,
"height": 1080,
"fps": 30,
"background": "#0b1020"
},
"tracks": [
{
"id": "main",
"clips": [
{
"type": "text",
"start": 0,
"duration": 3,
"text": "Hello, world",
"transform": {
"x": "50%",
"y": "50%"
},
"style": {
"fontSize": 72,
"fontWeight": 700,
"fill": "#ffffff",
"textAlign": "center"
},
"animations": [
{
"type": "fadeIn",
"duration": 0.5
}
]
}
]
}
]
}
4. 打开第一个可播放预览
把上方完整 JSON 保存为 first-video.json。在已安装 curl 的终端中运行:
curl --fail-with-body https://video.renderingvideo.com/api/preview \
--header 'Content-Type: application/json' \
--data-binary @first-video.json
响应包含相对地址 url,例如 /t/…。在浏览器中打开 https://video.renderingvideo.com 加上该地址。这个公开预览无需账号或 API Key。临时链接的有效期以响应中的 expiresIn 为准,通常为 7 天。
此预览不会生成可下载的 MP4 文件。想在浏览器中继续编辑这份 JSON,可将其粘贴到演练场。需要导出 MP4 时,使用自己的 API Key 调用需鉴权的 API。渲染会消耗账号积分,提交渲染前请查看价格。
5. 接下来怎么学
- 想理解整体结构:看 基础概念
- 想先做一个文字动画:看 创建文字动画
- 想查字段规范:看 JSON 结构与字段规范