WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

WebRTC Camerastream does not load on one of my devices

Open Pirol62 opened this issue 1 year ago • 25 comments

  • Today I installed the component an run it successfully with two reolink E1 Outdoor cameras.
  • On one notebook and all my android devices, the custom webrtc camera works great.
  • Only on one of my devices, an older HP Elite notebook, the card does not load the stream.
  • Restart of HA, the notebook and the frontend did not solve the issue
  • The camera works with picture-glance card.

image

--HA 2027.6.4

Pirol62 avatar Jul 26 '24 14:07 Pirol62

+1 I have 3 android devices and 2 iphones. Two of the three androids are the same phone, one works and the other doesn't. On the third android it works. For the two ios, neither works. My sister said she has denied permission for a "permanent URL", but she couldn't tell me exactly. I uninstalled companion app and looked in the settings, but I can't figure out

wavelov3r avatar Aug 03 '24 12:08 wavelov3r

I have the same issue with my Reolink PoE Doorbell. Every few days it just stops. I have 9 cameras working on webRTC and only the Reolink has issues. Nothing in the logs, it just stops. I have worked out that if I stop and start the webRTC addon it fixes the problem. The rest of my cameras are Unifi and have not been an issue.

iJuiceman avatar Aug 23 '24 03:08 iJuiceman

Show card's config and stream info from go2rtc WebUI for active stream.

AlexxIT avatar Sep 03 '24 04:09 AlexxIT

type: custom:webrtc-camera url: rtsp://username:[email protected]:554/live/0/MAIN

doesnt work with 3.6.0 but works fine on old version.

Mytonn avatar Oct 14 '24 17:10 Mytonn

WebRTC 3.6.0 cameras don't load in the Android companion app but will load on the same device using the browser. version 2024.9.4-full io.homeassistant.companion.android

bastionbot avatar Oct 20 '24 13:10 bastionbot

Posts like "worked before and doesn't work now" don't provide anything useful for diagnosing the problem. There could be dozens of different reasons. Different cameras, different camera protocols, different viewing modes, different card settings, different browsers, different network setup and more.

go2rtc has good debugging features. Web interface, logs of different levels. You need to start with the stream info from WebUI. Then you can increase the level of logs and study them. Or attach the results here.

AlexxIT avatar Oct 20 '24 14:10 AlexxIT

I use the same dashboard on the mobile app and via the web.

type: custom:webrtc-camera
entity: camera.garage_mainstream

When I access the dashboard in the Home Assistant app, the camera card remains a broken image with "Loading...". If I use a web browser (mobile or desktop) the feeds load correctly.

I turned on debug logging for the integration and this was the result when trying to access via the app:

2024-10-20 14:00:28.607 DEBUG (MainThread) [custom_components.webrtc] New client: {'authSig': <snip>', 'entity': 'camera.garage_mainstream'}

The same logging, using a browser:

2024-10-20 14:06:30.296 DEBUG (MainThread) [custom_components.webrtc] New client: {'authSig': '<snip>', 'entity': 'camera.garage_mainstream'}
2024-10-20 14:06:30.341 DEBUG (webrtc) [custom_components.webrtc.utils] 14:06:30.340 INF [streams] create new stream url=rtsp://user:pass@ip:554/11
2024-10-20 14:06:30.362 DEBUG (webrtc) [custom_components.webrtc.utils] 14:06:30.362 INF [streams] create new stream url=rtsp://user:pass@ip:554/11

Home Assistant versions: Core 2024.10.3 Supervisor 2024.10.2 Operating System 13.2 Frontend 20241002.3

bastionbot avatar Oct 20 '24 18:10 bastionbot

Well. One user has problems with url: rtsp://... and another with entity: camera.... So this part of the setting is not related to the problem.

AlexxIT avatar Oct 20 '24 18:10 AlexxIT

Mine are RTSP cameras as well, they're just added in Home Assistant as Generic Camera first. Go2RTC seems like it's working fine, just for whatever reason the companion app isn't getting a stream and I'm not sure what additional logging is available to diagnose.

bastionbot avatar Oct 20 '24 18:10 bastionbot

This is probably a classic mobile app cache problem. And it saved the old version of the card.

AlexxIT avatar Oct 20 '24 18:10 AlexxIT

I thought so too, but the issue persists after clearing the cache and data. I will see if it is resolved once 2024.10.4 is available on the app store.

bastionbot avatar Oct 20 '24 19:10 bastionbot

You need to check stream info when stream opens in mobile browser. And stream info when stream opens in hass app.

AlexxIT avatar Oct 21 '24 14:10 AlexxIT

Browser: garage_camera.json

App: garage_camera2.json

bastionbot avatar Oct 21 '24 14:10 bastionbot

Nothing special. Simple codecs H264+PCMA. You needs to increase go2rtc log level to trace and check difference between browser and app connections.

AlexxIT avatar Oct 21 '24 15:10 AlexxIT

App:

12:00:58.747 PM	trace	[api] GET /api/ws?src=rtsp://<user>:<pass>@<dvr>:554/11&name=camera.garage_mainstream 127.0.0.1:60526
12:00:58.885 PM	trace	undefined error=websocket: close 1000 (normal) caller=github.com/AlexxIT/go2rtc/internal/api/ws/ws.go:124

Browser: trace.log

bastionbot avatar Oct 21 '24 16:10 bastionbot

Ok. Probably the mobile app is crashing on executing JavaScript. Tell me the exact version of the mobile app. And exact version of mobile OS.

AlexxIT avatar Oct 22 '24 08:10 AlexxIT

Home Assistant Companion: 2024.10.3-full (the update from 2024.9.4-full didn't fix it)

Android 14

Android security update: September 5, 2024

Google Play system update: September 1, 2024

Kernel version: 5.15.137-android14-11

Build: AP2A.240905.003

bastionbot avatar Oct 23 '24 00:10 bastionbot

same issue on android 14, players on other devices fine but not the android tablet.

ddanielww avatar Oct 26 '24 18:10 ddanielww

I'm running HASSIO 11.2 and utilizing the new integrated WebRTC feature to connect my Dahua camera. It functions flawlessly on the Edge browser of my Windows PC and on Sidekick on my iMac. However, I encounter numerous issues on my iPad Pro 10.5". In the HA app, the WebRTC camera view intermittently pauses or displays a black screen, restarts the view, shows an error message, and occasionally works. On the Safari/Edge browsers on the iPad, the behavior is somewhat similar but seems slightly more stable. Despite clearing the Safari cache and restarting the iPad, there are no significant changes in behavior.

pjj108 avatar Nov 19 '24 10:11 pjj108

I'm running HASSIO 11.2 and utilizing the new integrated WebRTC feature to connect my Dahua camera. It functions flawlessly on the Edge browser of my Windows PC and on Sidekick on my iMac. However, I encounter numerous issues on my iPad Pro 10.5". In the HA app, the WebRTC camera view intermittently pauses or displays a black screen, restarts the view, shows an error message, and occasionally works. On the Safari/Edge browsers on the iPad, the behavior is somewhat similar but seems slightly more stable. Despite clearing the Safari cache and restarting the iPad, there are no significant changes in behavior.

I am not sure it's relevant to this thread, but I have the same behaviour. HA app on iPad Pro actually loses connection to HA sometimes and has to be killed. But this is using the new built-in go2rtc and Picture Glance cards. So like I said, probably not the right place - but I wanted to +1 that anyway

RyanEwen avatar Nov 22 '24 22:11 RyanEwen

I have similar problem.. I know it's doesn't help with log , but not sure what to look at. In my case I have 3 camera on latest home assistant version 2024.1. I use fully kiosk on my Samsung a8 tablet and the 3 camera load well with version 3.5.2 but it doesn't work it version 3.6. It does load on my PC and even my android phone (pixel 8 pro with android 14) but on the tablet (Samsung a8) camera streams don't load , even if I try chrome browser , home assistant app or fully kiosk. Went back to 3.5.2 and all loads and work as intended.

I know it might not help to troubleshoot but it clarifies that indeed there is some problem.

If you let me know what your need to troubleshoot it , I could share the relevant log.

igalg99 avatar Jan 24 '25 22:01 igalg99

This is probably a classic H264 Main/High 5.1 profile problem. You can find out your stream profile by looking up stream probe/info in the go2rtc WebUI.

AlexxIT avatar Jan 25 '25 07:01 AlexxIT

I had the same issue and it works for me in android campanion app after forcing mode to mse. Otherwise it uses rtc and fails:

type: custom:webrtc-camera
url: annkehq
mode: mse

0hax avatar Jul 13 '25 12:07 0hax

Just in case anyone's looking for an answer to this one and landed here via a search, like I did, my solution was to use the Cromite browser.

Firefox, Firefox for Android Beta, and Chromium all failed to show the webrtc camera, but Cromite displayed it with no tweaking of anything required.

I installed it via f-droid.org and the FFupdater app they have which allows a bunch of different browsers to be tried out. You might find one that solves this for your device.

Bit-River avatar Oct 07 '25 16:10 Bit-River

I had a similar problem but I finally found the answer for me. Thought i’d post here if someone else is having my setup and problem. My setup is a Home Assistant running on a intel nuc. Webrtc-cards (from HACS) work fine on pc, companion app (on Android) but not on my pad (Android running fully kiosk browser)

I was using the http://homeassistant.local:8123/ address on my Android pad. But on my pc and phone I was using the ip address http://x.x.x.x:8123/. Changing to the ip address on my pad fixed my streaming issues. I’m not sure exactly whats going on but I think it’s got to do with mDNS name resolution. I don’t think that the WebView implementation in fully kiosk can resolve “.local” hostnames. So the stream fails. Again I’m not sure but this worked for me. I've posted this in the HA community hoping this can help someone else aswell.

Phiing avatar Oct 14 '25 17:10 Phiing