# Remotion

Render a video with Remotion and post it with Rizamo, from a script or your coding agent.

[rizamohq/rizamo-remotion](https://github.com/rizamohq/rizamo-remotion) is a Remotion project with one vertical video, 1080 by 1920, whose text comes from props, and a script that renders it, uploads it and creates the post. Keep your [API key](/authentication#api-keys) in `RIZAMO_API_KEY`.

## Render and post [#render-and-post]

```bash
git clone https://github.com/rizamohq/rizamo-remotion.git
cd rizamo-remotion
npm install
npx tsx publish.ts accounts
```

That lists your accounts with their ids. Change the text in `props.json` (`npm run dev` previews it), then render the video and save it as a draft:

```bash
npx tsx publish.ts --accounts acc_...,acc_... --text "Fresh bread every morning at 9."
```

A draft never goes out. `--schedule 2027-06-01T09:00:00Z` schedules it instead, and `--queue` takes the profile's next free [posting time](/queues).

| Option | What it does |
| --- | --- |
| `--accounts` | Account ids, comma-separated, all in one profile |
| `--text` | The post's text |
| `--schedule`, `--queue` | Schedule it at a time, or at the profile's next free posting time |
| `--props` | The video's props, `props.json` when left out |
| `--video` | Post an MP4 you already rendered, from any Remotion project |
| `--options` | Network options, such as `{"youtube":{"madeForKids":false}}` |
| `--check` | Upload and [check the post](/publishing#check-before-you-post), but create nothing |

TikTok asks the creator for their own choices on every post, so the script sends TikTok targets as drafts to the creator's TikTok inbox, where they finish it in the TikTok app.

## In your own Remotion project [#in-your-own-remotion-project]

Render the video, then upload it as [media](/media) and put it on a post:

```ts title="post-video.ts"
import { openAsBlob } from "node:fs";
import { RizamoClient } from "rizamo";

const rizamo = new RizamoClient();
const file = await openAsBlob("out/video.mp4");

const { media, upload } = await rizamo.media.create(
  { contentType: "video/mp4", size: file.size },
  { idempotencyKey: crypto.randomUUID() },
);

let start = 0;
for (const part of upload?.parts ?? []) {
  const sent = await fetch(part.url, { method: part.method, headers: part.headers, body: file.slice(start, start + part.size) });
  if (!sent.ok) throw new Error(await sent.text());
  start += part.size;
}
if (upload?.complete) {
  const done = await fetch(upload.complete.url, { method: upload.complete.method });
  if (!done.ok) throw new Error(await done.text());
}

const post = await rizamo.posts.create(
  {
    profileId: "prof_...",
    targets: [{ accountId: "acc_..." }],
    text: "Fresh bread every morning at 9.",
    mediaIds: [media.id],
  },
  { idempotencyKey: crypto.randomUUID() },
);
console.log(post.id, post.status);
```

Without `status` the post is a draft. Rizamo checks the video against each network when the post is made, and makes a copy where a network needs one ([What Rizamo changes for each network](/media#what-rizamo-changes-for-each-network)).

## With a coding agent [#with-a-coding-agent]

The repository has an agent skill for Claude Code, Codex, Cursor and other agents that load skills:

```bash
npx skills add rizamohq/rizamo-remotion
```

The agent changes the video, renders it, and posts it through the script or the [MCP server](/connect-an-agent). It saves drafts on its own, and asks you before it schedules or publishes anything. For Remotion itself, add Remotion's skills too: `npx remotion skills add`.
