Summary
cptr/frontend/static/browser-encoder.js configures the WebCodecs VideoEncoder with hardwareAcceleration: 'prefer-hardware'. On hosts with no hardware video encoder (headless servers, GPU-less VMs), VideoEncoder.isConfigSupported() returns supported: false for every codec, so the guard throws and the browser tab errors out.
Environment
- cptr with managed Chrome (Google Chrome, H.264-capable)
- Linux VM, no GPU/hardware video encoder
- Reproduces regardless of codec or resolution
Root cause
Per the WebCodecs spec, hardwareAcceleration defaults to no-preference, and prefer-hardware/prefer-software are hints that user agents should respect when possible but may ignore. Chromium does not implement them as hints: it treats prefer-hardware as a hard requirement, while no-preference means "use hardware if available, otherwise fall back to software."
Because there is no hardware encoder on these hosts, prefer-hardware causes isConfigSupported() to return false for all codecs, and this guard throws:
const support = await VideoEncoder.isConfigSupported(config);
if (!support.supported) throw new Error(`H.264 WebCodecs encoding is unavailable ...`);
Confirmed empirically on current Chrome: with prefer-hardware the config returns supported: false; with no-preference it returns true and encodes in software.
Suggested fix
Change the encoder config in browser-encoder.js:
hardwareAcceleration: 'prefer-hardware' -> 'no-preference'
This loses nothing on hosts that have a hardware encoder (Chromium still uses hardware under no-preference); it only adds the software fallback where no hardware encoder exists. If explicit intent is preferred, try prefer-hardware first and retry once with no-preference on !supported before throwing.
Summary
cptr/frontend/static/browser-encoder.jsconfigures the WebCodecsVideoEncoderwithhardwareAcceleration: 'prefer-hardware'. On hosts with no hardware video encoder (headless servers, GPU-less VMs),VideoEncoder.isConfigSupported()returnssupported: falsefor every codec, so the guard throws and the browser tab errors out.Environment
Root cause
Per the WebCodecs spec,
hardwareAccelerationdefaults tono-preference, andprefer-hardware/prefer-softwareare hints that user agents should respect when possible but may ignore. Chromium does not implement them as hints: it treatsprefer-hardwareas a hard requirement, whileno-preferencemeans "use hardware if available, otherwise fall back to software."Because there is no hardware encoder on these hosts,
prefer-hardwarecausesisConfigSupported()to return false for all codecs, and this guard throws:Confirmed empirically on current Chrome: with
prefer-hardwarethe config returnssupported: false; withno-preferenceit returnstrueand encodes in software.Suggested fix
Change the encoder config in
browser-encoder.js:This loses nothing on hosts that have a hardware encoder (Chromium still uses hardware under
no-preference); it only adds the software fallback where no hardware encoder exists. If explicit intent is preferred, tryprefer-hardwarefirst and retry once withno-preferenceon!supportedbefore throwing.