mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.7k stars 176 forks source link

rtsp stream not working #1205

Open adamswm92 opened 6 months ago

adamswm92 commented 6 months ago

Describe the bug

Provide a clear and concise description of the issue and include logs if applicable.

upgraded to 2.9.1 and everything broke. tried rtsp stream in VLC and home-assistant, neither work. both timeout. HLS stream works fine. My end goal is to create a generic stream entity in home-assistant. These are outdoor cameras therefore i would prefer to bypass security if it will be a hassle.

ENV:

WB_AUTH | FALSE WB_PASSWORD | ***** WB_RTSP_URL | rtsp://**:8551/ WB_USERNAME | ****

Logs:

Environment (if applicable)

songokussm commented 6 months ago

i also have this problem.

mrlt8 commented 6 months ago

can you see if v2.9.2 helps with this issue?

zee-shany commented 6 months ago

i upgraded to 2.9.2 and my rtsp broke, i'm using rtsp for blueiris and frigate. neither of them are loading the camera stream

zee-shany commented 6 months ago

i upgraded to 2.9.2 and my rtsp broke, i'm using rtsp for blueiris and frigate. neither of them are loading the camera stream

i disabled webUI auth in the configuration, this brought up the rtsp stream back.

n2jwc commented 6 months ago

Mine is a new, never upgraded build.. WB_Auth=False and RTSP will not work at all.

edit I figured out my problem, I am trying to pull remote cameras and do not have a VPN setup to pull images direct from the camera. I need to look further, is there a way to just pull the RTSP from the container which proxies to Wyze cloud?

Misiu commented 6 months ago

I use Docker Wyze Bridge in version 2.9.5 on Home Assistant 2024.5.5. I have WebUi auth disabled. In the addon, I see the cameras and when I click on Play I see the video stream.

But my generic camera stopped working. I'm trying to update the URL's according to the WIKI (https://github.com/mrlt8/docker-wyze-bridge/wiki/Home-Assistant#generic-camera)

I should use (assuming my cam is named cam1): still_image_url: http://127.0.0.1:8123/local/cam1.jpg stream_source: rtsp://127.0.0.1:8554/cam1

but the still image isn't working. I was able to fix this using the https://github.com/mrlt8/docker-wyze-bridge/wiki/Home-Assistant#still-imagessnapshots option, so I must use: http://127.0.0.1:5000/img/cam1.jpg

I'm not sure if this is a bug in documentation or something in my system, but I'm unable to use the still image URL.

Finally, after configuring the generic camera, I'm able to see the image and play the stream, but most of the time I see a loading indicator, probably because I use RTSP stream. Any hints on how to use WebRTC or HLS in Home Assistant?

I use Cloudflared addon to access my instance remotely, but I see spinners even when I'm accessing HA inside my network via cable connected PC.

mrlt8 commented 6 months ago

Thank you @Misiu I will need to update the documentation.

jnewman33 commented 5 months ago

Latest HA 2004.6 with bridge 2.9.5 here. Various Wyze cams are available in webui and streams work in VLC but noi in home assistant generic camera with timeout error.

Misiu commented 5 months ago

Latest HA 2004.6 with bridge 2.9.5 here. Various Wyze cams are available in webui and streams work in VLC but noi in home assistant generic camera with timeout error.

Did you disable webUI auth? It helped in my case.

Chewie610 commented 5 months ago

@Misiu Were you able to ever get the WebRTC to work with Cloudflared? I am able to use the WebUI and watch the WebRTC streams if I'm connected locally to homeassistant (http://homeassistant:8123/) but I can never get it to work when watching through my Cloudflare tunnel. Even replacing the WebRTC link (in the addons config) with the local address wouldn't work (and would break the WebUI when using locally too...).

@mrlt8 Do you have any advice on getting the WebUI to work when remotely accessing it?

For my generic camera setup, I use "http://homeassistant:5000/img/cam-1.jpg" for my stillcam and the rtsp link given by the WebUI (make sure to use the one that is generated when connected to http://homeassistant:8123/, not through your Cloudflare tunnel).

I do have WebUI auth enabled, but I have also supplied my own username and password in the addons config. Strangely enough, the RTSP stream only works with the login combination of wb:API-key while the RTSP still image I generate works with the WebUI credentials I setup.

Mike5357 commented 5 months ago

Were you able to ever get the WebRTC to work with Cloudflared? I am able to use the WebUI and watch the WebRTC streams if I'm connected locally to homeassistant (http://homeassistant:8123/) but I can never get it to work when watching through my Cloudflare tunnel

Thanks for mentioning this, looks like this is the same issue I've been having as well. It wont load any streams when connected through an external URL but does using the local url- I've tried toggling a bunch of settings and currently have Audio, on_demand, motion api, mqtt, and webui auth all disabled. However, I'm able to get them working as Generic Cameras placed on my dashboard by using the internal URL, they just don't load in the Docker Wyze Bridge Web UI.

mrlt8 commented 5 months ago

It's probably a NAT issue with the container. You may be able to change the WB_IP to reflect the external IP. If you're on dev branch, you can set WB_IP to accept multiple comma-separated IPs.

@mrlt8 Do you have any advice on getting the WebUI to work when remotely accessing it?

Use a VPN or pass the RTSP stream to something like HomeKit.

Chewie610 commented 5 months ago

You may be able to change the WB_IP to reflect the external IP. If you're on dev branch, you can set WB_IP to accept multiple comma-separated IPs.

Is "WB_IP" the Bridge IP in the Home Assistant Configuration menu?

When using Cloudflare I don't need to (and don't have) an external IP for my Home Assistant so that makes things awkward... I just have a domain that uses Cloudflare as a DNS, which is able to tunnel directly to my home assistant server. When putting my domain name into the Bridge IP field, it doesn't work (probably because it's not intended to work that way...?) I guess the easiest way to fix this would be to get an external IP of my own...

The RTSP stream works fine as HomeAssistant is directly calling it locally using the Generic Camera (in a sense I don't need to load it remotely...?). However, I do like the WebUI interface more, but I guess it needs to load the WebRTC stream on my own remote end so it ends up not working if I don't use a VPN.

Please correct me if I'm wrong.

mrlt8 commented 5 months ago

Untested but you may be able to override the setting by adding something like this to the mediamtx option under advanced:

webrtcAdditionalHosts=my-dns.example.org

Note: webrtcAdditionalHosts is only available in the dev builds right now.

Misiu commented 5 months ago

@Chewie610 Sorry for the late reply. I use RTSP right now, but it is so super slow. I don't know how to set WebRTC, I tried it before but failed, that's why I asked in the comment how to do this from the beginning (do I need extra addons or integrations, config) A step-by-step instruction would be so helpful

Chewie610 commented 5 months ago

Strange, RTSP works perfectly fine for me. I'm using the one generated from the WebUI when accessed locally, not the 127.0.0.1 url you talked about.

For both me and @Mike5357, the WebUI only works when accessed locally (not using the cloudflare hostname, but rather the local http://homeassistant:8123/ method.

Additionally, only the RTSP link generated on the WebUI while on http://homeassistant:8123/ works for me. Like mentioned before, I also use http://homeassistant:5000/img/cam.jpg for the still image. Maybe try using this and see if it speeds up loading?

@mrlt8 mentioned webRTC additional hosts possibly working and allowing our custom hostnames for webRTC (which would fix the WebUI being accessed remotely), but I haven't been able to test it yet since I don't know where to get the dev build.

mrlt8 commented 5 months ago

@Chewie610 you should be able to see the dev build by enabling advanced mode in your user profile page in home assistant.

Chewie610 commented 5 months ago

@Chewie610 you should be able to see the dev build by enabling advanced mode in your user profile page in home assistant.

Hmm... I do have advanced mode enabled already. Does that mean I already have the dev build? It says I'm on version 2.9.7 for the add on.

mrlt8 commented 5 months ago

you should be able to see it in the add-on store:

ha
Chewie610 commented 5 months ago

Thanks! I tried it but it looks like it doesn't fix it. It causes the locally connected home assistant to load the video forever (with the spinning icon), but doesn't "load" for the cloudflared tunnel connection. Not sure what exactly the command is supposed to do, is it supposed to redirect the video to use my domain as the address instead?

loopy321 commented 1 week ago

Having the same issue on v. 2.10.3 and nothing of note in the debug logs. I'll also note that when I run WB in a non-homeassistant docker container (docker run -p 8554:8554 -p 8888:8888 -p 5050:5000 -e WB_AUTH=false mrlt8/wyze-bridge), it works exactly as expected (rtsp stream viewable in vlc).

When I test a cam with a working RTSP, I see:

telnet gate-cam 8554
Trying 192.168.1.x...
Connected to gate-cam.
Escape character is '^]'.
OPTIONS / RTSP/1.0\r\n\r\n

RTSP/1.0 200 OK
Public: OPTIONS, SETUP, TEARDOWN, DESCRIBE, PLAY, PAUSE, ANNOUNCE, RECORD

After setting up the WB homeassistant addon, I see the HLS and webrtc streams great, but nothing on the RTSP (note WB_AUTH is false):

telnet homeassistant 8554
Trying 192.168.1.y..
Connected to homeassistant.
Escape character is '^]'.

OPTIONS / RTSP/1.0\r\n\r\n
Connection closed by foreign host.

I can see the port is opened in homeassistant:

sudo netstat -tulpn | grep LISTEN |grep 85
tcp        0      0 0.0.0.0:8554            0.0.0.0:*               LISTEN      -