# 快速开始

这是从零写出一个可用 v2 文档的最快路径。

## 1. 最小结构

先从这个骨架开始：

```json
{
  "meta": {
    "version": "2.0.0",
    "width": 1920,
    "height": 1080,
    "fps": 30,
    "background": "#0b1020"
  },
  "tracks": [
    {
      "id": "main",
      "clips": []
    }
  ]
}
```

必填项：

- `meta.version`
- `meta.width`
- `meta.height`
- `meta.fps`
- `tracks`

## 2. 添加第一个可见元素

```json
{
  "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. 第一个完整示例

```json
{
  "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 的终端中运行：

```bash
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，可将其粘贴到[演练场](https://renderingvideo.com/playground)。需要导出 MP4 时，使用自己的 [API Key](https://renderingvideo.com/settings/apikeys) 调用[需鉴权的 API](https://renderingvideo.com/docs/api-reference.md)。渲染会消耗账号积分，提交渲染前请查看[价格](https://renderingvideo.com/pricing)。

## 5. 接下来怎么学

- 想理解整体结构：看 [基础概念](https://renderingvideo.com/docs/tutorials/basic-concepts.md)
- 想先做一个文字动画：看 [创建文字动画](https://renderingvideo.com/docs/tutorials/create-text-animation.md)
- 想查字段规范：看 [JSON 结构与字段规范](https://renderingvideo.com/docs/json-spec.md)