Home / Chapter 9 · Images, video and audio
    Last edited · 13 min read

    Use with AI

    Video generation

    A typical video model stores a clip as blocks, each covering a few frames and a patch of the picture, and denoises all of them at once, like the image in “Image generation”, with time as an extra dimension. That is why the length of a clip is fixed in advance, usually from a few seconds to a dozen or so, and longer films are assembled from separate shots or extensions.

    In plain wordsA typical video model does not shoot a film frame by frame. It gets a stack of sheets covered in random dots, one sheet for each moment of the clip, and in round after round it corrects the whole stack at once, so the first sheet can adjust to the last. The stack has a fixed thickness. When extending, the model gets only the last sheets of the previous stack, so it can miss earlier details and repeat the errors on those sheets.

    Video tokens

    Why models generate the whole clip at once, and why clips are short

    The whole clip at once or in chunks: when frames are final

    Schematic: 6 latent frames instead of about 20, and the noise is illustrative. Generation in chunks is described in research papers (Self Forcing, 2025). A typical video API returns the whole clip at once, and real-time services are a separate category, described below.

    A longer film

    A long film: extending one clip or separate shots

    Extending in Gemini Omni Flash: each extension gets the last 10 s of the film so far

    extension input: the last 10 s of the filmnew partcharacter visible only in second 3
    • Drift: colours and textures change gradually.
    • Forgetting: none of the extensions receives frames showing the character from second 3; if the character reappears, it may look different.
    • Seams: at the joins, the motion of objects, the lighting or the camera speed changes abruptly.

    Shots: each generated separately, with the same reference image

    shot 1ref
    shot 2ref
    shot 3ref
    shot 4ref
    shot 5ref
    • Every shot is generated starting from the same reference image of the character and the place, so the errors of one shot do not carry over into the next, and the cut hides the transition between shots. A reference lowers the risk of the character changing but does not remove it.

    Lengths and the 10 s of input follow the Gemini Omni Flash documentation: a clip of up to 15 s, an extension of 3–⁠10 s, at most 30 s in total (as of November 2026). The character in second 3 is an example.

    Audio, typical errors and working with the API

    Check yourself

    How does a model turn a prompt into a video clip, and why does one clip usually last only from a few seconds to a dozen or so?

    The autoencoder compresses the film in time as well, e.g. 4 frames into one latent frame, and the transformer divides the grid into tokens: blocks of a few frames and a patch of the picture, about 15,000 tokens per second of 720p film in Wan 2.1. A typical model denoises the whole clip at once, so the length is fixed in advance. A clip is short because the attention cost grows with the square of the number of tokens, and because the models were trained on shots of up to a dozen or so seconds and have a limited range of positions. Longer films are assembled from shots or extensions. When extending a video, the model receives only its final segment. Errors can therefore accumulate, and characters absent from that segment may look different when they reappear.

    Po polsku

    Autoenkoder ściska film także w czasie, np. 4 klatki w jedną klatkę siatki, a transformer dzieli siatkę na tokeny: kostki z kilku klatek i fragmentu kadru, ok. 15 tys. tokenów na sekundę filmu 720p w Wan 2.1. Typowy model odszumia cały klip naraz, więc długość ustala się z góry. Klip jest krótki, bo koszt attention rośnie z kwadratem liczby tokenów, a modele trenowano na ujęciach do kilkunastu sekund i mają ograniczony zakres pozycji. Dłuższe filmy składa się z ujęć albo przedłużeń. Przy przedłużaniu model dostaje tylko końcówkę dotychczasowego filmu, więc błędy mogą się sumować, a postacie niewidoczne w tej końcówce mogą później wyglądać inaczej.

    Follow-up questions (4)
    An ad has to run for 40 s, and the model gives at most 15 s at a time. How do you build it?
    Break the ad down into shots of a few seconds and generate each one separately, with the same reference image of the product and the character, then join them with cuts. Colour drift and changes to faces can accumulate over repeated extensions, and visible seams can appear at the joins. Services also cap the total length, for example at 30 s in Gemini Omni Flash. Use an extension only where the motion has to carry on smoothly, and watch every join.
    After the third extension the colours are oversaturated and the main character has a different face. What do you change?
    This is drift and forgetting: when extending the film, the model receives only its final segment and treats the generated frames, including their errors, as real footage. Go back to the last good extension and continue from there with a reference image of the character, or with a known first and last frame, instead of the end of the film alone. If that does not help, replace the extension with a new shot after a cut.
    A product needs an avatar that reacts to the user live. Is a typical video API enough?
    Usually not. A typical API generates the whole clip at once and takes tens of seconds or minutes to return it, so it cannot react in the middle of a conversation. You need a service that generates and streams the video chunk by chunk, fast enough to react as things happen. That is how causal models with a KV cache work, as described in the Self Forcing and LongLive papers, at the cost of lower resolution. Real-time services already exist, e.g. Decart’s API; check that the provider has such a mode, and not just a faster typical model.
    A clip has to show on-screen text with a price and water being poured into a glass. What do you watch out for?
    Overlay the caption after generation, because the autoencoder compresses several film frames into one latent frame, and small text in motion is what it reconstructs worst. Models often get the motion of the water and the hand holding the glass wrong, because training rewards how frames look rather than physical accuracy. Generate a few short versions at low resolution, pick the best one, only then generate the version at the target resolution, and count the cost per accepted clip.

    Sources

    Report an error · Suggest a fix