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.58k stars 158 forks source link

WebRTC not working from web-ui dashboard #802

Open calimansi opened 1 year ago

calimansi commented 1 year ago

It was working yesterday, now it won't. If I type in the url for each camera through webrtc, it works fine. HLS works fine through the web-ui.

Weird.

JA16122000 commented 1 year ago

Can confirm, WebRTC is not working for now.

mrlt8 commented 1 year ago

This should be fixed in v2.1.7!

calimansi commented 1 year ago

That was quick!!! You guys are supposed to wait until I get impatient then fix it.

Anyway, thanks. Yep, it is fixed.

Mystichrome commented 1 year ago

This appears to still be happening for me in 2.1.7. Exact same behavior as calimansi described. Started in the middle of the day on version 2.1.6. I later upgraded to 2.1.7 after seeing this, but still having an issue getting WebRTC working from the web-ui. going into individual camera's works fine.

mrlt8 commented 1 year ago

There were some breaking changes to the way WebRTC was initialized with the backend MediaMTX, but it should have been resolved with 2.1.7.

Do you see anything in the browser console? Could you try another browser?

Mystichrome commented 1 year ago

I'm currently using brave browser, but have tried chrome and firefox. Same issue. In Chrome and Brave I'm seeing these errors for each camera:

webrtc.js:95 Sending offer X.X.X.X/:1 Access to fetch at 'http://X.X.X.X:8889/front/whep' from origin 'http://X.X.X.X:5000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status. :8889/front-yard/whep:1 Failed to load resource: net::ERR_FAILED webrtc.js:71 Error: TypeError: Failed to fetch at Receiver.createOffer (webrtc.js:97:9) at webrtc.js:87:51 onClose @ webrtc.js:71

Haven't had the chance to check firefox console.

mrlt8 commented 1 year ago

Hmm. The CORS issue should have been patched in MediaMTX v0.23.2. Are you using the latest docker image?

Mystichrome commented 1 year ago

I use the latest tag when pulling, yes. The web ui shows v2.1.7. Docker inspect:

[ { "Id": "sha256:ca5685c16c5faf64b00f2091b392aa592e18dd9f23e82e4f4e90cba2ea8a184a", "RepoTags": [ "mrlt8/wyze-bridge:latest" ], "RepoDigests": [ "mrlt8/wyze-bridge@sha256:d55ae4137063892a82dc7c6d68fcd54e6e4a518f30a6e6af97bb1da06f3cc10f" ], "Parent": "", "Comment": "buildkit.dockerfile.v0", "Created": "2023-05-20T13:50:51.446931279Z", "Container": "", "ContainerConfig": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": null, "Cmd": null, "Image": "", "Volumes": null, "WorkingDir": "", "Entrypoint": null, "OnBuild": null, "Labels": null }, "DockerVersion": "", "Author": "", "Config": { "Hostname": "", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": false, "OpenStdin": false, "StdinOnce": false, "Env": [ "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=C.UTF-8", "GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D", "PYTHON_VERSION=3.11.3", "PYTHON_PIP_VERSION=22.3.1", "PYTHON_SETUPTOOLS_VERSION=65.5.1", "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/0d8570dc44796f4369b652222cf176b3db6ac70e/public/get-pip.py", "PYTHON_GET_PIP_SHA256=96461deced5c2a487ddc65207ec5a9cffeca0d34e7af7ea1afc470ff0d746207", "PYTHONUNBUFFERED=1", "MTX_HLSVARIANT=fmp4", "MTX_PROTOCOLS=tcp", "MTX_READTIMEOUT=20s", "MTX_LOGLEVEL=warn", "MTX_WEBRTCICEUDPMUXADDRESS=:8189", "SDK_KEY=AQAAADQA6XDOFkuqH88f65by3FGpOiz2Dm6VtmRcohNFh/rK6OII97hoGzIJJv/qRjS3EDx17r7hKtmDA/a6oBLGOTC5Gml7PgFGe26VYBaZqQF34BwIwAMQX7BGsONLW8cqQbdI5Nm560hm50N6cYfT2YpE9ctsv5vP5S49Q5gg864IauaY3NuO1e9ZVOvJyLcIJqJRy95r4fMkTAwXZiQuFDAb", "FLASK_APP=frontend" ], "Cmd": [ "flask", "run", "--host=0.0.0.0" ], "ArgsEscaped": true, "Image": "", "Volumes": null, "WorkingDir": "/app", "Entrypoint": null, "OnBuild": null, "Labels": { "io.hass.arch": "amd64,armhf,aarch64", "io.hass.description": "WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container", "io.hass.name": "docker-wyze-bridge", "io.hass.type": "addon", "io.hass.version": "2.1.7", "org.opencontainers.image.created": "2023-05-20T13:50:00.830Z", "org.opencontainers.image.description": "WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container", "org.opencontainers.image.licenses": "", "org.opencontainers.image.revision": "5d134cff510b3942fee9e6269f330d4af1175176", "org.opencontainers.image.source": "https://github.com/mrlt8/docker-wyze-bridge", "org.opencontainers.image.title": "docker-wyze-bridge", "org.opencontainers.image.url": "https://github.com/mrlt8/docker-wyze-bridge", "org.opencontainers.image.version": "2.1.7" } }, "Architecture": "amd64", "Os": "linux", "Size": 220287934, "VirtualSize": 220287934, "GraphDriver": { "Data": { "LowerDir": "/var/lib/docker/overlay2/cb1e21363609102ee0b78595525a24e90d61ea1cb9cd166b7081058e04009227/diff:/var/lib/docker/overlay2/3357becdca16cd18cce8187c289bbc9520833f86cf83c1da6180c5cafba0c5ac/diff:/var/lib/docker/overlay2/59ec8fc1413cc4b54f9edcf14db6d9145f943b2df03147d2732fa7f6c7c981dc/diff:/var/lib/docker/overlay2/730cc7930ccad6951ea6ba05b42cc90a97d129ab5c71732857a2a67fef648252/diff:/var/lib/docker/overlay2/972604ec4419d2a3e30d62c7fe358213d3834d50e3bfa02b999ab4da0483b993/diff:/var/lib/docker/overlay2/fa63870ae478bafcb7c7a1934e833a0d0a11e0ded897a41edd4e9986f9e97875/diff", "MergedDir": "/var/lib/docker/overlay2/016cb6c0bd938706f9ca65ab511bd7f50bf500d5958f3b1558e09dfd587d4cb6/merged", "UpperDir": "/var/lib/docker/overlay2/016cb6c0bd938706f9ca65ab511bd7f50bf500d5958f3b1558e09dfd587d4cb6/diff", "WorkDir": "/var/lib/docker/overlay2/016cb6c0bd938706f9ca65ab511bd7f50bf500d5958f3b1558e09dfd587d4cb6/work" }, "Name": "overlay2" }, "RootFS": { "Type": "layers", "Layers": [ "sha256:8553b91047dad45bedc292812586f1621e0a464a09a7a7c2ce6ac5f8ba2535d7", "sha256:419599cb52880080b82e4b7e6302f6cbe1e98ec9b0ac638c38cd3a3f30666258", "sha256:9ba5352504aeaa5d18a0b2c8b92c158d3f160513f2383df73cf80e3b3a9d25ab", "sha256:c158cb38bbfe75bb9a8eb3a63930a2a86d41f87ad57d9283635be98464e4a41b", "sha256:cb53c9da2321a8d08c29b8d1fda73fd1abcd0ff034f95e63ba5121e45125cc43", "sha256:73155da81b7d2d1109fe3e10ce18226729cd0994f1ce11e3f8433835139b6fac", "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" ] }, "Metadata": { "LastTagTime": "0001-01-01T00:00:00Z" } } ]

mrlt8 commented 1 year ago

could you see if v2.1.8 fixes the cors issue?

Mystichrome commented 1 year ago

I'm still seeing the cors errors in 2.1.8 unfortunately. Is there possibly anything I missed that I need to do after the upgrade? I've tried restarting the connection to cameras, rtsp simple server, and clear cache and reconnect from the gui. Tried doing an incognito browser session as well.

Got a chance to look at firefox's console, similar message concerning cors:

15:29:11.419 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://X.X.X.X:8889/yard/whep. (Reason: CORS request did not succeed). Status code: (null).

calimansi commented 1 year ago

I'm running this on an x86 machine.

andrew-suh commented 1 year ago

I'm running into this as well on a docker container. I can use HLS, but webRTC fails completely. `

2023/08/15 15:05:38 | stdout | [WyzeBridge] 172.19.0.1 - - [15/Aug/2023 18:05:38] "GET / HTTP/1.1" 200 - 2023/08/15 15:05:37 | stdout | [garage-cam] [CONTROL] ERROR - Invalid command: topic='caminfo' not found cmd=('caminfo', '') 2023/08/15 15:05:37 | stdout | [garage-cam] [CONTROL] Attempting to GET: caminfo 2023/08/15 15:05:30 | stdout | [garage-cam] Setting bitrate=180 2023/08/15 15:05:30 | stdout | [garage-cam] Wrong bitrate=200 does not match 180 2023/08/15 15:05:16 | stdout | [WyzeBridge] ✅ '/garage-cam stream is UP! (3/3) 2023/08/15 15:05:15 | stdout | [garage-cam] WARNING: Skipping smaller frame at start of stream (frame_size=1)

`

mrlt8 commented 1 year ago

was it working in a previous version?