Frames come out of a hidden <video> element: the page seeks to a timestamp, paints that instant onto a canvas, and encodes it as JPEG. The browser exposes time, not frame numbers, so every Nth frame is converted to an interval of N ÷ fps seconds — if you enter the wrong source fps, the spacing shifts but nothing breaks.
These are evenly spaced samples, not true I-frames. Reading real keyframes needs WebCodecs plus an MP4 demuxer. For describing a clip, even spacing is usually the better sample anyway.
The image token estimate uses the classic 85 + 170-per-512px-tile tiling rule and ignores your text prompt, so treat it as a floor for budgeting. The counts reported after a call are the real ones from the API.
Decoding is done by the browser, so codec support is whatever your browser has. H.264 MP4 is safe everywhere; HEVC and some AV1 files will refuse to load.