whatisgithub

What is ccapture.js?

spite/ccapture.js — explained in plain English

Analysis updated 2026-06-26

3,758JavaScriptAudience · developerComplexity · 2/5Setup · easy

In one sentence

CCapture.js is a JavaScript library that records canvas-based browser animations at a perfectly smooth, fixed frame rate by taking control of the browser's timing, regardless of how slow the rendering actually is.

Mindmap

mindmap
  root((ccapture.js))
    What it does
      Record canvas animations
      Fixed frame rate capture
      Override browser timing
    Output Formats
      WebM video
      Animated GIF
      PNG or JPEG frames
      Server-side ffmpeg
    How it works
      Intercepts timing functions
      Controlled clock per frame
      Decoupled from real time
    Setup
      Script tag include
      npm install
      Wrap animation loop
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Record a computationally expensive Three.js or p5.js canvas animation as a smooth 60fps WebM video, even if each frame takes several seconds to render.

USE CASE 2

Export a canvas animation as a sequence of PNG images packaged in a TAR archive for video editing in post-production.

USE CASE 3

Capture a canvas animation as an animated GIF directly in the browser without any external software.

USE CASE 4

Send high-frame-rate canvas frames to a server-side ffmpeg process for high-quality video encoding.

What is it built with?

JavaScriptWebGLHTML Canvas

How does it compare?

spite/ccapture.jsfastforwardteam/fastforwardrezmason/matrix
Stars3,7583,7583,759
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/51/51/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Your animation must use elapsed-time-based movement rather than fixed per-frame steps, or the recorded output will not be correct.

License terms are not specified in the explanation.

So what is it?

CCapture.js is a JavaScript library for recording canvas-based animations in the browser at a fixed, consistent frame rate. The problem it solves is that ordinary screen recording software captures whatever the screen actually shows in real time. If your animation is computationally expensive and runs slower than intended, the recording will also look slow and choppy. CCapture.js works differently: it intercepts the browser's internal timing functions and replaces them with a controlled clock, so each frame is rendered at exactly the right interval regardless of how long it actually takes to compute. This means you can push rendering quality as high as your hardware allows, take as long as needed per frame, and the resulting video will play back at a perfectly smooth 30 or 60 frames per second. You can also capture at higher frame rates like 240fps and then apply motion blur in video editing software afterward. The library supports several output formats. It can produce a WebM video file, an animated GIF, or a collection of PNG or JPEG images packaged in a TAR archive. There is also an option to send frames to a server-side ffmpeg process for video encoding. You add the library to a page via a script tag or install it with npm, then wrap your existing animation loop with three calls: start capturing, pass the canvas element to capture after each frame, and stop and save when done. The configuration options let you set the target frame rate, output quality, a time limit for automatic stopping, and whether to auto-save periodically during long captures. The README notes several limitations. The WebM format depends on browser support for the webp image format, which at the time of writing made it effectively Chrome-only. The GIF encoder has performance constraints and may struggle with long or large captures. Very large output files can also cause issues in some browsers due to memory limits. The library requires that your animation already uses elapsed-time-based movement rather than fixed per-frame increments. If your animation steps by a constant amount each frame rather than by the time that has passed, CCapture.js will not produce correct output.

Copy-paste prompts

Prompt 1
I have a Three.js animation loop. Show me how to wrap it with CCapture.js to record a 10-second WebM video at 60fps.
Prompt 2
Using CCapture.js, how do I capture a p5.js sketch as a sequence of PNG frames and download them as a TAR file?
Prompt 3
What does CCapture.js require my animation to do differently, specifically around elapsed-time-based movement, so that it captures correctly?
Prompt 4
How do I set up CCapture.js to auto-stop and save after recording exactly 5 seconds of a canvas animation?

Frequently asked questions

What is ccapture.js?

CCapture.js is a JavaScript library that records canvas-based browser animations at a perfectly smooth, fixed frame rate by taking control of the browser's timing, regardless of how slow the rendering actually is.

What language is ccapture.js written in?

Mainly JavaScript. The stack also includes JavaScript, WebGL, HTML Canvas.

What license does ccapture.js use?

License terms are not specified in the explanation.

How hard is ccapture.js to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is ccapture.js for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.