> ## 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 Mux

> Move a Mux Video library to Rendermate: download each asset, make it a document with a link, and replace playback IDs, stream and image URLs, direct uploads, captions and webhooks, step by step.

A Mux asset is a video you uploaded, encoded and streamed from its playback IDs. In Rendermate, a
video plays from a [document](https://rendermate.com/docs/documents.md) through a link: the document holds the video as a
`media` node, and the link gives it a page, an embed, HLS playback, thumbnails and storyboards. This
guide moves a Mux library over in the order you'd do it: the files first, then playback, then
uploads and events.

***

## (1) How do I get my videos out of Mux?

Download each asset as an MP4 and import it into your workspace. Mux serves an MP4 once the asset
has a static rendition, so add one to each asset you move:

```bash theme={null}
curl https://api.mux.com/video/v1/assets/$ASSET_ID/static-renditions \
  -u "$MUX_TOKEN_ID:$MUX_TOKEN_SECRET" \
  --json '{ "resolution": "highest" }'
```

When `video.asset.static_rendition.ready` arrives, import the file with `import_asset`
(`POST /v1/imports`), named after the asset:

```bash theme={null}
curl https://api.rendermate.com/v1/imports \
  -H "Authorization: Bearer $RENDERMATE_API_KEY" \
  --json '{ "url": "https://stream.mux.com/'$PLAYBACK_ID'/highest.mp4", "name": "library/'$ASSET_ID'.mp4" }'
```

For a playback ID with the `signed` policy, add `?token=` with a token signed for it. An import
takes files up to 5 GB; call `get_import` until its status is `succeeded`. To move a whole
library, page through `GET /video/v1/assets` and do this for each asset.

***

## (2) How do I make each video playable?

Create a document that plays the file from start to end, then make a link to it.

### (A) Let your coding agent move the library

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)) with your Mux credentials in its environment. It lists your Mux assets,
imports each file, and calls `create_document` and `create_link` for it, following the steps below.

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

Create a document with `create_document` (`POST /v1/documents`), with the asset's `meta.title` as
its `name`, then commit its nodes with `edit_document` (`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. In the same
edit, set the `canvas`'s `width`, `height` and `duration` to the asset's video track size and its
`duration` from `GET /video/v1/assets/{ASSET_ID}`, and add one `media` node that runs the whole
video:

```jsx theme={null}
export const assets = {
  media: [{id: "video", source: {type: "uri", uri: "asset://library/ASSET_ID.mp4"}}],
};

// Inside <timeline>:
<media
  id="video"
  common={{start: 0, duration: 63.48, order: "a0"}}
  assetId="video"
  destination={{x: 0, y: 0, width: 1920, height: 1080}}
  fit="contain"
  sampling={{filter: "linear", mipmap: "linear"}}
/>
```

The video plays its own sound. Then call `create_link`
(`POST /v1/documents/{id}/links`): the link works as soon as it's made, and its segments render as
they're first watched.

### How do Mux's assets and playback IDs map?

| Mux | | Rendermate |
| - | - | - |
| An asset | → | A document with the video as a `media` node |
| A playback ID | → | A link (`create_link`) |
| `playback_policies: ["public"]` | → | A link without a password |
| `playback_policies: ["signed"]` and signed tokens | → | A link with `expires_at` or a `password`, or the signed URLs `get_link_playback` answers |
| `passthrough`, `meta.title` | → | The document's `name`, and your own record of its `id` |
| `max_resolution_tier` | → | The document's `canvas` size: links stream a ladder up to 4K |
| A clip from `mux://assets/{id}` with `start_time` and `end_time` | → | A document whose `media` node has `sourceIn` and `common.duration` |
| A watermark | → | A `<media>` node from `assets.images` on top, with a later `common.order` key |
| Deleting an asset | → | `revoke_link`, and `delete_asset` for the file |

***

## (3) How do I replace playback URLs?

Read a link's URLs from `get_link` and `get_link_playback`, and put them where your code built Mux
URLs:

| Mux | | Rendermate |
| - | - | - |
| `https://stream.mux.com/{PLAYBACK_ID}.m3u8` | → | `get_link_playback`'s `playlist_url`, signed until its `expires_at` |
| `https://player.mux.com/{PLAYBACK_ID}` in an iframe | → | The link's `embed_url` |
| A page that plays the video | → | The link's `url` |
| `image.mux.com/…/thumbnail.jpg?time=&width=&height=` | → | `poster_url`, with `time`, `width` and `height` in its query, ending in `.png` or `.webp` for those formats |
| `image.mux.com/…/animated.gif?start=&end=` | → | `poster_url` with `thumbnail.jpg` changed to `animated.gif`, and `start`, `end`, `width`, `height` and `fps` |
| `image.mux.com/…/storyboard.vtt` | → | `storyboard_url`, with `storyboard.json` for the same as JSON |
| `stream.mux.com/…/highest.mp4` | → | `create_export`'s `download_url` (step 5) |
| A custom domain for streaming | → | [Custom domains](https://rendermate.com/docs/custom-domains.md) for the link's pages |

Mux Player, `<mux-video>` and Video.js play any HLS playlist, so `playlist_url` works in them as
it is; ask `get_link_playback` again for new URLs before `expires_at`. The `embed_url` plays the
video with Rendermate's player and needs no setup.

***

## (4) How do I replace direct uploads?

Make an upload token where you made a Mux direct upload, and upload the file with it:

| Mux | | Rendermate |
| - | - | - |
| `POST /video/v1/uploads` | → | `create_upload_token` (`POST /v1/upload-tokens`) with a `prefix` such as `uploads/u_42/` |
| `timeout` | → | `expires_in`, 60 to 86400 seconds |
| The upload's `url` and UpChunk | → | `PUT /v1/assets/{name}` with the token; files over 100 MiB upload in parts |
| `new_asset_settings` | → | Your code creates the document and link when the upload finishes |
| `video.upload.asset_created` | → | The `asset.created` webhook |

An upload token only records assets whose names start with its prefix, up to its `max_size`, so a
browser uploads without ever holding your API key.

***

## (5) How do I move captions, downloads and AI features?

| Mux | | Rendermate |
| - | - | - |
| `generated_subtitles` | → | A transcription model, such as `assemblyai/universal-2`, then `text` nodes in the document |
| A text track from an SRT or WebVTT file | → | A `text` node per cue, from its start to its end |
| Dubbing | → | `elevenlabs/dubbing-v2`, then the dubbed file as the document's video |
| `static_renditions` and `highest.mp4` | → | `create_export` (`POST /v1/exports`), then `get_export`'s `download_url` |
| `audio-only` renditions | → | `create_export` with `format` `m4a` |

Call a model through `create_generation` (`POST /v1/generations`), at the provider's own price. A
transcript has every word with its start and end time; write each line as a `text` node starting
at its first word, and commit it as a new version of the video's document. A link that follows
`latest` plays the captioned version once you commit it. [Models](https://rendermate.com/docs/models.md) lists every model.

***

## (6) How do I switch over?

### (A) All at once

For a small library, move every asset, check a few links on the devices you support, then switch
your code from Mux URLs to link URLs in one release.

### (B) Newest videos first

For a large library, keep playing older videos from Mux while new ones go to Rendermate:

1. Send new uploads to an upload token, and create a document and a link for each.
2. Move older assets in batches, newest first, and store each asset's link ID next to its Mux
   playback ID.
3. Switch each page to the link's URLs once its video has moved.
4. Delete the assets from Mux when nothing plays them anymore.

***

## Next steps

* [Documents](https://rendermate.com/docs/documents.md): edit a video, add text and captions, and keep every version.
* [Custom domains](https://rendermate.com/docs/custom-domains.md): serve link pages on your own domain.
* [Webhooks](https://rendermate.com/docs/webhooks.md): verify and handle `asset.created` and `export.succeeded`.


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