How to extend a video to 40 seconds with Gemini Omni 1.1 Flash

Scene extension appends 10 seconds at a time up to 40, and Omni 1.1 now reads 10 seconds of prior context instead of one. The request shape, the limits, and how to keep segment three from drifting.

Ashley Innocent

Ashley Innocent

28 August 2026

How to extend a video to 40 seconds with Gemini Omni 1.1 Flash

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

Gemini Omni 1.1 Flash generates 10-second clips. Scene extension is how you get past that: each extension call appends another 10 seconds, up to a cumulative 40 seconds.

The mechanic existed in the preview model, but it wasn’t much use. The preview looked at the final second of footage before continuing, which is enough context to keep the colors roughly consistent and nothing else. Characters changed clothes. Camera moves reset. The GA release on August 27, 2026 raised that window to 10 seconds of prior context, and Google credits the change with “improved visual consistency and narrative adherence”.

This guide covers how to call it, what the limits actually are, and how to keep a 40-second sequence from falling apart in the third segment.

The basic extension call

Extension works through the Files API. Upload the clip, pass its URI along with a prompt describing what happens next:

import base64
from google import genai

client = genai.Client()

video_file = client.files.upload(file="my_video.mp4")

interaction = client.interactions.create(
    model="gemini-omni-1.1-flash",
    input=[
        {"type": "document", "uri": video_file.uri},
        {"type": "text", "text": "Continue the scene."},
    ],
)

with open("extended.mp4", "wb") as f:
    f.write(base64.b64decode(interaction.output_video.data))

Uploads process asynchronously, so poll the file state before you send the interaction:

import time

while video_file.state == "PROCESSING":
    time.sleep(10)
    video_file = client.files.get(name=video_file.name)

if video_file.state == "FAILED":
    raise ValueError(video_file.state)

If the video you’re extending came from Omni in the same session, skip the upload entirely and chain on the interaction id instead. That path is cheaper in tokens and keeps more state:

res2 = client.interactions.create(
    model="gemini-omni-1.1-flash",
    previous_interaction_id=res1.id,
    input="The camera pulls back to reveal the whole street.",
)

The API walkthrough covers the rest of the request surface, including resolution and delivery options.

Bringing a character into the extension

You can attach reference media to an extension and point at it from the prompt. Uploaded references get slots you address as <IMAGE_REF_0>, <IMAGE_REF_1>, and so on:

video_file = client.files.upload(file="my_video.mp4")
character_img = client.files.upload(file="character.png")

interaction = client.interactions.create(
    model="gemini-omni-1.1-flash",
    input=[
        {"type": "document", "uri": video_file.uri},
        {"type": "document", "uri": character_img.uri},
        {"type": "text", "text": "Extend this video: have the character shown in <IMAGE_REF_0> enter the scene and wave."},
    ],
)

Video references work too, capped at three clips of three seconds each. The model reads them for movement and appearance; audio on reference clips is ignored.

The limits worth knowing before you plan a sequence

40 seconds is the ceiling. Four segments total: one generation plus three extensions. There’s no way to go further within a single sequence.

Append only. Extension adds to the end of a clip. You can’t prepend footage or insert into the middle. If segment two is wrong, you regenerate from segment two forward, and everything after it goes with it.

Uploaded input caps at 10 seconds. That’s the limit for video you upload. Multi-turn chains through previous_interaction_id aren’t bound by it, because the model already holds the earlier state.

No dialogue on extended uploads. You can extend someone else’s uploaded clip silently, or work in a multi-turn interaction, but you can’t add dialogue when extending an upload.

Regional restrictions. Uploading and editing video is unavailable in the European Economic Area, Switzerland, and the UK. Model-generated videos stay editable in those regions, so the previous_interaction_id path still works there while the upload path doesn’t.

One video at a time. The model won’t reason across multiple input videos.

Drafting the whole arc before you render it

Here’s the workflow that saves the most money and the most frustration.

A 40-second sequence at 720p costs roughly $4.06 in video output, and the failure mode is specific: the story drifts somewhere in segment three, so you regenerate segments three and four, and sometimes that changes something you liked in segment three’s opening. You can burn through several full renders finding the version that holds.

Draft the entire arc at 360p first. It generates up to 60% faster at a third of the cost, so the same four segments run about $1.35. Confirm the story survives all four extensions, then re-render at 720p or above with the prompts you validated. The pricing article has the full math.

Set resolution in the response format:

interaction = client.interactions.create(
    model="gemini-omni-1.1-flash",
    input=[
        {"type": "document", "uri": video_file.uri},
        {"type": "text", "text": "Continue the scene."},
    ],
    response_format={"type": "video", "resolution": "360p"},
)

Writing prompts that survive four segments

A few patterns that hold up better than others.

Describe the change, not the whole scene. The model already sees 10 seconds of what came before. Re-describing the setting invites it to reinterpret what’s already on screen. “The camera pushes in on the door” beats a fresh paragraph about the room.

Give it one movement per segment. Extensions that ask for two beats tend to deliver a rushed version of both. Ten seconds is one action.

Keep continuity anchors explicit. Naming the thing that must stay constant (“the same red jacket,” “the same low angle”) gives the model something to hold onto across the seam.

Don’t fight the append-only limit. Plan your sequence in the order it plays. There’s no way to fix the beginning later without regenerating everything after it.

Prompt craft carries a lot of weight here, and the Veo prompt guide covers principles that transfer between video models.

Checking your extensions the same way twice

Four chained calls means four places for a change in model behavior to show up, and video output is hard to eyeball for regressions when you’re only looking at the final render.

Save each stage as its own request in Apidog, with the file URI and interaction id in environment variables so you can rerun a specific segment without rebuilding the chain by hand. Assert on the response shape, since a higher-resolution extension can push the file past 4MB and switch you from inline base64 to a URI. Raise the timeout well past the default; extensions run longer than the initial generation because the model reads 10 seconds of context first.

That harness costs ten minutes and pays for itself the first time you need to know whether the seam problem is your prompt or a model update. Download Apidog to set it up.

FAQ

How long can a Gemini Omni video be? 40 seconds cumulative, built from a 10-second generation plus three 10-second extensions.

Can I extend a video I filmed myself? Yes, up to 10 seconds of input, outside the EEA, Switzerland, and the UK. Upload it through the Files API and pass the URI.

Can I add to the beginning of a clip? No. Extension appends to the end only.

Why does my character change appearance between segments? Usually the prompt re-describes the scene instead of the change, or the continuity anchor isn’t explicit. Name what must stay the same, and consider passing a character image as a reference in the extension.

Does each extension cost extra? Yes. Every extension bills its own 10 seconds of video output, plus the input tokens for the context it reads.

What if I need more than 40 seconds? Veo 3.1 extends 7 seconds at a time up to 148 seconds, at 720p only. The model comparison covers that tradeoff, and Veo’s API guide has the integration details.

Scene extension is the feature that moves Omni from demo to deliverable, but it rewards planning. Storyboard the four beats, draft the whole arc at 360p, keep each prompt to one movement, and only spend 720p money on the version you already know works.

Explore more

Gemini 3.8 Flash vs 3.7 Flash: what changed and should you upgrade?

Gemini 3.8 Flash vs 3.7 Flash: what changed and should you upgrade?

Gemini 3.8 Flash vs 3.7 Flash: same price, speed, and context, but +3 on the AA index, +12 on tau3-Banking, and 30% more output tokens per task. Upgrade?

3 September 2026

Gemini 3.7 Flash to 3.8 Flash: API migration guide

Gemini 3.7 Flash to 3.8 Flash: API migration guide

Migrate from Gemini 3.7 Flash to 3.8 Flash: 9 API changes with before/after JSON, the minimal thinking-level error, call_id rules, token budgets, and rollback.

3 September 2026

Gemini 3.8 Flash thinking levels: low vs medium vs high (and why minimal is gone)

Gemini 3.8 Flash thinking levels: low vs medium vs high (and why minimal is gone)

Gemini 3.8 Flash thinking levels explained: what low, medium, and high do, why minimal now errors, per-level cost and latency numbers, and how to set each one.

3 September 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

How to extend a video to 40 seconds with Gemini Omni 1.1 Flash