|Docs

Make a stock-footage commercial for your business, in short and long cuts

You get a commercial for your business, also called a promo video or explainer ad, built from licensed stock footage. It has a voiceover, your business name and offer on screen, music, and a call to action. You get it in three lengths, 15, 60 and 120 seconds, each on its own branch.

Use invideo for this when you have no footage of your own: your agent searches stock video, images and music that are licensed for the video, and you can swap any shot on the timeline after the first cut.

This is ordinary marketing work for your own business. The agent makes the video. You publish it, and you choose where it runs.

Quickest path

Set up your agent first with invideo for AI agents. Then give it this prompt.

Make a commercial for my bakery, Rise and Crumb, in Austin. Fresh breadevery morning, custom cakes, open 7am to 3pm. Use stock footage andwarm music, a friendly voice, and end with my address and site.Make 15, 60 and 120 second versions. Tell me the stock price first.

The chat-app path and the terminal path are the same here. You type the facts, and the agent finds the media. In a terminal it can also read your facts from a file.

What you need

The agent writes only what you give it. Bring the facts.

  • Your business facts. The name, what you sell, what makes you different, the offer, and the call to action.
  • The words to show. The address, the phone number or the site, exactly as they should appear.
  • Your logo, if you have one. A PNG with a transparent background.
  • The shape. 16:9 for YouTube or a site, 9:16 for Reels and TikTok, 1:1 for feeds.
  • The mood. Warm, upbeat, calm or bold, for the shots, the voice and the music.

Steps

The agent builds the longest version first, then cuts it down on branches.

  1. Write the script for each length

    The agent writes three scripts from your facts: a short one for 15 seconds, a full one for 60 and a longer one for 120 seconds. Each ends with the call to action. It shows you the scripts first. Expected result: three scripts you approve.

  2. Find the stock

    The agent runs search_library in stock_video for each line of the script, and in stock_image and stock_music where it needs them. It looks closer at a result with media video.frames and the stock id. Searching is free. Expected result: a shot list with a stock id per line, and a music track.

  3. Make the voice

    The agent runs find_models with the job in words, picks one, and reads its inputs with get_model. A good pick is elevenlabs_text_to_speech.elevenlabs_tts_v4. A voice id works only with its own model, so the agent picks the voice with search_library in elevenlabs_text_to_speech_voices. It calls generate with dry_run: true, the script as prompt and the voice_id, and tells you the price. Then it calls generate with max_credits set to that price and an idempotency_key. It does this once per script, with one key per script. Expected result: three sequence URLs, one per length, which the agent reads with read.

  4. Build the 120 second version

    The agent makes a timeline with new_timeline and a branch named 120s with timeline_history. It adds each chosen stock result with add_media and the stock id, which charges its cost. It places shots with place_media along the voice and adds your words with add_text. Expected result: a full commercial with every shot on the voice line it fits.

  5. Cut the 60 and 15 second versions

    The agent makes branches named 60s and 15s with timeline_history create_branch. On each, it puts that length's voice in place with place_media in mode replace, removes shots with delete_clip, and shortens the rest with trim_clip. Expected result: three branches whose lengths match their names.

  6. Add music, the logo and the end card

    The agent places the music with place_media and sets it under the voice with set_audio_gain. It fades the music out with set_audio_fades. It adds your logo with insert_media and the address and site on the last seconds with add_text. Expected result: music under the voice, and an end card with your details.

  7. Check and export each length

    The agent runs capture at every text and at the end card of each branch, and check_timeline. It checks that your address and phone number read exactly as you gave them. Then it runs export on each branch URL with format video and a file_name such as rise-and-crumb_60s. Expected result: three export cards with status completed.

The same job from a terminal:

invideo project new --title "Rise and Crumb commercial"invideo agent register <project-url> --name <name>export INVIDEO_AS=<name>invideo library search <project-url> --library stock_video \  --query "baker pulling fresh bread from oven"invideo library search <project-url> --library stock_music \  --query "warm acoustic"invideo media video.frames <project-url> --stock <stock-id> --at 1,3,5invideo gen models <project-url> --query "friendly voiceover from a script"invideo gen model <project-url> \  --model elevenlabs_text_to_speech.elevenlabs_tts_v4invideo gen run <page-url> \  --model elevenlabs_text_to_speech.elevenlabs_tts_v4 \  --dry-run -i prompt=@script-60.txt -i voice_id=<voice-id>invideo gen run <page-url> \  --model elevenlabs_text_to_speech.elevenlabs_tts_v4 \  --max-credits <price> --idempotency-key crumb-voice-60-v1 \  -i prompt=@script-60.txt -i voice_id=<voice-id>invideo edit new <project-url> --name "Rise and Crumb 120s"invideo asset add <edit-url> --stock <stock-id>invideo edit show <edit-url> --jsoninvideo branch new <edit-url> --name 60s --token <state_token>invideo edit show <branch-url> --jsoninvideo edit change <branch-url> --timeline T1 --token <state_token> \  --operations @cut-60.jsoninvideo edit capture <branch-url> --at 2,20,40,58 --out ./frames/60sinvideo edit export <branch-url> --format video --quality 1080 \  --file-name rise-and-crumb_60s --jsoninvideo status <card-url> --waitinvideo notebook show <card-url> --out ./out/60smv ./out/60s/export.mp4 ./out/60s/rise-and-crumb_60s.mp4

Where the values come from: <project-url> from invideo project new, and <edit-url> from invideo edit new. <name> is the name you choose in invideo agent register, and <page-url> is a notebook page from invideo notebook show <project-url>. <stock-id> comes from the library search, and <voice-id> from invideo library search in elevenlabs_text_to_speech_voices. <price> is the dry run's estimated_credits. <state_token> comes from invideo edit show on the edit, and on the branch from invideo edit show <branch-url>. The main token is stale there. <branch-url> is the branch_url that invideo branch new returns. <card-url> is .sequences[0] of what the export returns. invideo status does not download, and the saved file is always export.mp4. The ops file cut-60.json is a bare list: the operations list of the MCP call below.

The key MCP call on the 60s branch removes a shot, shortens another and adds the end card. At 30 frames a second, frame 1800 is the 60 second mark. <state_token> here is the branch's token from get_timeline, and the clip ids come from the same read.

{  "url": "<branch-url>",  "timeline_id": "T1",  "expected_state_token": "<state_token>",  "operations": [    { "op": "delete_clip", "clip": "c6", "mode": "close_gap",      "linked": true },    { "op": "trim_clip", "clip": "c7", "edge": "tail", "from_f": 1290,      "to_f": 1200, "mode": "close_gap", "linked": true },    { "op": "add_text", "track": "V2", "start_f": 1650, "end_f": 1800,      "text": "Rise and Crumb\n214 Oak Street, Austin\nriseandcrumb.com",      "style": { "font_size": 64, "align": "center", "color": "#ffffff" } }  ]}

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.

  • Free: searching stock, the edits, the three branches and every export.
  • Looking at stock with media: the dry run shows the price before anything starts.
  • Costs credits: each stock clip, image or song when the agent adds it, and the voice. iStock results use one of your workspace's iStock licenses.

One commercial in three lengths takes under an hour, most of it on the script and your review of the shots. See Credits and what they cost for prices.

Rights

Stock you add through invideo is licensed for use in your video. The agent looks at low-resolution previews. Your export uses the clean file. For what you may do with stock, music and generated media, read Licensing and commercial use.

If something goes wrong

Most problems are a shot that does not fit the line, or a version that runs long.

SymptomFix
get_model or generate refuses the model as not foundModels 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 heldA 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.
A version runs longer than its nameRead it with get_timeline and trim the last clips with trim_clip.
trim_clip refused as stalefrom_f must be the edge as last read. Read the clip again.
A stock shot shows a competitor's logoPick another result with search_library.
The phone number on screen is wrongThe agent types what you gave. Send the right number and it fixes it with set_text.
CLI exit 3 on the branchThe token is the main timeline's. Run invideo edit show <branch-url> and use its token.
The download folder is emptyinvideo status does not download. Run invideo notebook show <card-url> --out ./out/60s.
CLI exit 5A credit limit. Use fewer stock clips, or reuse a clip.
Avoid: adding every search result to look at itInstead: look with media and the stock id, then add the ones you pick.

Prompts to try

Each prompt is a real variation of the job.

Make a 30 second vertical promo for my gym's January offer: first monthfree. Energetic stock, bold text, no voice, a fast beat.
Make a 60 second commercial for my plumbing business with a calm malevoice. Use my logo ./logo.png and my real van photo ./van.jpg at the end.
Use my 120 second cafe commercial and make a Spanish version on a newbranch, with a Spanish voice and the same shots.

When to use something else

For a commercial with your own staff, shop and customers, film them on a phone and bring the clips in with add_media. Real footage often wins over stock for a local business.

For airtime on TV, the station sets its own delivery rules. invideo exports a 1080p MP4. Ask the station what it needs, and use a desktop editor or a post house for broadcast formats.