fix(export): render Lightning frames with WebGL and allow software H.264 - #1035
Othunderlight wants to merge 1 commit into
Conversation
Lightning exports failed on Linux with "Cannot read properties of undefined (reading '_resourceType')". The export renderer preferred WebGPU whenever navigator.gpu existed, but the preview renderer always prefers WebGL, so exports ran on a backend that never worked on this machine. PixiJS then read a missing filter resource in BindGroupSystem._createBindGroup and threw. Breeze was separately unreachable on Linux: its Annex B encoder probe only tried prefer-hardware, while electron/gpuSwitches.ts disables VaapiVideoDecoder and VaapiVideoEncoder on Linux, so the probe rejected the software encoder that WebCodecs had already reported as supported. - Default the export renderer to WebGL-first to match VideoPlayback.tsx; keep WebGPU available when explicitly requested. - Probe Breeze with prefer-hardware and fall back to prefer-software, and configure the encoder with whichever config passed.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: webadderallorg/Recordly/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe renderer backend order now defaults to WebGL before WebGPU, unless WebGPU is explicitly preferred. Both video exporters now check software-accelerated H.264 support when hardware-preferred encoding is unsupported. ChangesExport selection
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified issue currently blocks merging the export fallback changes. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Exporting with software encoding can now start a native encoding process on more machines. The older export path may leave that process or its temporary file behind if finalization times out. No new remote access or privilege grant was established. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Lightning (Beta) export on Linux fails with
Cannot read properties of undefined (reading '_resourceType'), and its Breeze fallback never engages. This PR fixes both defects behind that report.1. The export renderer chose a different backend than the preview.
The preview always tries WebGL first (
VideoPlayback.tsx), and the legacy exporter does too. The Lightning export renderer did not: with an undefined preference it ordered["webgpu", "webgl"]whenevernavigator.gpuexisted — andelectron/main.tsappendsenable-unsafe-webgpu, sonavigator.gpuis present on Linux even when the backend is unusable. PixiJS then throws insideBindGroupSystem._createBindGroup, which reads_resourceTypeoff a filter resource that was never bound:Every report carries
Renderer: webgpu, whileRenderer: webglexports succeed — including the Legacy pipeline, which is already WebGL-first.2. Breeze could never pass its own encoder probe on Linux.
The Annex B support check only tried
prefer-hardware, whileelectron/gpuSwitches.tsdisablesVaapiVideoDecoder/VaapiVideoEncoderon Linux. So the probe rejected every Linux machine even though software H.264 works — producing theBreeze fallback: H.264 Annex B encoding is not supported at WxHline seen in all reports, while the log directly above it shows WebCodecs reportingavc1.640033/prefer-softwareas supported.The probe now tries
prefer-hardwareand falls back toprefer-software, configuring the encoder with whichever config actually passed. Both exporters were updated (modernVideoExporter.ts,videoExporter.ts).Motivation
Affects Linux users across Fedora, Arch and Ubuntu with no workaround: Lightning fails immediately and Breeze never starts, so exports only succeed via the Legacy pipeline (which some users report has since been removed from the UI).
Type of Change
Related Issue(s)
Overlap, for the maintainer's convenience:
prefer-hardwarecheck and adds an FFmpeg rawvideo fallback instead. This PR'sprefer-softwarefallback keeps the existing Annex B path working rather than routing around it — the two are complementary.CONFLICTINGand bundles unrelated capture changes.The Breeze probe change is not covered by any open PR.
Screenshots / Video
No UI change. Before/after is visible in the export error report itself:
Before
After
with Breeze available as a genuine fallback instead of a permanently rejected one.
Testing Guide
Environment: Fedora Linux 42 (GNOME, Wayland), GeForce RTX 2050 + Radeon 680M, Electron 43, 1080x1920 @ 30 FPS.
npm install && npm run build:linuxRenderer: webgl.npx tsc --noEmitnpm run lintnpm testnpm run build:linuxrelease/Recordly-linux-x64.AppImagenpm run smoke:packaged-binariesPlease also sanity-check on macOS/Windows that export still selects WebGPU when it is explicitly requested (
RECORDLY_SMOKE_EXPORT_RENDER_BACKEND=webgpu) — the change only alters the default/auto ordering.Checklist
Thank you for contributing!
Summary by CodeRabbit