Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get webrtc stream from wyze-bridge #588

Closed
kevkid opened this issue Aug 20, 2023 · 8 comments
Closed

Get webrtc stream from wyze-bridge #588

kevkid opened this issue Aug 20, 2023 · 8 comments
Labels
question Further information is requested
Milestone

Comments

@kevkid
Copy link

kevkid commented Aug 20, 2023

Hi I want to get the webrtc stream from wyze bridge. I am not sure how to do it?

Reading the documentation:
https://github.com/AlexxIT/go2rtc#source-webrtc
for docker-wyze-bridge I can get the webrtc url and it looks like this:
http://<wyze-bridge-ip>:8889/backyard-side-camera
As the docs state I can use echo to get the url that looks like: webrtc:http://<wyze-bridge-ip>:5000/signaling/camera1?kvs#format=wyze
I can use the request library and grab the html, but I don't understand what I am looking for exactly? As I understand webrtc is dynamic and p2p, so I can understand the link being dynamic.

What would a script look like that can get me the url? I tried following along with: https://github.com/AlexxIT/go2rtc/wiki/Source-Echo-examples but they explicitly look for a .3mu url.

Current script:

import re
import sys
from urllib.parse import urljoin
from urllib.request import urlopen
html = urlopen("<wyze-bridge-ip>:8889/front-yard-cam").read().decode("utf-8")
@AlexxIT AlexxIT added the question Further information is requested label Aug 20, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Aug 20, 2023

With webrtc:http://<wyze-bridge-ip>:5000/signaling/camera1?kvs#format=wyze source go2rtc connects direct to Amazon servers.
Looks like http://<wyze-bridge-ip>:8889/backyard-side-camera is address of this project
https://github.com/bluenviron/mediamtx#webrtc-clients

@kevkid
Copy link
Author

kevkid commented Aug 20, 2023

With webrtc:http://<wyze-bridge-ip>:5000/signaling/camera1?kvs#format=wyze source go2rtc connects direct to Amazon servers. Looks like http://<wyze-bridge-ip>:8889/backyard-side-camera is address of this project https://github.com/bluenviron/mediamtx#webrtc-clients

Thank you, I am just a little confused as to what the actual url should look like?
Should it look like this:

go2rtc:
  streams:
    back_side: webrtc:http://<wyze-bridge-ip>:8889/backyard-side-camera

or

go2rtc:
  streams:
    back_side: http://<wyze-bridge-ip>:5000/signaling/camera1?kvs#format=wyze

The former gives me:
[rtsp] error="SetRemoteDescription called with no ice-ufrag" stream=back_side

The latter seems to work, atleast it did. I thought the amazon server one was:
webrtc-kinesis: webrtc:wss://...amazonaws.com/?...#format=kinesis#client_id=...#ice_servers=[{...},{...}]

it seems like I have to echo something that I get from a requests command. I assume I have to open a url to a webrtc stream (the one coming from wyze-bridge), in doing so I will be able to open the stream (? I think i have to do a handshake or something?)

@AlexxIT
Copy link
Owner

AlexxIT commented Aug 21, 2023

Both of your urls wrong. You should use exact as example
webrtc:http://<wyze-bridge-ip>:5000/signaling/<camera-name>?kvs#format=wyze

You can open url in your browser and it should response with connection credentials
http://<wyze-bridge-ip>:5000/signaling/<camera-name>?kvs

So format:
webrtc:<working-url>#format=wyze

@kevkid
Copy link
Author

kevkid commented Aug 21, 2023

Both of your urls wrong. You should use exact as example webrtc:http://<wyze-bridge-ip>:5000/signaling/<camera-name>?kvs#format=wyze

You can open url in your browser and it should response with connection credentials http://<wyze-bridge-ip>:5000/signaling/<camera-name>?kvs

So format: webrtc:<working-url>#format=wyze

This is correct, using this works: webrtc:http://:5000/signaling/?kvs#format=wyze

and if we remove the webrtc: part and put the rest in the browser you get some kind of json.

Thank you, and was funny seeing you drop in to the wyze-bridge comment :)

@kevkid kevkid closed this as completed Aug 21, 2023
@ryang3d
Copy link

ryang3d commented Aug 21, 2023

Was following this discussion here and on the wyze-bridge issue tracker this morning. I can't seem to get this to work.

Is it necessary to run any script like @kevkid shows in his OP, or is formatting the config like below what should do the trick?

go2rtc:
  streams:
    back_side: webrtc:http://<wyze-bridge-ip>:5000/signaling/<camera-name>?kvs#format=wyze

I have go2rtc (upgraded to latest/current version) running from inside a frigate docker container and the docker-wyze-bridge in a separate container. I'm able to stream RTSP feeds from the wyze-bridge to frigate using go2rtc, but webrtc just refuses to work (I get the black screen with "No frames have been received, check error logs" message). Using the above format doesn't work, and I've tried a few other things with no luck... what am I missing? 🤔

@kevkid
Copy link
Author

kevkid commented Aug 21, 2023

btw I never got it to do anything with the secript, Here it is in the documentation though:
https://github.com/AlexxIT/go2rtc#source-webrtc

@ryang3d
Copy link

ryang3d commented Aug 21, 2023

btw I never got it to do anything with the secript, Here it is in the documentation though: https://github.com/AlexxIT/go2rtc#source-webrtc

Yeahhh, that's what I thought. I've looked at that documentation page so many times now xD. No such luck here yet, but nice to hear that it is working for you

@AlexxIT
Copy link
Owner

AlexxIT commented Aug 22, 2023

I got it. The documentation is confusing. Only kinesis users needs scripts.

echo script should output (echo) supported link in go2rtc format. For example:

echo "wss://...amazonaws.com/?...#format=kinesis#client_id=...#ice_servers=[{...},{...}]"

AlexxIT added a commit that referenced this issue Aug 23, 2023
@AlexxIT AlexxIT added this to the v1.7.0 milestone Sep 2, 2023
felipecrs pushed a commit to felipecrs/go2rtc that referenced this issue Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants