Kodecz: rendering web pages as video without screenshots, on the GPU and on the CPU, with a declared timeline and deterministic frames

Video as code (Remotion, HyperFrames and similar tools) lets people and coding agents write a video as a web page and render it frame by frame. The usual renderers pay for that flexibility on the CPU: every frame is a screenshot copied out of the browser, compressed to PNG or JPEG and decoded again, and embedded footage is decoded in software and passed through the browser as images. We describe Kodecz, an open-source (Apache-2.0) video engine that keeps the full web page as the authoring format and removes the screenshot on both of its paths. On an NVIDIA GPU, each frame is captured off-screen from the GPU texture of an embedded Chromium (CEF) and goes to NVENC without touching the CPU (dma-buf → Vulkan → CUDA). On any CPU, with no NVIDIA driver installed, the raw frame Chromium painted in software goes straight to x264 by pipe, never compressed to an image. Both paths share the rest of the engine: the composition is a declared timeline of paused Web Animations set to frame N by currentTime (GSAP and Lottie accepted); frame identity is checked by a marker strip outside the encoded area; frame N is the same whether the render starts at 0, in the middle or out of order; embedded footage is decoded by the engine, never by the browser; audio from the declared media is mixed in the same pass. The GPU path adds skipped P pictures written by the engine for frames the page declares unchanged (~40 bytes, no encoder call) and footage decoded on NVDEC and blended under the page with geometry, zoom and rounded corners read from the DOM. With the GPU hidden from both tools and the same x264 preset, the CPU path used 1.2× and 3.1× less CPU than Remotins of N = 3). On the GPU, a 74.7 s productionvideo used 30.8 s and 28.6 s of CPU against 473.5 s and 481.1 s for Remotion with NVENC (16:9 and 9:16, N = 2 each; 15–17× less), at mean SSIM 0.991–0.992. We report each number with its run count, the cases where we lose (wall time on an audio-heavy template, on both paths), a negative result on parallel pages, and the limits of determinism: on real videos with animated text, Chromium's rasterization can differ by up Files: kodecz-motor-paper-en.pdf (English, main igo-pt.pdf (Portuguese translation, same content). Code: https://github.com/konecz/kodecz

Authors

Publication Details

Journal
Figshare
Published
2026-11-01
DOI
https://doi.org/10.6084/m9.figshare.34880682
Primary Topic
Video Coding and Compression Technologies
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Kodecz: rendering web pages as video without screenshots, on the GPU and on the CPU, with a declared timeline and deterministic frames

Pedro Henrique Lahr
2 links
Figshare
Video Coding and Compression Technologies
preprint

Kodecz: rendering web pages as video without screenshots, on the GPU and on the CPU, with a declared timeline and deterministic frames

Pedro Henrique Lahr
preprint en

Abstract

Video as code (Remotion, HyperFrames and similar tools) lets people and coding agents write a video as a web page and render it frame by frame. The usual renderers pay for that flexibility on the CPU: every frame is a screenshot copied out of the browser, compressed to PNG or JPEG and decoded again, and embedded footage is decoded in software and passed through the browser as images. We describe Kodecz, an open-source (Apache-2.0) video engine that keeps the full web page as the authoring format and removes the screenshot on both of its paths. On an NVIDIA GPU, each frame is captured off-screen from the GPU texture of an embedded Chromium (CEF) and goes to NVENC without touching the CPU (dma-buf → Vulkan → CUDA). On any CPU, with no NVIDIA driver installed, the raw frame Chromium painted in software goes straight to x264 by pipe, never compressed to an image. Both paths share the rest of the engine: the composition is a declared timeline of paused Web Animations set to frame N by currentTime (GSAP and Lottie accepted); frame identity is checked by a marker strip outside the encoded area; frame N is the same whether the render starts at 0, in the middle or out of order; embedded footage is decoded by the engine, never by the browser; audio from the declared media is mixed in the same pass. The GPU path adds skipped P pictures written by the engine for frames the page declares unchanged (~40 bytes, no encoder call) and footage decoded on NVDEC and blended under the page with geometry, zoom and rounded corners read from the DOM. With the GPU hidden from both tools and the same x264 preset, the CPU path used 1.2× and 3.1× less CPU than Remotins of N = 3). On the GPU, a 74.7 s productionvideo used 30.8 s and 28.6 s of CPU against 473.5 s and 481.1 s for Remotion with NVENC (16:9 and 9:16, N = 2 each; 15–17× less), at mean SSIM 0.991–0.992. We report each number with its run count, the cases where we lose (wall time on an audio-heavy template, on both paths), a negative result on parallel pages, and the limits of determinism: on real videos with animated text, Chromium's rasterization can differ by up Files: kodecz-motor-paper-en.pdf (English, main igo-pt.pdf (Portuguese translation, same content). Code: https://github.com/konecz/kodecz

Figshare
Video Coding and Compression Technologies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
Kodecz: rendering web pages as video without screenshots, on the GPU and on the CPU, with a declared timeline and deterministic frames — Pedro Henrique Lahr · Figshare (2026) | TGRS Research Map | TGRS