# Character Nameplate

**What**：Burn 1-4 lower-third nameplates (character name + role subtitle, each with its own time window) into the video. Video is re-encoded, the audio track is stream-copied, and resolution / frame rate / SAR stay identical to the source.

**When**：Use to introduce a character on first appearance. Each nameplate takes an appearance time (startMs) and a display length (durationMs); slot controls vertical stacking (0 is lowest). No escaping needed — colons, quotes, percent signs render as-is. Title and subtitle are single-line, <=64 chars each (no auto-wrap). A CJK font is built in, nothing to configure. The output keeps the source spec, so it still joins un-nameplated clips via concat's zero-re-encode fast path.

## Endpoints
- POST `/v1/ffmpeg/jobs`
- GET `/v1/ffmpeg/jobs/{id}`

> This page uses the unified API: create with `POST /v1/ffmpeg/jobs` (`operation` names the operation), poll with `GET /v1/ffmpeg/jobs/{id}`. File upload still uses `POST /v1/ffmpeg/upload`.

Poll `GET /v1/ffmpeg/jobs/{id}` until `status` is `completed` or `failed`; a failed job is still HTTP 200 with `error`.

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| input_url | string | Yes | Input media URL on a trusted allowlist domain (platform CDN or a trusted-source CDN); upload first to obtain one, or use an asset URL already on a trusted CDN |
| overlays | object[] | Yes | Nameplate array, 1-4 items; each { style: style name (currently only nameplate), startMs: appearance time in ms (>=0), durationMs: display length in ms (>0), slot: vertical slot 0-3 (default 0, no duplicates within one request), title: character name (required, single line <=64 chars), subtitle: role subtitle (optional, single line <=64 chars), align: horizontal alignment (optional, left / right / center, default left; title and subtitle align together, right uses the same margin as left) }. A window past the video end is clamped to the tail; an item starting after the end is silently dropped |
| webhook_url | string | — | Completion webhook URL (optional) |

Fields other than `operation` are the operation parameters; input slots use snake_case (`input_url`, `input_urls`, `image_url`, `audio_url`, `audio_urls`, `subtitle_url`, `webhook_url`); the old camelCase names are still accepted.

## Request example
```bash
curl https://api.novapi.ai/v1/ffmpeg/jobs \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "operation": "overlay_text",
  "input_url": "https://cdn.novapi.ai/veo31/1788164205419_de868f9d69d445baaf577d42e87a236f.mp4",
  "overlays": [
    {
      "style": "nameplate",
      "startMs": 400,
      "durationMs": 2400,
      "slot": 0,
      "title": "林晚",
      "subtitle": "医者"
    },
    {
      "style": "nameplate",
      "startMs": 400,
      "durationMs": 2400,
      "slot": 1,
      "title": "陈舟"
    }
  ]
}'
```

```python
import os, requests

r = requests.post(
    "https://api.novapi.ai/v1/ffmpeg/jobs",
    headers={"Authorization": "Bearer " + os.environ["API_KEY"]},
    json={
        "operation": "overlay_text",
        "input_url": "https://cdn.novapi.ai/veo31/1788164205419_de868f9d69d445baaf577d42e87a236f.mp4",
        "overlays": [
            {
                "style": "nameplate",
                "startMs": 400,
                "durationMs": 2400,
                "slot": 0,
                "title": "林晚",
                "subtitle": "医者",
            },
            {
                "style": "nameplate",
                "startMs": 400,
                "durationMs": 2400,
                "slot": 1,
                "title": "陈舟",
            },
        ],
    },
)
print(r.json())  # poll GET /v1/ffmpeg/jobs/{id} until status is completed
```

```ts
const resp = await fetch("https://api.novapi.ai/v1/ffmpeg/jobs", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "operation": "overlay_text",
    "input_url": "https://cdn.novapi.ai/veo31/1788164205419_de868f9d69d445baaf577d42e87a236f.mp4",
    "overlays": [
      {
        "style": "nameplate",
        "startMs": 400,
        "durationMs": 2400,
        "slot": 0,
        "title": "林晚",
        "subtitle": "医者"
      },
      {
        "style": "nameplate",
        "startMs": 400,
        "durationMs": 2400,
        "slot": 1,
        "title": "陈舟"
      }
    ]
  }),
});
console.log(await resp.json()); // poll GET /v1/ffmpeg/jobs/{id} until status is completed
```

## Response example
```json
{
  "id": "<job-id>",
  "object": "ffmpeg.job",
  "operation": "overlay_text",
  "status": "queued",
  "progress": 0,
  "cost": 0
}
```

```json
{
  "id": "<job-id>",
  "object": "ffmpeg.job",
  "operation": "overlay_text",
  "status": "completed",
  "progress": 100,
  "result_url": "https://...",
  "cost": <points>
}
```

```bash
curl https://api.novapi.ai/v1/ffmpeg/jobs/<job-id> \
  -H "Authorization: Bearer $API_KEY"
```
