What is rPPG?
Remote photoplethysmography (rPPG) extracts heart rate from subtle color changes in facial skin captured by a standard camera. No contact sensor is needed, just a webcam.When To Use This Package
Use@elata-biosciences/rppg-web when your app needs:
- camera-based biosignal processing in the browser
- a higher-level rPPG session API instead of raw WASM orchestration
- diagnostics and app-facing helpers around rPPG sessions
Installation
Recommended Usage: createRppgSession
For most browser apps, start with createRppgSession(). It handles WASM init, frame capture, ROI orchestration, diagnostics, and cleanup.
createManagedRppgSession() if you also want automatic restart after terminal processor failures.
Diagnostics Guidance
Every session diagnostics payload includes state, issue codes, sampling stats, and processor failure information.- If
session.state.statusbecomesfailed, treat the underlying processor as terminal and recreate the session. - If
backend: "auto"falls back to an unavailable backend mode, diagnostics report that state instead of failing silently.
Advanced: RppgProcessor
For custom orchestration, drop to RppgProcessor directly. Only use this when you need something createRppgSession() does not provide. If you are debugging, compare against createRppgSession() first.
Constructor
| Parameter | Type | Description |
|---|---|---|
backend | "wasm" or "native" | Processing backend |
sampleRate | number | Expected frames per second (e.g., 30) |
windowSeconds | number | Analysis window length (default: 10) |
Pushing Samples
Metrics
| Field | Type | Description |
|---|---|---|
bpm | number | Estimated heart rate in BPM |
quality | number | Signal quality (0 to 1) |
spectralBpm | number | Spectral analysis estimate |
acfBpm | number | Autocorrelation estimate |
confidence | number | Overall confidence |
Key Exports
createRppgSessioncreateManagedRppgSessionRppgProcessorloadWasmBackendcreateRppgAppAdaptercreateRppgAppMonitornormalizeRppgErrorcomputeTraceWaveformDebugensureVideoPlaying
Next
rPPG Existing App Tutorial
Step-by-step integration guide
Frame Sources
MediaPipe face detection and camera capture
Calibration
Muse fusion and calibration models
Camera Integration Guide
End-to-end rPPG setup