# Deterministic frames: why frame 90 of a video must always be the same

> A deterministic frame means frame N of a video depends only on the code and the number N, never on the clock, the network or chance. That way the preview shows exactly what the final video will show, and you can redo just one stretch. In the Konecz engine, three renders of the same video produced the same video stream, byte for byte.

Pedro Henrique Lahr, Konecz, 2026-11-22. https://konecz.com/en/blog/quadro-deterministico-em-video

A frame is deterministic when it depends on only two things: the video's code and the frame number. Not on the computer's clock, the internet, a random draw or the previous frame. In Kodecz, the Konecz video engine, this is a rule: frame 90 comes out the same whether the video is rendered from the start, from the middle or out of order. Across three renders in a row of the same video, the video stream came out identical, byte for byte.

## Why would a video made with code change on its own?

Because a normal web page lives in real time. A CSS animation starts when the page loads; a counter reads the clock; an image arrives from the internet whenever it arrives. If the render catches the page at the wrong moment, the frame comes out different.

Examples of what breaks a frame:

- an animation that depends on how long the page took to open;
- an effect with a random number and no fixed seed;
- a font or image downloaded from the internet during the render;
- a canvas drawing that piles up what came from the previous frame.

## How does the engine make sure frame N is always the same?

With a declared timeline and a few rules it enforces:

1. **Nothing moves on its own.** The page declares size, frames per second and length. For frame N, the engine sets every animation it has found to the exact instant of N, including GSAP and Lottie brought by the page.
2. **Jumps with a warm-up.** Before jumping to a frame out of sequence, the engine draws frame N − 1 without recording it. That way, whatever the browser carries from one frame to the next is already in place.
3. **No network during the render.** Fonts and images are local. The engine refuses a font that is not in the local cache.
4. **No clock and no loose randomness.** Simulations are recomputed from time zero with a fixed seed, and the canvas is cleared every frame.
5. **One browser tweak.** Chromium would stop redrawing a layer marked `will-change: transform`; the engine replaces that hint so the frame comes out right.

## What does this change day to day?

Everything that comes after the render:

- **The preview counts.** A single frame as PNG, made in one or two seconds to check a caption, is the same frame that will be in the MP4. Nobody approves one picture and receives another.
- **You can redo one stretch.** Rendering frames 300 to 450 gives exactly the frames the full render would have in that stretch.
- **You can catch regressions.** Approved frames are stored as references. If a change in the engine or the brand alters a frame nobody touched, the comparison flags it.
- **You can measure fairly.** Comparing speed between two versions only makes sense if both draw the same video.

## Is the result always identical, byte for byte?

Almost always. In the 2 November 2026 measurement, with three rounds per tool:

| Video | Kodecz on the GPU | Kodecz on the CPU |
|---|---|---|
| Presenter, 1080p, 150 frames | identical in all 3 rounds | identical in all 3 rounds |
| Audiogram, 1080 × 1080, 814 frames | varied between rounds | identical in all 3 rounds |

The exception is animated text drawn by the GPU: two renders can differ by up to 2 color levels in a pixel, because of how the browser rasterizes on the GPU. You cannot see it. For reference frames, the rule accepts up to 2 levels per channel with a similarity score (SSIM) of 0.999 or more.

## Does this apply to Konecz videos?

To all of them. The rule is written into the Konecz way of making video: frame N depends only on N, with no clock, no unseeded randomness, no network and no state from the previous frame. The check is simple: two renders of the same stretch must produce the same frames. That is what lets us fix a wrong word in a caption and redo only that stretch, knowing the rest of the video stays as it was approved.

## Frequently asked questions

**What does rendering out of order mean?**
Drawing, say, frame 120 before frame 45. The preview does this to show only the frames you asked for. With deterministic frames, the order does not change the result.

**Can I use random numbers in the video?**
Yes, with a fixed seed. Then the «random» is the same in every render.

**Why can the font not come from the internet?**
Because the network can be slow or fail, and the frame would come out with the wrong font. The font is downloaded once into a local cache and read from there.

**Do 2 color levels make a difference?**
Not to the viewer. On a 0 to 255 scale per color, 2 levels are invisible. The rule exists to tell that variation apart from a real change.

More on the declared timeline in the post about the [Kodecz render engine](/en/blog/kodecz-render) and on the [Kodecz](/kodecz) page.
