Skip to main content

Recording export-quality globe animation

CanvasGlobe can turn the same canvas used in a product interface into a downloadable video clip. This page is a working recording lab, not a prerecorded mockup. The globe below is live, and the recording button asks your browser to encode exactly three seconds of it.

Loading the recording lab...

The clip stays in your tab. CanvasGlobe does not upload frames, contact an encoding service, or add an encoder dependency. The displayed file size, format, resolution, and elapsed time come from the recording your browser just produced.

Reproduce the sample

The live lab uses these settings:

import { createGlobe, supportedRecordingType } from "canvas-globe";

const globe = createGlobe(canvas, {
preset: "hologram",
autoRotate: true,
rotateSpeed: 0.035,
fps: 30,
markers,
arcs,
});

console.log(supportedRecordingType());

const started = performance.now();
const blob = await globe.record({
duration: 3000,
fps: 30,
bitrate: 6_000_000,
}).promise;

console.table({
elapsedMs: performance.now() - started,
bytes: blob.size,
type: blob.type,
width: canvas.width,
height: canvas.height,
});

Run the recording three times after one warm-up. Keep the canvas size, duration, frame rate, browser window, and globe options unchanged. File size can vary slightly because the browser controls the encoder.

Observed desktop baseline

This is a small reproducibility check, not a claim that every machine will produce the same file. It records what happened in the live lab on 19 September 2026.

EnvironmentValue
BrowserChrome 153.0.8010.52
Operating system64-bit Windows, build 10.0.26200
Canvas backing size808 x 453 pixels
Selected formatvideo/webm;codecs=vp9
Requested settings3 seconds, 30 fps, 6 Mbps
Warm-up output114 KB in 3.04 seconds
Three retained outputs130 KB, 58 KB, 112 KB
Retained median112 KB in 3.01 seconds

All three retained runs finished in 3.01 seconds. The file-size range was much wider than the timing range even though the requested settings were unchanged. That is useful evidence of a real limitation: videoBitsPerSecond is an encoder request, and the browser can produce materially different output sizes. If delivery size is contractual, transcode the result in a controlled video pipeline.

What the settings mean

SettingSample valuePractical effect
Duration3 secondsShort enough to verify quickly, long enough to show a complete route cycle
Frame rate30 fpsA good default for product demos and social posts
Bitrate6 MbpsA quality request to the browser, not a guaranteed output rate
ResolutionCurrent canvas pixelsThe browser records the backing canvas, including device pixel ratio
Container and codecBrowser-selectedCanvasGlobe tries supported VP9, VP8, WebM, and MP4 options in order

Browser behavior and limitations

  • Chromium browsers normally select WebM with VP9 or VP8. Safari support is narrower and depends on the installed version.
  • MediaRecorder decides the final codec, keyframes, and exact bitrate. CanvasGlobe passes a preference, not a promise.
  • A three-second request normally completes a little after three seconds because the browser still has to flush the final encoded chunk.
  • The recording captures only the canvas. HTML tooltips, controls, and surrounding page text are not part of the clip.
  • Cross-origin images or videos need permissive CORS headers. A tainted canvas cannot be exported safely.
  • The page must remain active for dependable real-time capture. Background-tab throttling can reduce smoothness.
  • Reduced-motion preferences stop animated arcs and auto-rotation. Test the intended capture environment before recording a final asset.
  • Audio is not included because the canvas stream contains video frames only.

Deterministic frame export versus real-time recording

Use record() when you want the animation as it appears in real time. Use renderFrame(ms) when every frame must be repeatable, such as a frame sequence assembled by a video pipeline.

for (let frame = 0; frame < 90; frame += 1) {
globe.renderFrame(frame * (1000 / 30));
const png = globe.exportImage({ width: 1920, height: 1080 });
// Save the PNG in your own browser or automation pipeline.
}

globe.play();

Seeking fixes the effect clock, auto-rotation, moving arc heads, orbit motion, and marker pulses. Live video, newly fired pings, and a day-night terminator tied to the current time remain external state, so freeze or remove them when frame-exact output matters.

Choosing an export path

NeedRecommended path
Quick product demo or social cliprecord() in Chrome or Edge
High-resolution stillexportImage() or exportBlob()
Transparent graphicexportImage({ transparent: true })
Exact frame sequencerenderFrame(ms) plus PNG export
Build-time imageRun the page in Playwright or Puppeteer
Audio, editing, captions, or MP4 deliveryRecord frames, then finish in a video editor or encoding pipeline

Continue with the general exporting guide for size presets and transparent PNGs, or use the launch announcement example for country-clipped media.

Before deploying CanvasGlobe in a public production project, purchase a license and add the provided license key.