RENDER ON YOUR PC - NOTES Music Video in Code, free file from the AI2Play tutorial How the video is made: three.js scenes in a web page, drawn frame by frame in headless Chrome (Chrome with no window), joined into a video with FFmpeg. Each frame is drawn 10 times and averaged, which gives real motion blur. Everything below was measured on our PC: an RTX 4090 graphics card (24 GB) on Windows 11. HOW FAST - The whole video (2 minutes 16 seconds, 4,080 frames) at 2560x1440 rendered in about 6 minutes, with 6 Chrome windows working at once. Each of the 6 parts of the song took 22 to 54 seconds. - With one Chrome, 1920x1080: about 1.3 frames per second (a 5-second test = about 2 minutes). - The time went into Chrome's picture capture, not into the graphics card (it was mostly idle). We first used several Chromes at once to hide that, but six Chromes made the whole PC slow to use. - THE REAL FIX (measured later, on a 63-second scene at 2560x1440): drawing a frame took about 0.05 s, saving it as a perfect-quality (lossless) screenshot took 1 to 2 s. So the Render Kit now skips the screenshot: a page that sets window.RAW_OK = true gives its canvas pixels straight to the video encoder (the same picture to the last pixel). That scene went from 13 minutes with 6 Chromes to under 4 minutes with ONE Chrome, and the PC stayed usable. The 5-second sample went from about 2 minutes to about 19 seconds. Pages with HTML text over the canvas use a quality-100 JPEG screenshot: about 8 times faster than lossless, and it looks the same in the video. - Two Chromes at once were about 30 % faster than one; three were not faster at all (the card is then the limit). GRAPHICS MEMORY IS SMALL - One Chrome rendering a full scene at 1080p used about 0.5 GB of graphics memory (470 MB measured, with 7,920 droplets, shadows, glow and 10 drawings per frame). 2560x1440 needs a bit more. - A 4 GB card is enough for one Chrome. Each extra Chrome needs about 0.5 GB more. - The heavy part is TIME, not memory. - Close other programs that use the graphics card (for example an image generator) before you render, so they do not fight over the memory. A SLOW CARD IS SLOWER, NOT BROKEN - A laptop graphics card is slower than ours. The video is the same, it just takes longer: render 5 seconds first, time it, and multiply up, so you know if it is a coffee break or an overnight job. - Windows resets the graphics driver when one frame takes longer than about 2 seconds on the card (a short black flash, and Chrome loses the picture). A good render tool then STOPS with a message instead of freezing. - If that happens: render at 1920x1080 instead of 2560x1440, or draw each frame fewer times (less motion blur). - No graphics card at all: Chrome can render on the processor. It works, but it is very slow. STILLS FIRST - Before any video, render a few still pictures at key moments (a drop, a chorus, a lyric line) and look at them. A still takes seconds; a video takes minutes. Fix what you see, then render. - Then a short part at 1920x1080, then the whole video at full size. THE FROZEN SCREENSHOT (a problem we hit, and the fix) - What happened: a render made 1 frame and then sat for 50 minutes with nothing on screen. - The cause: Chrome's PNG screenshot never answered on some frames (the same frames every time). The scene itself was fine. The same frame as a JPEG or WebP picture came back at once. - The fix: 1. Capture lossless WebP pictures instead of PNG (bit for bit the same image). 2. Put a time limit on every call to Chrome, so a stuck call is named and never waits forever. 3. If a capture stalls, draw the frame again and retry, then try another format (never PNG: it can wedge Chrome), then STOP with the time of the frame. 4. Print the progress at least every 20 seconds, so you always see that it is working. - Frames full of tiny detail could still stall the lossless WebP capture. For those scenes, JPEG at quality 100 captured every frame at once. - How we found it: a time limit that names the stuck call, then one log line per frame, then one still at that time, then hiding parts of the scene, then trying other picture formats. - If you ask Claude Code to build your renderer, ask for these 4 things from the start. CHECK THE RESULT - Count the frames: frames = seconds x fps (136 s x 30 fps = 4,080). A missing frame is a jump in the video. - Watch the whole video on your phone before you share it.