# The life of a frame: from web page to MP4, step by step

> In a video made with code, each frame starts as a web page, is drawn by the browser and goes straight to the video encoder. In the Konecz engine, that frame never becomes a picture file along the way: on an NVIDIA GPU it stays on the card until it is an MP4; without a GPU it goes raw to x264.

Pedro Henrique Lahr, Konecz, 2026-11-19. https://konecz.com/en/blog/caminho-de-um-quadro-ate-o-mp4

A video made with code is a web page that changes over time, and each frame of the video is a snapshot of that page at one instant. In the Konecz engine, Kodecz, the frame leaves the browser and goes straight to the encoder without becoming an image file in between: on an NVIDIA graphics card it never leaves the card; without one, it goes raw to x264. This post follows one frame from start to MP4.

## What is a frame in this kind of video?

It is one instant of the page. A 75 second video at 30 frames per second has 2,250 frames. Each one is the same web page, with every animation stopped at an exact point on the timeline. Frame 0 is the start; frame 90 is second 3.

Every video in the Konecz portfolio is made this way. On 19/11/2026 there were 108 of them: 57 in 2D, 48 realistic and 3 in 3D. The styles change; the path of the frame does not.

## What are the steps a frame goes through?

Five, always in the same order:

1. **The page declares its timeline.** The `index.html` file states the size (for example 1080 × 1920), the frames per second and the length. Nothing moves on its own: no clock, no unseeded randomness.
2. **The engine puts the page at frame N.** Every animation (CSS, Web Animations, or GSAP and Lottie brought by the page) is set to the exact instant of that frame.
3. **The browser draws.** Chromium, running without a window, paints the page. On the GPU the result is a texture, an image that lives in the card's memory.
4. **The encoder compresses.** On the GPU, the texture goes to NVENC, the video encoder built into the NVIDIA card. Without a GPU, the raw frame goes to x264, the encoder that runs on the processor.
5. **The MP4 is assembled and checked.** The video gets its audio (AAC) and is only moved into place after the engine checks the frame count and the audio length. If they do not match, no file comes out.

## Why not take a picture of each frame?

Because the picture is the most expensive step. The best known tools, such as Remotion, take a screenshot per frame: the image leaves the card, is copied to the processor, compressed as PNG or JPEG and opened again to become video.

We measured this on a 15 second stretch of a presenter video rendered by Remotion: capturing each frame took 42% of all the processor work. Another 54% went into opening the filmed presenter video. The scene code was only 4%.

Without the picture, there is little left for the processor to do. On a 74.7 second production video, Kodecz on the GPU used 30.8 seconds of CPU in the horizontal format, against 473.5 seconds for Remotion using the GPU.

## What changes between the GPU path and the CPU path?

The start and the end are the same. What changes is who does the heavy lifting.

| Step | With an NVIDIA GPU | Processor only |
|---|---|---|
| Who draws | Chromium, on the GPU | Chromium, in software |
| What the drawing produces | a texture on the card | a raw frame in memory |
| Who encodes | NVENC | x264 |
| Does the frame go back to the CPU? | never | it is already there |
| Output | MP4, H.264 (or HEVC) | MP4, H.264 |

One rule of the engine is that, on the GPU, no frame is ever read back to the processor. That is what keeps the CPU free for everything else on the same server, such as websites.

## What about a filmed video inside the frame?

When the frame has a filmed presenter, the browser does not open that video. The engine decodes it on the card (with NVDEC, the card's decoder) and places it under the page, at the size and with the corners the page asks for. We measured the change: 62% to 67% less CPU and 36% less waiting time. With an animated zoom on the presenter, 81% less CPU and half the time.

## And when two frames in a row are the same?

The engine does not draw it at all. If the animations say frame N equals frame N − 1, it writes a mark of about 40 bytes into the video that says «repeat the previous one». On slides and still screens this saves a lot of work without changing a pixel.

## Frequently asked questions

**How many frames does a short video have?**
It depends on the frame rate. At 30 frames per second, a 60 second video has 1,800 frames.

**Is the MP4 frame the same as what I see in the browser?**
It is the same Chromium drawing. What changes is the video compression, which you cannot see by eye in the videos we measured.

**Do I need a graphics card for this to work?**
No. Without an NVIDIA GPU, the engine takes the processor path, with the same page and the same frame. The card just makes everything lighter.

**Why check the file before delivering it?**
Because an MP4 with missing frames or short audio still plays, but looks wrong on social media. The engine would rather deliver nothing than a broken file.

The details and measurements are in [Rendering a web page as video without screenshots](/en/blog/kodecz-render) and on the [Kodecz](/kodecz) page. This is the path that produces every video Konecz posts for its clients; see some of them in the [portfolio](/en/portfolio).
