# rewriteVideoTokens

**Kind:** Function

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-13-upload/video-directive.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-13-upload/video-directive.ts#L156)

Rewrite all `[[VIDEO:]]` / `[[GIF:]]` tokens in a page's content and collect the
per-page ManualVideoGroup rows. Unresolved tokens are dropped (no raw token
ever reaches the reader). Idempotent for already-rewritten content (no tokens
left → no-op).

## Signature

```ts
function rewriteVideoTokens(content: string, opts: RewriteVideoOptions): RewriteVideoResult
```

## Parameters

| Name | Type |
|---|---|
| `content` | `string` |
| `opts` | `RewriteVideoOptions` |

**Returns:** `RewriteVideoResult`
