Skip to main content

Post-Processing

Overview​

The post-processor is a Rust native module that handles video encoding and effects. It runs automatically when you call closeAndSave().

What It Does​

  1. Zoom interpolation - Smoothly transitions between captured zoom points
  2. Cursor overlay - Renders mouse position and clicks
  3. Video encoding - Outputs H.264 MP4 with configurable quality

Pipeline​

Raw Webm (Playwright)
↓
Zoom + Mouse Processing (Rust)
↓
FFmpeg Encoding
↓
Final MP4

Configuration​

The pipeline accepts these parameters:

ParameterTypeDescription
videoPathstringInput video file
zoomLogZoomLogEntry[]Zoom level timeline
mouseLogMouseLogEntry[]Mouse position timeline
crfnumber?Encoder quality (0-63, lower = better, default 4)
widthnumberOutput width
heightnumberOutput height
fpsnumberOutput frame rate
ffmpegPathstring?Custom FFmpeg binary path

Custom FFmpeg​

By default, the bundled FFmpeg binary is used. To use a custom one:

const recorder = new Recorder("./results");
recorder.setFfmpegPath("/usr/local/bin/ffmpeg");