Make a book trailer or a game trailer
You get a trailer, also called a teaser or promo video, for a book or a game. A book trailer shows scenes from your story as generated shots, with short lines of text, music and a voice. A game trailer cuts your captured gameplay down to its best moments, with title cards and a hit on every cut.
Use invideo for this when you want a trailer you can keep changing: every shot, line and cut sits on a timeline, so a new tagline or a new build means a small edit, not a new video.
Quickest path
Set up your agent first with invideo for AI agents. Then give it the prompt for your kind of trailer.
Make a book trailer for my fantasy novel. Read ./blurb.md, pick fourscenes, generate a shot for each, and put three short lines of textbetween them. Dark orchestral music, a deep voice for the last line,and the cover at the end. 16:9. Show me each shot before you use it.Make a game trailer from my gameplay in ./captures. Find the bestfights and the big moments, cut them on the music, and add title cardswith the game's name and "Wishlist on Steam". 16:9.In a chat app, you drag the files into the project's Media panel in invideo. In a terminal, you name the folder and the agent uploads it.
What you need
The book trailer and the game trailer need different inputs.
- For a book. The blurb, three to five scenes in a sentence each, the cover image, and the look (dark, cozy, cinematic).
- For a game. Your gameplay recordings, the game's logo, and the store you send people to.
- The text. Short lines for the cards: a hook, a tagline, the title, the call to action.
- The music. A mood, a track from stock music, or your own file if you have the rights.
- The shape. 16:9 for YouTube and store pages, 9:16 for a Shorts version.
Steps
Step 1 and step 2 are for a book. Step 3 is for a game. The rest are for both. Your agent edits on a branch and tells you what changed at each step.
Write the shot list for a book
The agent reads your blurb and writes one prompt per scene: the place, the light, the motion of the camera. It saves the list as a brief with
new_brief, then adds the scenes withwrite, so you can change them. Expected result: a brief URL with one note per scene.Generate the book shots
The agent runs
find_modelswithoutputvideo and the job in words, like "cinematic scene from a prompt", and reads its pick withget_model. A good pick isseedance_2_5.r2v. Your agent can search for others withfind_models. It takes apromptand, to keep a character the same in every shot, the cover or a character image inreference_images. For a shot that must start on the cover,seedance_2_5.framestakes it asfirst_frame. For each scene, the agent callsgeneratewithdry_run: true, the scene prompt,aspect_ratio16:9 and aduration, and tells you the price. For a price of 1 credit or more it waits for your yes. Then it callsgeneratewithmax_creditsset to that price and anidempotency_keyper scene, and names each take withrename. Expected result: a sequence URL per take, which the agent reads withread. You pick the takes to use.Bring in the gameplay and find the best moments
For each big recording, the agent calls
start_upload, sends the bytes, then callsadd_mediawith theupload_id. The agent runsmediawithaudio.onsetsandaudio.contenton each recording to find the loud spans: shots, explosions, a crowd. It runsvideo.sceneSplitto find the cuts, and looks at each span withvideo.frames. Expected result: a list of moments, in seconds.Cut the trailer on the music
The agent makes a 16:9 timeline with
new_timelineand a branch withtimeline_history. It adds the music, reads its beats withaudio.beats, and places each shot or moment withplace_mediaso the cuts land on beats. It adds a hit withadd_transitionand typeimpactorflashat the big cuts. Expected result: a cut that moves with the music.Add the text and title cards
The agent adds each line with
add_textand fades it in and out withset_keyframesonopacity. At the end, it places the cover or the logo and the call to action. Expected result: readable cards between the shots.Add the voice and the sound
The agent runs
find_modelswith "voice line" and with "sound effect", and reads each pick withget_model. Good picks areelevenlabs_text_to_speech.elevenlabs_tts_v4, with avoice_idfromsearch_library, andelevenlabs_sfx, with apromptand adurationwithin the rangeget_modelgives. Your agent can search for others withfind_models. Each one gets ageneratewithdry_run: true, and the agent tells you the price. For a price of 1 credit or more it waits for your yes. Then it callsgeneratewithmax_creditsset to that price and anidempotency_key. It reads each sequence URL withreadand places the sound. It putsduckeron the music track withadd_audio_effect; a new timeline ducks underA1by default. Expected result: a sequence URL for each sound, and the voice clear over the music.Check, then export
The agent runs
captureat each card and a few shots,check_timeline, andaudio.loudnesson the music and voice. Then it runsexportwithformatvideo. Expected result: an export card with statuscompleted.
The same job from a terminal, for a game trailer:
invideo project new --title "Starfall trailer"invideo agent register <project-url> --name <name>export INVIDEO_AS=<name>invideo edit new <project-url> --name "Trailer v1"invideo asset upload <edit-url> ./captures/*.mp4invideo media audio.onsets <sequence-url>invideo media audio.content <sequence-url>invideo media video.sceneSplit <sequence-url> --dry-runinvideo media video.frames <sequence-url> --at 42,43.5,45 --out ./lookinvideo edit show <edit-url> --jsoninvideo branch new <edit-url> --name trailer-v1 --token <state_token>invideo edit show <branch-url> --jsoninvideo edit change <branch-url> --timeline T1 \ --token <state_token> --operations @ops.jsoninvideo edit capture <branch-url> --at 0,8,20,58 --out ./framesinvideo edit check <branch-url>invideo edit export <branch-url> --format video --quality 1080 --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./outWhere each value comes from:
<name>is the name you choose ininvideo agent register.INVIDEO_ASpasses it to every later command.<project-url>comes frominvideo project new, and<edit-url>frominvideo edit new.<sequence-url>is theurlthatinvideo asset upload <edit-url>returns for each recording, a…/notebook/seq-N.MURL.<state_token>comes frominvideo edit show <edit-url>for the branch command.<branch-url>is the.branch_urlthatinvideo branch newreturns. Foredit change,<state_token>is read again withinvideo edit show <branch-url>.@ops.jsonreads a bare JSON list of ops, theoperationslist of the call below.<card-url>is.sequences[0]of the export result.invideo statuswaits but saves nothing.invideo notebook showsaves the video as./out/export.mp4, and the agent renames it.
For a book trailer, the shots are generated. Find and read the model, price one scene, then run it with the price as the cap:
invideo gen models <project-url> --query "cinematic scene from a prompt"invideo gen model <project-url> --model seedance_2_5.r2vinvideo gen run <page-url> --model seedance_2_5.r2v --dry-run \ -i prompt="slow push through a foggy harbor at dawn" \ -i aspect_ratio=16:9 -i duration=6invideo gen run <page-url> --model seedance_2_5.r2v \ --max-credits <price> --idempotency-key scene-1 \ -i prompt="slow push through a foggy harbor at dawn" \ -i aspect_ratio=16:9 -i duration=6invideo status <thread-url> --wait<page-url> is a notebook page of the project, listed by invideo notebook show <project-url>. <price> is the dry run's .estimated_credits. <thread-url> is the url the paid run returns.
The key MCP call, in full, places a moment on a beat, adds a hit, and adds a title card. <branch-url> is the branch URL that timeline_history returns, and <state_token> comes from get_timeline on it. <sequence-url> is the sequence URL that add_media returns for the recording. c3 and c4 are the clip ids on each side of the cut, from get_timeline. The fight starts 42 seconds into the recording. It goes on the timeline at frame 96, a beat at 3.2 seconds at 30 fps.
{ "url": "<branch-url>", "timeline_id": "T1", "expected_state_token": "<state_token>", "operations": [ { "op": "place_media", "asset": "<sequence-url>", "track": "V1", "at_f": 96, "source_start_seconds": 42, "source_end_seconds": 45.5, "mode": "overwrite", "linked_audio": true }, { "op": "add_transition", "left_clip": "c3", "right_clip": "c4", "type": "impact", "in_f": 4, "out_f": 4 }, { "op": "add_text", "track": "V2", "start_f": 300, "end_f": 360, "text": "Wishlist on Steam", "style": { "font_size": 88, "align": "center", "shadow": true } } ]}Cost and time
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.
- Costs credits: the shots from
seedance_2_5.r2vfor a book, the voice fromelevenlabs_text_to_speech.elevenlabs_tts_v4, sounds fromelevenlabs_sfx, and paid stock music. - Tool ops:
audio.onsets,audio.content,audio.beats,audio.loudness,video.sceneSplit,video.frames. The dry run shows its price before anything starts. - Free: uploads, the cuts, the text and the export.
A game trailer from your own footage takes the agent a few minutes. A book trailer takes longer, because each shot is generated and you pick the takes. See Credits and what they cost for prices.
If something goes wrong
Most problems come from shots that do not match each other, or gameplay with no sound to read.
| Symptom | Fix |
|---|---|
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. |
Exit code 6, or status is held | A safety review, not a refusal. Wait, then run invideo status <url> --wait again. Do not resend. If it ends failed, change the input the review flagged. |
invideo status --wait ends and the folder is empty | status does not download. Run invideo notebook show <card-url> --out <dir>. |
| The hero looks different in each shot | Generate with a reference image and seedance_2_5.r2v, and keep the same words for the character in every prompt. |
| A shot has text or a logo in it | Generate it again with "no text" in the prompt, or cover it with a card. |
| The recording has no sound | audio.onsets finds nothing. The agent picks moments from video.frames and video.sceneSplit, and you check them. |
| An upload by link fails | Upload the file with start_upload instead of a link. |
generate returns status held | A safety review. It is not over. read the URL again later. |
| CLI exit 5 | A limit on credits or quota. Check the balance before more shots. |
Avoid: calling generate again to check on a shot | Instead: read the thread URL, or call status. |
| Avoid: using every take | Instead: you pick the takes. The agent marks them with mark_sequence only when you agree. |
Prompts to try
Each prompt is a real variation of the job.
Make a 9:16 book trailer for TikTok from my thriller. Three fast shots,one line of text each, a heartbeat sound, and the cover at the end.Cut a short teaser from my game's boss fight in ./boss.mp4. Slowmotion on the last hit, a glitch on the cuts, and the logo at the end.My recordings have no sound. Find the action by looking at the frames,cut them to this track, ./theme.mp3, and show me the moments first.When to use something else
invideo does not record gameplay. Capture it with OBS Studio, the Xbox Game Bar, or your console's capture. Store pages like Steam have their own trailer rules. Read them before you export.
For a book cover itself, work with a designer, or ask your agent to generate one with a model it finds with find_models. The trailer uses the cover you bring.