A standalone Tauri v1 + raw WebGL example that turns four reusable media slots into a compact software video switcher. Each source can be a generated test pattern, still image, looping video, or the shared live camera. Preview and Program buses feed GPU transitions, a lower-third/logo overlay, MediaRecorder capture, and PNG export.
npm install
npm run dev
On macOS, approve camera permission only when you assign a camera to a source slot.
Source 1 ┐
Source 2 ├─→ Preview / Program buses ─→ WebGL transition ─→ overlay ─→ stage
Source 3 ┤ ├─→ MediaRecorder
Source 4 ┘ └─→ PNG export
All four source slots support:
Only one camera stream is opened. Assigning it to another source moves the live input and restores the previous slot’s generated pattern.
CUT operation that swaps Preview and ProgramAUTO transition using the chosen duration1–4: select Preview sourceC: cutSpace: auto transitionThe four source textures stay resident in WebGL. The fragment shader chooses the active Program and Preview samplers, generates the transition mask, composites the overlay texture, and applies the final fade-to-black control.
The text and logo are drawn into a transparent 2D canvas, uploaded as a WebGL texture, and composited in the final fragment pass.
src-tauri/Info.plist includes NSCameraUsageDescription and entitlements.plist enables the camera entitlement. Camera frames remain local to the application.
MediaRecorder.isTypeSupported().20-tauri-v1-live-video-switcher/
├── package.json
├── README.md
├── src/
│ ├── index.html
│ ├── styles.css
│ └── app.js
└── src-tauri/
├── Cargo.toml
├── Info.plist
├── entitlements.plist
├── tauri.conf.json
├── build.rs
├── icons/
└── src/main.rs