Investigate inability to play video in the headless browser (missing H.264 codec?)
Two options:
- Add the required codecs to Chromium.
- Switch to Chrome; it ships with proprietary codecs.
Note: decoding may fall back to software if hardware video acceleration isn’t exposed to the container.
How to do point 2?
Both options require me to tinker with the Docker image creation and the server code. I’ll try to look into this soon.
A few updates — not the ones you'll want to hear, probably.
- You can’t simply add the H.264 codec to Chromium; it has to be compiled in.
- Switching to Chrome makes the main functionality unstable (though video works). Chrome's new headless mode doesn't let us set the screen size when creating a tab for a new device; instead, it relies on somewhat hacky timing with
Emulation.setVisibleSizeandEmulation.setDeviceMetricsOverride. I haven’t been able to make this reliable — the screen size is sometimes incorrect.
Related question - will it be possible to get WebRTC streams working? I am using the WebRTC Card addon from HACs and it doesn't work at the moment
That's the same issue, missing codecs in the headless browser.
I've found a Workaround, is not a live-feed, but is the closest. you just need to change the settings inside the "Picture entity card configuration" - "camera view" from Live to Auto.
IT will refresh the picture every couple of seconds.
so far i've found possible only live-feed with esp32-cams as they work with MJPEG.
Hello all, I got a huge improvement today, you can have the live view on the headless browser with the WebRTC custom card, you just need to transcode to mjpeg, just be aware that this can be CPU intensive on low end HA
`
Step 1 — Define your camera stream with an FFmpeg transcode directive. The key syntax for H.264 → MJPEG is:
url: "ffmpeg:rtsp://user:password@
If your ONVIF camera needs TCP for RTSP (common), add the transport flag:
url: "ffmpeg:rtsp://user:password@
Step2 - WebRTC card configuration
type: custom:webrtc-camera
url:
Hopefully this will be helpful for your applications
Fixed in the latest server release.