Video as code: canvas scenes rendered with WebCodecs in headless Chrome, a review viewer, and agent skills that build the video from your references.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Asset still</title>
<style>html,body{margin:0;height:100%;background:repeating-conic-gradient(#c8c8c8 0 25%,#aaa 0 50%) 0 0/32px 32px} body{display:flex;align-items:center;justify-content:center} canvas{max-width:100vw;max-height:100vh;display:block}</style>
</head><body><canvas id="c"></canvas>
<script type="module">
// Draws SVG files to a transparent PNG at any size: one file per time, so t = 0 is SRC[0], t = 1 is SRC[1] ...
// motlab stills asset.html <out> 0 1 2 --scale 4 -> 0.00.png, 1.00.png, 2.00.png at W*4 x H*4
// Chrome rasterises the SVG at the drawn size, so the PNG is sharp at any scale. Fonts used in the SVG must be outlined
// to paths, or be loaded by this page (@font-face) and named the same way, or Chrome falls back to a system font.
// Page contract: renderAt(t), TOTAL, ready, ?t=, ?scale=.
const SRC = ['source.svg']; // paths from this page
const W = 1024, H = 1024; // the box at scale 1; each SVG is fitted inside it, keeping its aspect ratio
const PAD = 0; // empty margin inside the box, in scale-1 pixels
const q = new URLSearchParams(location.search), SCALE = parseFloat(q.get('scale') || '1');
const cv = document.getElementById('c'); cv.width = Math.round(W * SCALE / 2) * 2; cv.height = Math.round(H * SCALE / 2) * 2;
const ctx = cv.getContext('2d');
async function svgImage(url, w, h) { // an <img> sized up front so Chrome rasterises the vector at that size
const text = await (await fetch(url)).text(), doc = new DOMParser().parseFromString(text, 'image/svg+xml'), svg = doc.documentElement;
const vb = (svg.getAttribute('viewBox') || `0 0 ${parseFloat(svg.getAttribute('width'))} ${parseFloat(svg.getAttribute('height'))}`).split(/[\s,]+/).map(Number);
const k = Math.min(w / vb[2], h / vb[3]); svg.setAttribute('width', vb[2] * k); svg.setAttribute('height', vb[3] * k);
const img = new Image(); img.src = URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(svg)], { type: 'image/svg+xml' }));
await img.decode(); return img;
}
let imgs = [];
function render(t) {
ctx.clearRect(0, 0, cv.width, cv.height);
const img = imgs[Math.min(imgs.length - 1, Math.max(0, Math.floor(t)))];
ctx.drawImage(img, (cv.width - img.width) / 2, (cv.height - img.height) / 2);
}
window.TOTAL = SRC.length; window.renderAt = t => render(t);
window.ready = Promise.all(SRC.map(s => svgImage(s, (cv.width - 2 * PAD * SCALE), (cv.height - 2 * PAD * SCALE)))).then(r => { imgs = r; render(parseFloat(q.get('t') || '0')); return true; });
</script></body></html>