A native wgpu + Tauri 2 teaching example for describing render and file-output routes as validated, hot-reloadable JSON profiles.
This example is built from two confirmed working Junkpile foundations:
It does not reuse the paused network-streaming implementation from Example 29.
config/io-profiles.jsonconfig/io-profiles.json
↓ parse + validate
last-known-good profile registry
↓ arm one profile
native authoritative wgpu texture
├── GPU window preview
└── optional mapped readback
↓ bounded queue
FFmpeg file worker
↓
MP4 or MOV
The control panel never sends arbitrary dimensions or codec settings to the renderer. It selects a profile ID. Rust resolves that ID against the validated profile registry and uses the stored settings.
{
"id": "delivery-4k",
"label": "Delivery · 4K H.264",
"description": "Native 4K render and H.264 recording.",
"frame": {
"width": 3840,
"height": 2160
},
"recording": {
"enabled": true,
"codec": "h264",
"fps": 30,
"workerDelayMs": 0
}
}
Supported codecs:
h264
prores
Supported recording frame rates:
24
30
60
The renderer itself continues running at 60 Hz. The recording route captures at the profile’s configured output frame rate.
PATHVerify the tools before starting:
ffmpeg -version
ffprobe -version
Optional executable overrides:
export FFMPEG_PATH=/absolute/path/to/ffmpeg
export FFPROBE_PATH=/absolute/path/to/ffprobe
cd 31-wgpu-io-profile-router
npm install
npm run dev
Two windows should open:
The default profile is Preview only · 1080p.
Confirm:
Delivery · 1080p H.264CompleteArm Delivery · 4K H.264 or Archive · 4K ProRes while idle.
The native authoritative texture and recording stage should reconfigure immediately. Profile changes are rejected while a recording is active or finalizing.
Open the config folder from the controls and edit:
config/io-profiles.json
Change a label or add a valid profile. Save the file. The generation and profile list should update without restarting.
Then deliberately make the JSON invalid. The UI should show the validation error while the previously valid profile registry remains usable.
Use Restore built-ins to recover the original file.
Recordings are written to:
./recordings/
Example filenames:
junkpile-31-h264-1920x1080-30fps-<timestamp>.mp4
junkpile-31-prores-3840x2160-30fps-<timestamp>.mov
schemaVersion must be 1defaultProfile must reference an existing profile7680 × 432024, 30, or 60A reusable I/O system should not require every application to hardcode its delivery settings. A small processor, recorder, feedback instrument, or routing utility should be able to load a known profile and expose the same predictable route contract.
This example proves a focused version of that model:
Configuration chooses the route, Rust validates it, the renderer prepares it, and each sink remains responsible for its own lifecycle and backpressure.
Future examples can extend the same profile format with NDI and platform-native shared-texture outputs after those individual sinks are independently verified.