junkpile

Junkpile 36 — wgpu Runtime Output Router

A native Tauri 2 + wgpu reference application that routes one authoritative GPU texture to independent preview, NDI, and FFmpeg recording sinks.

This example composes the working concepts established by Junkpile Examples 27, 28, 31, 32, and 33:

Streaming code from the quarantined Example 29 is intentionally not included.

Architecture

WGSL source shader
        ↓
authoritative wgpu RGBA texture
        ├── preview surface       GPU presentation
        ├── NDI readback          RGBA → BGRA → bounded worker → NDI
        └── recording readback    reusable buffers → bounded worker → FFmpeg

A slow or failed output does not own the renderer. Each sink can be started or stopped independently.

Prerequisites

On macOS, the NDI SDK is commonly installed under one of these roots:

/Library/NDI SDK for macOS
/Library/NDI SDK for Apple
/Library/NDI 6 SDK

For a custom location:

export NDI_SDK_DIR="/path/to/NDI SDK"

Run

npm install
npm run dev

The standard development command enables NDI.

Renderer-only / no-NDI diagnostic build:

npm run dev:no-ndi

Built-in routes

Hotkey Route Preview NDI Recording
1 Preview only · 1080p yes no no
2 NDI · 1080p60 yes 1080p60 no
3 Record · 1080p30 H.264 yes no H.264
4 Broadcast · NDI + H.264 yes 1080p30 H.264
5 Archive · 4K ProRes + NDI yes 4K30 ProRes 422 HQ
6 Headless route · NDI 1080p60 hidden 1080p60 no

Hotkeys arm profiles; they do not silently start outputs. Click Start active outputs after arming.

First validation

NDI-only

  1. Arm NDI · 1080p60.
  2. Click Start active outputs.
  3. Open the official NDI Video Monitor.
  4. Select the source containing Junkpile 36.
  5. Confirm the NDI frame count rises and all three NDI drop counters remain at zero.
  6. Stop all outputs.

Recording-only

  1. Choose a custom output folder.
  2. Arm Record · 1080p30 H.264.
  3. Start active outputs for five to ten seconds.
  4. Stop all outputs and wait for finalization.
  5. Play the completed file and review cadence, jitter, and queue metrics.

Simultaneous sinks

  1. Arm Broadcast · NDI + H.264.
  2. Start active outputs.
  3. Confirm the NDI source in Video Monitor while the file sink records.
  4. Stop NDI only; recording should continue.
  5. Start NDI again; recording should remain uninterrupted.
  6. Stop all outputs and verify the file.

Hidden preview

  1. Arm Headless route · NDI 1080p60.
  2. The native preview window should hide.
  3. Start active outputs.
  4. Confirm NDI continues while the local preview is hidden.
  5. Use Show preview to restore the window without restarting the offscreen renderer.

Profile configuration

The editable file is:

config/io-profiles.json

Each route declares:

Invalid edits are rejected. The current list remains active until valid JSON is loaded.

Saving or reloading the profile file does not silently reconfigure an active output. Stop outputs and explicitly arm the route again.

Failure boundaries

Known scope

This is the first composed output router, not the final all-platform ShadeCore parity application.

Still pending:

Those existing finalized source folders were not present in the supplied Junkpile archive, so this project does not fabricate replacements for them.