> ## Documentation Index
> Fetch the complete documentation index at: https://rendermate.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from JSON2Video

> Move JSON2Video movies to Rendermate: media, scenes and elements as documents, variables, voice-overs and subtitles, renders, webhooks and hosting, step by step.

A JSON2Video movie is a JSON list of scenes, each with elements such as video, images, text, voice
and subtitles, rendered to an MP4. A Rendermate video is a [document](https://rendermate.com/docs/documents.md): the same
content as JSX nodes on one timeline, versioned like a git repository and rendered on Rendermate's
GPUs. This guide moves a JSON2Video integration over in the order you'd do it: media first, then
each movie, then rendering and delivery.

***

## (1) How do I move my media to Rendermate?

Every file a document uses is a file in your workspace. A movie reads its media from URLs, so
import each one with `import_asset` (`POST /v1/imports`):

```bash theme={null}
curl https://api.rendermate.com/v1/imports \
  -H "Authorization: Bearer $RENDERMATE_API_KEY" \
  --json '{ "url": "https://example.com/video.mp4", "name": "launch/video.mp4" }'
```

For files on your computer, the [CLI](https://rendermate.com/docs/cli.md) keeps a folder in step with one in your workspace:

```bash theme={null}
rendermate login
rendermate sync ./media
```

A document then refers to each file as `asset://<name>`. Text in a document is drawn with font files
in the workspace, so upload a `.ttf` or `.otf` for each `font-family` you use.

***

## (2) How do I rebuild a movie as a document?

### (A) Let your coding agent migrate it

Connect your agent to `https://api.rendermate.com/mcp` ([Claude Code](https://rendermate.com/docs/mcp/claude-code.md),
[Cursor](https://rendermate.com/docs/mcp/cursor.md)) and give it one of your movie JSON files. It writes the document with
`create_document` and `edit_document` and checks each moment with `get_frame`, following the
mapping below.

### (B) Write the documents with the API

Create a document with `POST /v1/documents`, read its `jsx` with `GET /v1/documents/{id}`, and
commit your nodes with `POST /v1/documents/{id}/versions`.
[How do I edit a document?](https://rendermate.com/docs/documents.md#how-do-i-edit-a-document) shows the request. An empty
document is 10 seconds of 1920×1080 at 30 fps; set its `canvas` in the same edit.

### How does a movie map onto a document?

| JSON2Video | | Rendermate |
| - | - | - |
| `resolution`, or `width` and `height` | → | `canvas.width`, `canvas.height` |
| The movie's length | → | `canvas.duration`, in seconds |
| `scenes` | → | Nodes placed one after another on the timeline |
| Movie-level `elements` | → | Nodes that run the whole `canvas.duration` |
| A scene's `background-color` | → | A `<fill>` node for that scene's time |

### How do scenes become one timeline?

Scenes play one after another, and each element's `start` counts from its scene's start. In a
document every node's `start` counts from the start of the video, so add the lengths of the scenes
before it: an element with `start: 1` in a scene that begins at 12 seconds has
`common.start: 13`. A `sequence` node also plays its children one after another.

| JSON2Video | | Rendermate |
| - | - | - |
| An element's `start` | → | `common.start`: the scene's start plus the element's `start` |
| `duration` in seconds | → | `common.duration` |
| `duration: "container"` | → | The scene's length minus the element's `start` |
| `duration: "auto"` | → | The file's own length, in seconds |
| `extra-time` | → | Added to `common.duration` |
| `z-index`, or later in the array | → | `common.order` keys: `"a0"` paints under `"a1"` |

[How do order keys work?](https://rendermate.com/docs/documents.md#how-do-order-keys-work) explains the keys.

### How do elements map?

| JSON2Video element | | Rendermate node |
| - | - | - |
| `video` | → | `<media>` with an asset from `assets.media` |
| `image` | → | `<media>` with an asset from `assets.images` |
| `text` with `font-family`, `font-size`, `font-color` | → | `<text>` with `paragraph` content and a style's `fontId`, `fontSize`, `color` |
| `text-align` | → | The paragraph's `align` |
| `audio` with `volume` | → | `<audio>` with `gain` |
| `x`, `y`, `width`, `height` | → | A `media` node's `destination`, in the same pixels from the top-left corner |
| `voice` | → | A speech model's audio, as an `<audio>` node (step 4) |
| `subtitles` | → | A transcript's words, as `<text>` nodes (step 4) |

Positions carry over as they are: both measure pixels from the top-left corner.
[The documents page](https://rendermate.com/docs/documents.md#how-do-i-show-a-video-or-an-image) has a complete example of each
node.

***

## (3) How do I replace templates and variables?

Your code writes the values into the JSX. Keep your movie as a JSX string with placeholders for
your `variables`, fill them in, and send the result:

* **One video per record:** call `create_document` with the filled-in `jsx`.
* **A change to one video:** commit an `edits` replacement, such as the title's text, on the version
  you read.
* **A `condition`:** leave the node out of the JSX when its condition is false, or use a visibility
  condition such as `{a > b && <shape … />}`.

Every edit is a new version that stays readable, with its author and message.

***

## (4) How do I move voice-overs and subtitles?

Call the model through `create_generation` (`POST /v1/generations`), at the provider's own price.
Its output is saved as an asset, ready for a document's `assets`:

| JSON2Video | | Rendermate |
| - | - | - |
| A `voice` element with Azure or ElevenLabs | → | A speech model, such as `elevenlabs/v4` or `assemblyai/tts-1`, with the text as its prompt and `voice` as a param |
| A `subtitles` element | → | A transcription model, such as `assemblyai/universal-2`, then `text` nodes |

```bash theme={null}
curl https://api.rendermate.com/v1/generations \
  -H "Authorization: Bearer $RENDERMATE_API_KEY" \
  --json '{ "model": "assemblyai/tts-1", "prompt": "Welcome to the launch.", "output": "launch/voice.mp3" }'
```

A transcript has every word with its start and end time; write each line as a `text` node starting
at its first word. [Models](https://rendermate.com/docs/models.md) lists every model, with its inputs and params.

***

## (5) How do I render, get notified and host the video?

| JSON2Video | | Rendermate |
| - | - | - |
| `POST /v2/movies` | → | `create_export` (`POST /v1/exports`) with the document and a version |
| `GET /v2/movies?project=…` | → | `get_export` (`GET /v1/exports/{id}`) |
| A webhook in `exports` | → | [Webhooks](https://rendermate.com/docs/webhooks.md): `export.succeeded` and `export.failed` |
| The movie's `url` | → | The export's `download_url` |
| FTP, SFTP, email or S3 in `exports` | → | Your code copies the file from `download_url` |
| Hosting the MP4 | → | A link (`create_link`): a page, an embed and HLS playback |

Exporting a version again reuses what was already rendered. A link plays one fixed version, or
follows `latest`, so it plays each new version as you commit it, for as long as the link lives. It
can autoplay, show controls, expire and ask for a password, and its pages can be on
[your own domain](https://rendermate.com/docs/custom-domains.md).

***

## (6) How do I switch over?

### (A) All at once

For a few kinds of movie, rebuild each one as a document, check it with `get_frame`, and switch your
code from `POST /v2/movies` to `create_export` in one release.

### (B) One kind of movie at a time

For a larger integration, keep rendering with JSON2Video while you move one kind of movie over:

1. Rebuild it as a document.
2. Compare a frame of your JSON2Video render with `get_frame` at the same time.
3. Switch the code that renders it to `create_export`, and its webhook handler to
   `export.succeeded`.
4. Move on to the next.

***

## Next steps

* [Documents](https://rendermate.com/docs/documents.md): every node, keyframes, assets and errors.
* [Webhooks](https://rendermate.com/docs/webhooks.md): verify and handle `export.succeeded`.
* [Models](https://rendermate.com/docs/models.md): every model `create_generation` can call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.