junkpile

07 · Tauri v1 Webcam WebSocket

A two-window Tauri v1 example that keeps HTML controls separate from live camera capture and raw WebGL rendering.

controls.html
    │ parameter batches / camera commands
    ▼
ws://127.0.0.1:2727
    │ embedded Rust relay
    ▼
canvas.html
    │ getUserMedia → video → texImage2D
    ▼
GLSL effect → ping-pong history → output

What this demonstrates

Requirements

Development

npm install
npm run dev

Approve camera permission when requested. The output displays a generated calibration field until a camera is running.

Production build

npm install
npm run build

The macOS production bundles are created under:

src-tauri/target/release/bundle/

Unsigned local builds may be stopped by Gatekeeper on another Mac. Distribution requires the normal Apple signing and notarization process.

Window responsibilities

Controls window

Output window

A MediaStream is not transferred between the two windows. The camera stays in the output WebView where its frames are consumed.

Camera presets

These are ideal constraints, not guarantees. The selected camera may return a different supported format.

Effects

  1. Passthrough
  2. Wave distortion
  3. Radial warp
  4. Kaleidoscope
  5. Edge detection
  6. Glitch bands

Keyboard shortcuts

From the controls window:

From the output window:

macOS permissions

src-tauri/Info.plist contains the camera usage explanation. entitlements.plist enables camera access in the packaged application.

Important extension points

Known limitations