What is a declared timeline, and why frame 120 is always the same frame
Article by Pedro Henrique Lahr
A declared timeline means writing every animation in the video with when it happens, in frames, instead of letting the browser clock run. With it, frame 120 of a video is always the same, whether the engine drew the frames in order, out of order or starting from the middle. For an AI agent that is essential: it looks at frame 120, changes one line and looks at frame 120 again, knowing the difference came from its change.
What is wrong with the browser clock?
A normal page animates by real time: a title comes in «half a second after the page loaded». On a website, fine. In a video, a disaster. The render engine does not draw frames in real time: sometimes a heavy frame takes longer, sometimes it jumps to the middle of the video for a preview. If the animation follows the clock, every render comes out different.
In the Kodecz error taxonomy, this is the class «Animation driven by the browser clock». The symptom: in the render the animation jumps, flickers, shows up already finished or disappears, while the preview looked right. The cause: the render asks for frames out of order and in parallel, and whatever depends on real time does not come back to the same state on the same frame.
How does Kodecz declare time?
With three simple ideas:
- The clock is stopped. Kodecz stops the page's timeline before it loads. Nothing moves on its own.
- Every animation starts at zero of the video. The moment it comes in is its delay.
- Before drawing frame N, the engine sets every animation to N × 1000 / fps milliseconds. On frame 120 of a 30-frames-per-second video, every animation is at 4,000 ms.
In practice, time is written in frames, with a CSS variable:
:root { --fps: 30 }
h1 {
animation: enter 0.6s both;
animation-delay: calc(15 * 1s / var(--fps)); /* enters on frame 15 */
}
That math lands exactly on the frame, checked from 24 to 60 frames per second.
What is not allowed in a declared timeline?
Anything that follows real time or chance:
| Not allowed | Why |
|---|---|
requestAnimationFrame |
follows the screen, not frame N |
setTimeout, setInterval |
the clock keeps running |
Date.now(), performance.now() |
same |
| unseeded randomness | each frame rolls again and particles jump |
| CSS transitions | the engine sends them to their end, with no middle |
| scroll-driven animation | does not move with N and stays still |
Kodecz does not hide it when this happens. The render's JSON line counts the animations that do not follow the timeline and the CSS transitions it sent straight to their end. The agent reads the number and knows something slipped through.
What about things that are not CSS animation, like 3D or canvas?
They go in a hook: window.kodecz_frame(n, ms). The engine calls it before each frame, and it has one duty: depend only on n. No remembering the previous frame, no clock. A particle simulation, for example, is recomputed from zero with a fixed seed, so frame 120 always gives the same result.
Is switching things on and off an animation too?
Yes, and that detail prevents a common mistake. For a scene to appear on frame 90 and vanish on frame 180, Kodecz blocks use two zero-length animations, one at the start and one at the end, rather than one long animation spanning the whole scene. That way the engine knows exactly on which frames something changes.
Is the video identical bit for bit?
The content is identical: frame N always has the same things in the same place. In test compositions, the pixels are identical too. In real videos, Chromium can draw animated text up to 2 color levels out of 255 apart between renders, which nobody can see. The documentation says so, instead of promising perfect equality.
The assembly is stable as well: assembling the same edit twice produces the same page, byte for byte.
Why does this matter if you don't code?
Because it is what makes fixes cheap. If a client asks to change one word at second 12, only that stretch changes. The rest of the video, already approved, comes out the same. At Konecz, with 108 videos in the portfolio on November 19, 2026, that is what allows a video to be adjusted without redoing all of it.
Frequently asked questions
Can I use GSAP or Lottie? Yes. Kodecz puts those animations on the frame's time too. The library goes inside the video folder.
What about recorded video inside the page? It goes in with its start frame and its length in frames. The engine positions the clip by frame N, with no play or pause.
Does this make the video stiffer? No. Curves, springs and delays remain. Time is just written down instead of left to chance.
Where is the full specification? In the Kodecz repository, in the timeline format document. The summary is in the Kodecz launch post.
To see the declared timeline in real videos, browse the Konecz portfolio.