---
title: Use Tesseract with invideo
description: Bring a Tesseract edit into invideo as an MP4, or have your agent rebuild it as an editable timeline, then finish it with generation, stock and music.
---
It depends on where the edit lives. Tesseract, from Mirage, edits and renders video on your computer through your AI agent; invideo is a cloud editor where your agent and the people you share with work on the same timeline, with generation, stock and music in the project. Your agent brings the edit in as a rendered MP4, or rebuilds its layers on the timeline.

## When to use both

Use both when the Tesseract cut is one part of a bigger job, or when other people need to review it in a browser.

- **A shared review.** Someone opens the invideo timeline from its URL and sees each clip on its own track.
- **Generation and stock.** A missing shot, a voice or a music bed comes from a model or the stock library in the same project.
- **Variants.** Several hooks, shapes or end cards around the same Tesseract render, each on its own branch.
- **Captions on the finished cut.** A transcript of the whole edit becomes a caption track.

## Hand-off: from Tesseract into invideo

There are two paths in. The render comes in as footage, or your agent rebuilds the edit as clips, text and keyframes.

### Bring the render in as footage

On this path, what crosses is an MP4 render. Tesseract's site says to keep the editable project and its source assets with the finished render. The `.tsrct` project stays with Tesseract for later changes. Install Tesseract's skills in your coding agent with this command:

```bash
npx skills add mirage-hq/Tesseract
```

Then your agent brings the MP4 into invideo:

- **A public link.** `add_media` with `media_url`.
- **A file on your computer.** `start_upload` with the `file_name`, a PUT of the bytes to the `upload_url`, then `add_media` with the `upload_id`. In a terminal, `invideo asset upload <project-url> <file>`.
- **A file in a chat app.** You drag the file into the chat. It arrives through `file` on `add_media`.

Each file becomes a sequence in the project, with its own sequence URL. On a timeline's URL, `add_media` also puts it in that timeline's media bin.

The MP4 becomes a clip like any other. It is footage, so the layers inside it are part of the picture. To keep them editable, take the second path.

### Rebuild the composition on a timeline

The second path keeps each element editable. Your agent reads the edit in the `.tsrct` project, takes the media and fonts the project carries, and has Tesseract render single layers where it needs to. Then it rebuilds each element with edit operations, on a branch. [Rebuild a Remotion, HyperFrames or Tesseract composition as an editable timeline](/how-to/developers/composition-to-timeline) gives the steps. The mapping in short:

- **Size and timing.** `set_timeline_settings` with the composition's size and `fps`. The agent converts each layer's times to frames at that rate.
- **Text.** `add_text`, `set_text_style` and `style_text_range`, with fonts uploaded through `add_media`.
- **Images and video.** `add_media`, then `insert_media` or `place_media`, with `set_position` and `set_zoom`.
- **Motion.** `add_keyframe_lane` and `add_keyframes` for position and zoom, `set_keyframes` for opacity and rotation.
- **Layers with no op.** Canvas, WebGL or a third-party component: render that layer alone in Tesseract and place it as a clip.

### The finish

On either path, the agent finishes the video:

- **Stock** from `search_library` in `stock_video` and `stock_music`, placed with `place_media`.
- **Generated shots** from a model such as `seedance_2_5.r2v` with `generate`, priced with `dry_run` first.
- **Voice** from `elevenlabs_text_to_speech.elevenlabs_tts_v4` with `generate`.
- **Captions** with `media` `audio.transcript`, then `add_captions`.

## Hand-off: from invideo to Tesseract

The way back is an MP4 too. `export` with `format` `video` renders the timeline. Your agent downloads the export and gives Tesseract the file as footage, the way it gives Tesseract any clip.

### Premiere Pro and After Effects

Tesseract handles its own round trips with Adobe apps through its converter tool, `tsrct-conv`. Its README says it converts Premiere Pro `.prproj` files both ways and After Effects `.aep` files, and warns that some features may not convert exactly. invideo's `export` with `format` `premiere`, `davinci` or `final_cut` makes a project file for Premiere Pro, DaVinci Resolve or Final Cut Pro.

## Steps

Your agent sets up with [invideo for AI agents](/agents) first. These steps follow the render path. For the rebuild, your agent follows the steps on the rebuild page.

Edits and exports are free. Generation and transcripts cost credits. Paid stock costs a small credit charge, or one of your workspace's iStock licenses. Your agent runs a dry run first and tells you the price before it spends anything.

Your agent runs a dry run first. For any call that costs 1 credit or more, it tells you the price and waits for your yes. A call under 1 credit runs without asking, and your agent tells you what it cost.

<Steps>
<Step title="Render the MP4 in Tesseract">
The agent asks Tesseract for an MP4 of the edit and keeps the `.tsrct` project. Expected result: an MP4 path on disk.
</Step>
<Step title="Bring the MP4 in">
The agent calls `start_upload`, puts the bytes, then `add_media` on the timeline URL. Expected result: a sequence URL and a media bin id.
</Step>
<Step title="Finish on a branch">
The agent creates a branch with `timeline_history`, then places stock, music and voice with `edit_timeline`. Expected result: a new `state_token`.
</Step>
<Step title="Pick and price the shot">
The agent runs `find_models` with the missing shot in words, picks one, and reads its inputs with `get_model`. A good pick is `seedance_2_5.r2v`. The agent can search for others with `find_models`. It calls `generate` with `dry_run: true` and the real inputs, and tells you the price. Expected result: a price and no charge.
</Step>
<Step title="Make the shot">
The agent calls `generate` with `max_credits` set to that price and an `idempotency_key`. Expected result: a thread URL, then a sequence URL when the shot lands. The agent reads that URL with `read`, and never calls `generate` again to check.
</Step>
<Step title="Caption the cut">
The agent prices `audio.transcript` with `dry_run`, starts it, and calls again after `retry_after_s` for the words. Then it sends `add_captions`. Expected result: a caption clip.
</Step>
<Step title="Check and export">
The agent calls `capture` at each join and runs `check_timeline`. Then it calls `export`. Expected result: an export card with status `completed`.
</Step>
</Steps>

A missing shot from a terminal:

```bash
invideo agent register <project-url> --name <name>
export INVIDEO_AS=<name>
invideo gen models <project-url> --query "close-up of the product on a desk"
invideo gen model <project-url> --model seedance_2_5.r2v
invideo gen run <page-url> --model seedance_2_5.r2v --dry-run \
  -i prompt="close-up of the product on a desk"
invideo gen run <page-url> --model seedance_2_5.r2v \
  -i prompt="close-up of the product on a desk" \
  --max-credits <price> --idempotency-key shot-1
```

`<project-url>` comes from `invideo project new` or `list_projects`. `<name>` is the name you choose in `invideo agent register`. `<page-url>` is a page that `invideo notebook show <project-url>` lists. `<price>` is the price the dry run returns.

## When to stay in Tesseract

Stay in Tesseract when the whole edit happens on your computer and nobody else needs to review it. Stay there too when you work with Premiere Pro or After Effects projects through its converter. For a change to a rendered Tesseract edit, give your agent the `.tsrct` project, render again, and replace the clip in invideo with `place_media` mode `replace`. After a rebuild, change the layer on the timeline instead.

## If something goes wrong

| Symptom | Fix |
| --- | --- |
| `add_media` with `media_url` is refused | The link must be public. Download the file, then upload it with `start_upload` and `add_media` with the `upload_id`. |
| `add_media` refuses the `.tsrct` project | invideo takes video, image, audio and font files. Ask Tesseract for an MP4 render, or have your agent rebuild the layers from the project. |
| `get_model` or `generate` refuses the model as not found | Models retire. Run `find_models` with the job in words, use the best match, and tell the person which model you used. |
| Avoid: call `generate` again to check on a run | Instead: read the thread or sequence URL with `read`. A second `generate` starts a second paid run. |

## Related

- [When to use Tesseract vs invideo](/compare/tesseract)
- [Use ChatCut with invideo](/integrations/chatcut)
- [Export to Premiere Pro, DaVinci Resolve or Final Cut Pro](/how-to/export-to-premiere-resolve-final-cut)
- [Test hooks on branches](/how-to/marketing/test-hooks-on-branches)
- [Rebuild a composition as an editable timeline](/how-to/developers/composition-to-timeline)
- [Check your video before you say it is done](/how-to/check-your-video)

<Collapse title="Does invideo open a .tsrct project?">
Not as a file. Your agent reads the project and rebuilds its layers as clips, text and keyframes, or brings in an MP4 render. Keep the `.tsrct` project in Tesseract either way.
</Collapse>