Chevron DownOverview
Chevron Down@hubble.gl/core

Encoders

Encoders are used to capture image frames of an HTML <canvas/> and encode them into videos. Each instance of an encoder represents a file artifact. During capture, they provide asynchronous functions for adding frames and saving videos. See DeckAdapter.render for usage.

Overview of Encoders
Encoder ClassTypeDescription
FrameEncoderBaseThe base encoder needs to be implemented with a start, add, and save function.
PreviewEncoderUtilityA mock encoder used to preview animations.
WebMEncoderVideoEncodes .webm video using Whammy.
GIFEncoderAnimated ImageEncodes .gif images using gifshot.js.
StreamEncoderVideoEncodes .webm rough previews, but drops frames.
PNGSequenceEncoderImage SequenceEncodes video frames as loseless .png contained in a .tar.
JPEGSequenceEncoderImage SequenceEncodes video frames as compressed .jpeg contained in a .tar.

Attributions

Encoders started as a fork of CCapture.js, which is under MIT license.