Repository navigation
Description
Summary
It would be useful if the Punktfunk web client allowed users to select their preferred video codec (H.264 or HEVC/H.265), with an Auto mode that chooses a codec the browser can actually decode.
Ideally, the client would also handle decoder initialization failures by retrying with a compatible option instead of displaying a black screen.
Why this would help
I encountered persistent black screens while streaming from Punktfunk to a Chromium-based browser on Linux.
My setup:
- Host: Punktfunk 0.45.0 on Kubuntu 26.04.1
- Host GPU: AMD RX 6600, headless KDE Wayland
- Client: Helium (Chromium-based), CachyOS Linux
- Client GPU: NVIDIA RTX 3080 Laptop GPU
- Browser client: Docker image from October 26, 2026
What happened
Initially, Punktfunk selected H.264:
punktfunk-web: session live, codec 1 at 1920x1080
The browser attempted to configure WebCodecs with:
{
codec: "avc1.42E01F",
codedWidth: 1920,
codedHeight: 1080,
optimizeForLatency: true,
hardwareAcceleration: "prefer-hardware"
}However, the browser reported:
prefer-hardware: false
prefer-software: true
no-preference: true
This resulted in:
OperationError: Unsupported configuration.
Check isConfigSupported() prior to calling configure().
Temporarily forcing prefer-software made the H.264 stream work.
I subsequently enabled the experimental NVIDIA VA-API hardware-decoding path in Chromium. Hardware H.264 support became available, but I still encountered black screens and a kUnsupportedConfig error when Chromium attempted to select its VA-API decoder.
Later, Punktfunk streamed HEVC:
punktfunk-web: session live, codec 2 at 1728x1600
codec: hev1.1.6.L153.B0
hardwareAcceleration: prefer-hardware
That stream worked successfully with NVIDIA hardware decoding.
Since I also changed Chromium's hardware-decoding configuration during testing, I cannot confirm that switching the codec alone would have solved the original problem. However, the experience shows why codec selection and decoder compatibility handling would be valuable.
Suggested improvements
-
Manual codec selector
- Auto (recommended)
- H.264
- HEVC / H.265
- Additional codecs if supported in the future
-
Automatic compatibility detection
- Check browser decoding support using
VideoDecoder.isConfigSupported()for the actual configuration. - Consider both host encoding capabilities and browser decoding capabilities.
- Prefer hardware decoding when it is supported and working.
- Fall back to another supported codec or software decoding when necessary.
- Check browser decoding support using
-
Recovery from runtime decoder failures
isConfigSupported()can report support even when actual decoder initialization fails.- Handle initialization and decoding errors gracefully.
- Retry a compatible configuration where possible, or show an actionable error rather than leaving the screen black.
-
Display the active stream codec
- Show which codec is actually being streamed.
- Ideally indicate whether hardware or software decoding is active, when reliably detectable.
Expected result
Users should be able to select a codec appropriate for their browser and GPU, or let Punktfunk choose automatically.
The goal is reliable, low-latency streaming without requiring users to modify browser launch flags, inspect WebCodecs errors, or manually override decoder configuration in Developer Tools.
Thank you for considering this improvement!
Activity
enricobuehler commentedon Oct 30, 2026
Thanks for the detailed report; it pointed at two real gaps.
Already there when you tested: Settings → Video codec (Automatic / HEVC / AV1 / H.264) has been in the page since v0.2.0. And v0.3.1 (2026-10-27, the day after your image) added the fallback from
prefer-hardwaretono-preferencewhenconfigure()refuses, which covers theUnsupported configurationyou hit on H.264.What was still missing, merged in #67:
isConfigSupported()says yes to hardware butconfigure()then fails (your VA-APIkUnsupportedConfig), the rebuild tried hardware first again, twice a second, for good: a black screen. It now moves past the acceleration that failed, throughno-preferencetoprefer-software.configure()that throws synchronously escaped the error path. It no longer does.WebCodecs, hardwareorWebCodecs, softwarewhen the page knows which it got.This is on
mainand in the nextedgeimage, and will be in the next release.