AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.35k stars 161 forks source link

go2rtc working fine, but no video in HA due to "Uncaught error from Chrome" / "this.ondata is not a function" errors #677

Open SR-G opened 3 months ago

SR-G commented 3 months ago

Summary : i'm not able to view any stream from an EZVIZ inside HomeAssistant. However, the URL taken from WebRTC (through WebRTC UI) does work with ffplay. And i have numerous errors in ha log :

WebSocket.<anonymous> (/webrtc/video-rtc.js:338:22)
2024-04-02 23:34:41.868 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Linux x86_64
TypeError: this.ondata is not a function

Home Assistant is installed through docker (latest docker image = up to date + fresh install) WebRTC has been installed manually from github release (= 3.5.1)

My card in HA UI is : (password removed) :

type: custom:webrtc-camera
url: rtsp://admin:XXXXXX@192.168.8.194:554/Streaming/Channels/101
muted: true

(note : it's the same with /102 (lower resolution) + this exact same rtsp URL works fine when directly used with ffplay) (also the same with muted line being there or not)

If i go under the :1984 WebRTC page and under "links.html" for that stream, i see this (i suppose) proxified URL :

ffplay -fflags nobuffer -flags low_delay -rtsp_transport tcp "rtsp://<server running HA and webrtc>:8554/rtsp://admin:XXXXXX@192.168.8.194:554/Streaming/channels/102"

And ... this command is working fine ! So i believe that the WebRTC proxy is working. But not the rendering inside CHROME. Due to these "this.ondata is not a function" errors ...

Any ideas ?

Extra notes :

SR-G commented 3 months ago

Mhh, ok, have just tested on a different computer (this time running Windows 11 and not Archlinux), and on that one (with Vivaldi) :

The non-working station (my main station) is running latest ARCHLINUX / CHROME (version = 123, supposedely with x265 decoding features) (Version 123.0.6312.86 (Official Build) (64-bit), of course with hardware acceleration activated in settings) + a NVIDIA T600 GPU

                  .o+`                   ----------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Kernel: 6.6.10-arch1-1 
               `+oooooo:                 Uptime: 4 days, 1 hour, 18 mins 
               -+oooooo+:                Packages: 1651 (pacman), 5 (flatpak) 
             `/:-:++oooo+:               Shell: zsh 5.9 
            `/++++/+++++++:              Resolution: 1920x1080, 1920x1080, 1200x1920, 1920x1080 
           `/++++++++++++++:             DE: GNOME 46.0 
          `/+++ooooooooooooo/`           WM: Mutter 
         ./ooosssso++osssssso+`          WM Theme: Adwaita 
        .oossssso-````/ossssss+`         Theme: Adwaita [GTK2/3] 
       -osssssso.      :ssssssso.        Icons: Adwaita [GTK2/3] 
      :osssssss/        osssso+++.       Terminal: terminator 
     /ossssssss/        +ssssooo/-       CPU: 11th Gen Intel i7-11700K (16) @ 4.900GHz 
   `/ossssso+/:-        -:/+osssso+-     GPU: Intel RocketLake-S GT1 [UHD Graphics 750] 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA T600 
 `++:.                           `-/+/   Memory: 18706MiB / 31832MiB 
AlexxIT commented 2 months ago

I don't think I can make a test stand with Arch Linux and Chrome 123. I think some problem with HTML5 MSE for this environment.

songochain commented 2 months ago

Hi I got this error in home Assistant

11:55:24.148 ERR github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166 > error="streams: wrong login"

It's a camera vacuum

BR.