Canvas WebM / GIF Recorder
Record a locally animated canvas to WebM or MP4, or export a deterministic GIF — nothing is uploaded.
Canvas animation
320×180 · 12 fpsA small local animation demonstrates frame timing. No pixels leave your browser.
This canvas has no audio track. Use the Screen & WebCam Recorder when you need tab, system or microphone audio.
Video capture is unavailable in this browser. GIF export still works.
Recording & exports
No recording yet
Start a recording or build a GIF above.
Examples
VP9 preference
selectWebmMimeType(["video/webm", "video/webm;codecs=vp8", "video/webm;codecs=vp9"])"video/webm;codecs=vp9"Candidates scan in VP9 → VP8 → plain order, so the best available codec wins.
Two-second 24 fps plan
createFramePlan(48, 24, render).length + encodeGif([frame], 2, 2, { fps: 10 }).slice(0, 6){ frames: 48, lastTime: 47/24, magic: "GIF89a" }Frame count is duration × fps with even 1/fps spacing; GIF output starts with GIF89a.
About this tool
Canvas WebM Recorder plans and encodes canvas exports without touching browser APIs: createFramePlan(frameCount, fps, render) builds AnimationFrame entries with index, time (index / fps), and rendered pixels, throwing on non-positive frameCount or fps, so a 2 s clip at 24 fps is exactly 48 frames.
MIME negotiation is pure feature detection via selectWebmMimeType(supported) (alias chooseWebmMimeType): it lowercases the supported list and returns the first of video/webm;codecs=vp9, video/webm;codecs=vp8, video/webm — VP9 preferred over VP8 over plain, null when nothing matches.
GIF fallback is a deterministic GIF89a encoder: rgbaToIndexed maps RGBA to the fixed 16-entry GIF_PALETTE by nearest color, encodeGif writes header, global palette, NETSCAPE2.0 loop block, per-frame delay round(100 / fps) clamped to 1–65535, LZW image data (min code size 4), and a 0x3b trailer. Dimensions must be integers in 1–65535 and each frame must hold exactly width × height indices.
How to use this tool
Plan frames
Call createFramePlan with frameCount = duration × fps and a render callback per index/time.
Negotiate MIME
Pass MediaRecorder.isTypeSupported results to selectWebmMimeType — VP9 wins when present.
Export GIF fallback
Map RGBA through rgbaToIndexed, then encodeGif with width, height, and fps for a loopable GIF89a.
Use cases
Recording canvas animations
Plan fixed-fps frame captures before handing buffers to MediaRecorder.
Picking a WebM codec
Choose VP9, VP8, or plain WebM from isTypeSupported output without user-agent sniffing.
Exporting animated GIFs
Encode small palette-based previews with deterministic LZW output for sharing.
Common mistakes
Mistake:Passing fps 0 or NaN and expecting empty output.
Fix:Non-positive or non-finite fps throws — validate duration × fps before planning or encoding.
Mistake:Feeding RGBA bytes straight to encodeGif.
Fix:Reduce through rgbaToIndexed first; encodeGif expects one palette index per pixel (width × height).
Frequently asked questions
What does this tool do?
It plans canvas captures with createFramePlan (index, time, pixels per frame) and encodes fallbacks with encodeGif, while selectWebmMimeType picks the best WebM codec from feature-detection results without touching browser APIs.
How are codecs, frame counts, and GIF output determined?
MIME scans VP9 → VP8 → plain WebM with null on no match; frame count is duration × fps spaced by 1/fps; GIF output is deterministic GIF89a with a 16-color palette, delay round(100/fps), LZW data, and a 0x3b trailer.
Is my canvas uploaded or stored?
No. Frame planning, palette mapping, and GIF encoding run fully client-side.
Why did planning throw, or GIF encoding fail?
Non-positive frameCount or fps throws fps/frameCount must be positive, dimensions must be integers in 1–65535, and encodeGif needs one palette index per pixel — reduce RGBA via rgbaToIndexed first.
Related guides
References & standards
Related tools
Audio Format Converter
Convert audio between WAV bit depths, sample rates and channel layouts in your browser, privately.
Audio Joiner
Reorder and merge audio files with optional crossfades into a single WAV track, locally.
Audio Noise Reducer
Remove hiss and hum from recordings with a zero-download spectral gate or hum notch, in your browser.
Audio Normalizer
Normalize loudness to LUFS or a peak target with true-peak ceiling and WAV export, entirely in-browser.
Audio Pitch & Tempo Changer
Change pitch and tempo independently or together, with local rendering and WAV export.
Audio Trimmer & Cutter
Cut segments from any audio file with a draggable waveform selection — decoded, trimmed and exported to WAV entirely in your browser.