How an AI agent sees a video before rendering it: a one-frame preview in 2 seconds
Article by Pedro Henrique Lahr
An AI agent sees a video by asking for single frames as images, without rendering the whole thing. In Kodecz, the kodecz preview command returns a frame as a PNG in 1.7 to 1.9 seconds, with exactly the same pixels that frame will have in the final MP4. The agent opens the image, checks whether the title landed in the right place and fixes it before spending time on the full video.
Why does a preview change the agent's work?
Because it turns guessing into looking. Without a preview, the agent writes «title 400 pixels from the top» and hopes. With a preview, it writes, looks at frame 45 and sees that the title hit the presenter's chin.
What makes the difference is sameness. A preview that does not match the final result misleads: the agent approves one image and delivers another. In the Kodecz error taxonomy, «Font that never reaches the render» is exactly that, a preview finding a font the render cannot find. The Kodecz preview comes out of the render's own path, and a test checks that every PNG equals frame N of the full render. In the measurements, it matched bit for bit.
How long does it take?
Times measured on October 30, 2026, on a 960 × 540 test composition:
| Case | Time |
|---|---|
| One frame, whole command | 1.69 to 1.94 s |
| Three frames in one request | 1.91 to 2.05 s |
| Watch mode, first time | 1.68 to 1.76 s |
| Watch mode, a change with everything already open | 0.84 to 1.10 s |
Almost all of that time is starting the process. Drawing one frame takes about 0.14 seconds; turning it into a PNG, about 0.3 seconds at 1920 × 1080. That is why asking for three frames costs barely more than asking for one.
What are the ways to ask for a preview?
- One frame:
kodecz preview my-folder/ MyVideo --frame 90. - Several frames:
--frame 0,45,120, in a single render. - By time instead of frame:
--at 1.5stakes the frame on screen at that instant. - Watching the folder:
--watchredraws the frames every time a file is saved. With--serve, it opens a local page with a control to pick the frame, handy for a person following the agent. - Contact sheet:
--sheetputs the key frames into one image, each cell labeled with the frame number and time. By default, up to 12 frames, picked automatically. - Before and after:
--sheet --compare other-folder/puts the same frames from the old and new version side by side. - One item of the edit only:
--item itens[2]shows the key frames of that title, chart or scene; with--video, an MP4 of just that stretch, with sound.
Contact sheet or frame by frame?
Contact sheet, almost always. The agent reads one image with 12 moments of the video at once, instead of opening 12 files. On the Kodecz block demo (1920 × 1080, 720 frames), the sheet for the whole page, with 12 frames, came out in 2.85 to 3.13 seconds.
The comparison sheet is the best way to check a fix: the agent sees, in the same spot, the frame with the mistake and the corrected frame, and confirms it did not break something else along the way.
Does the preview replace the automatic check?
No, they complement each other. The preview shows; the check measures. The preview is great for judging layout, color and hierarchy, things that need an eye. The check catches what the eye misses: frame 137, between two previews, where the caption wrapped onto two lines.
The order recommended in the agent guide is: write, look at a few frames, run the check, fix, and only then render the video. Before calling it done, look at the key frames: start and end of every scene, every zoom, every caption change.
Do you need a GPU?
No. Without a GPU the preview still works; every request just starts from scratch, without the shortcut of keeping everything open between changes. The times above were measured with a GPU.
Frequently asked questions
Can the agent really see the image? Yes, if it reads images. Claude Code, for example, opens PNGs. Through the Kodecz MCP server, frames come back as images straight into the conversation.
Does the preview include sound?
The PNG does not. The MP4 of one item, with --item and --video, comes out with that stretch's audio.
Where is the PNG saved? By default, in a temporary folder named after the composition, with the frame number. You can choose another place.
Can it go under 1 second? In watch mode with everything already open, a change comes out in 0.84 to 1.10 seconds.
More in the Kodecz launch post and in the summary of the paper on AI agents making video. To see the final result, browse the Konecz portfolio.