Browser support
Longpipe is supported on all major browsers, on all major operating systems. While Longpipe uses new browser APIs like WebGPU when available, it implements multiple fall backs to ensure maximum compatibility.
| 94+WebGPU 113+ | 132+WebGPU 141+ | n/a | |
| 94+WebGPU 113+ | 132+WebGPU 145+ | 17+WebGPU 26+ | |
| 94+WebGPU 144+ | 132+WebGL2 | n/a | |
| 94+WebGPU 121+ | 132+WebGL2 | n/a | |
| iOS 17+WebGPU iOS 26+ | iOS 17+WebGPU iOS 26+ | 17+WebGPU 26+ |
Browser APIs used by Longpipe
Here is a list of some of the key browser APIs used by Longpipe, though again some of these are alternatives for each other (e.g. WebGPU vs WebGL)
| API | Used for | |||
|---|---|---|---|---|
WebGL2 in a worker (OffscreenCanvas) | 69 | 105 | 17 | GPU backend (fallback) |
| WebGPU | 113 | 141 | 26 | GPU backend (preferred) |
| Module workers | 80 | 114 | 15 | Runs the pipeline off the main thread |
VideoFrame (WebCodecs) | 94 | 130 | 16.4 | Frames in the worker |
MediaStreamTrackProcessor / Generator | 94 | – | – | Frames in / out (Chromium) |
requestVideoFrameCallback | 83 | 132 | 15.4 | Frames in (Firefox, Safari) |
transferControlToOffscreen + captureStream | 69 | – | 16.4 | Frames out (Safari) |
ImageBitmap + bitmaprenderer + captureStream | 66 | 50 | 11.1 | Frames out (Firefox) |
AudioWorklet + WebAssembly | 66 | 76 | 14.1 | Audio denoise |
WebGPU and WebGL2
Longpipe doesn’t use an ML runtime. Every network is written by hand as WebGPU compute shaders and as WebGL2 fragment shaders, with the same weights, so every model and effect runs on both. Longpipe picks WebGPU when the browser offers it and WebGL2 otherwise; output quality is the same.
WebGPU is faster. Background replacement at 360p, Apple M4, Chrome 157, presets as shipped (benchmarks):
| Preset | WebGPU | WebGL2 |
|---|---|---|
| xs | 344 fps | 182 fps |
| small | 332 fps | 188 fps |
| medium | 250 fps | 153 fps |
| large | 158 fps | 97 fps |
| xl | 83 fps | 59 fps |
Frame transport
The models run in a worker, so every camera frame has to get into the worker and every processed frame back out as a MediaStreamTrack. Browsers expose different APIs for this, so Longpipe picks a path by feature detection. The path depends on the browser, not the OS.
| Transport (in → out) | Browsers | Notes |
|---|---|---|
MediaStreamTrackProcessor → MediaStreamTrackGenerator | Frames stream straight into and out of the worker. Output follows the camera’s frame rate. | |
requestVideoFrameCallback → transferred canvas + captureStream | The main thread posts each frame to the worker; the worker draws into a canvas whose stream is the output. Capped at 30 fps. | |
requestVideoFrameCallback → ImageBitmap + captureStream | Like Safari, but Firefox can’t capture a transferred canvas, so each output frame is sent back to the main thread as an ImageBitmap. Capped at 30 fps. |
Either way the result is a normal MediaStreamTrack