Overview
Debugging video rendering can be challenging because issues may only appear during headless rendering or at specific frames. Helios provides multiple debugging tools to help diagnose problems.
Diagnostics API
The Helios.diagnose() static method checks environment capabilities.
Client-side diagnostics
Diagnostic fields
waapi - Web Animations API support (required for CSS animations)
webCodecs - WebCodecs API support (required for canvas rendering)
offscreenCanvas - OffscreenCanvas support (improves performance)
webgl / webgl2 - WebGL support (required for Three.js, Pixi.js)
webAudio - Web Audio API support (required for audio mixing)
colorGamut - Display color gamut ('srgb', 'p3', 'rec2020')
videoCodecs - Supported video encoders (H.264, VP8, VP9, AV1)
audioCodecs - Supported audio encoders (AAC, Opus)
videoDecoders - Supported video decoders
audioDecoders - Supported audio decoders
Renderer diagnostics
For server-side rendering diagnostics:
Common issues
WebCodecs not supported
No hardware acceleration
WebGL not available
Headed mode
Run rendering in a visible browser window to see what’s happening.
Using CLI
This opens a browser window and shows the rendering process in real-time.
Using API
Headed mode is slower than headless because it must render to the screen. Use only for debugging.
Remote debugging
Connect Chrome DevTools to the headless browser for live debugging.
Enable remote debugging
- Start the render
- Open Chrome and navigate to
chrome://inspect
- Click “Configure” and add
localhost:9222
- Click “inspect” under “Remote Target”
- Use Console, Network, Performance tabs as normal
Debugging tips
Inspect DOM state
Check canvas output
Monitor memory
Playwright trace viewer
Playwright can record a complete trace of the rendering session.
Enable trace recording
View the trace
The trace viewer shows:
- Timeline - Frame-by-frame rendering progress
- Screenshots - Visual output at each step
- Network - Asset loading and requests
- Console - Log messages and errors
- Source - Code execution with source maps
Debugging with traces
Find slow frames
Look for gaps in the timeline where rendering takes longer than expected.
Check asset loading
Verify fonts, images, and videos load before rendering starts.
Inspect console errors
Trace viewer captures all console output, including warnings and errors.
Frame-by-frame debugging
Inspect output at specific frames.
Export frames for inspection
Seek to specific frame
Console logging
Use console logs strategically to track state.
Log frame state
Log animation state
Log driver activity
Create a debug driver wrapper:
Common rendering issues
Animations don’t sync
Symptom: CSS animations play independently of Helios timeline
Solution: Enable autoSyncAnimations
Fonts not loading
Symptom: Text renders with fallback fonts
Solution: Wait for fonts to load
Images appear blank
Symptom: Images don’t render or show as broken
Solution: Preload images
Canvas shows old frame
Symptom: Canvas doesn’t update or shows stale content
Solution: Ensure you’re rendering on every frame
Audio out of sync
Symptom: Audio doesn’t match video timeline
Solution: Use data-helios-offset attribute
Memory leak during preview
Symptom: Browser slows down or crashes during long previews
Solution: Dispose and recreate Helios instance
Measure frame render time
Identify bottlenecks
Debug checklist
When debugging a render issue:
- ✅ Run
Helios.diagnose() to check environment
- ✅ Enable headed mode to see visual output
- ✅ Check browser console for errors
- ✅ Verify assets load with
waitUntilStable()
- ✅ Test with simplified composition
- ✅ Export specific frames for inspection
- ✅ Use Playwright trace for detailed analysis
- ✅ Profile with Chrome DevTools Performance tab
Next steps