AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.87k stars 318 forks source link

Alexa incompatibility with Go2RTC RTSP stream #1235

Open lawrence-jeff opened 2 weeks ago

lawrence-jeff commented 2 weeks ago

I'm trying to get monocle (an RTSP proxy for Alexa with an associated skill) instance working with the go2RTC restream provided by Frigate (v 1.9.2)

I have found that the proxy works with the source streams but Alexa fails immediately when trying to pull the restream from go2rtc. Looking at wireshark and comparing the difference it seems that after Amazon gets the Describe result image It then tries to do a SETUP command to the go2RTC stream with the control part added, so in this example it does a SETUP to rtsp://homeassistant.local:8554/annke/trackID=0

And then go2RTC replies with Unsupported transport image

The process repeats a few times and Alexa/Amazon gives up

Bypassing go2rtc and using the same setup with the camera directly, it accepts that SETUP request and then establishes a connection. I see the same behavior across Reolink, Annke and Amcrest devices

Any thoughts on this? It would be great if go2rtc worked better with these Alexa requests then you can easily expose all your streams to the Monocle skill

ElksInNC commented 1 week ago

Good sleuthing on the setup traffic!

I fought with this one a lot and gave up. If you goto the Monocle forums there is some discussion about what Alexa considers a "valid" stream - seems to be a bit of a black box.

Both cams that I want to be able to use (Amcrest doorbell and turret) will work fine just pulling the RTSP stream directly including Audio. So I just live with it - since it isn't on 24/7. I have Frigate triggering car/person/dog on my front walk and person on the doorbell to turn on the Alexa camera automatically (via Home Assitant) and then turn it back off a few minutes later.

Never could get Birdseye re-stream to work on Alexa.

image

AlexxIT commented 4 days ago

You don't needs Wireshark. Just collect go2rtc logs with trace level for rtsp module.

lawrence-jeff commented 4 days ago

Ok - Well however we got there, is there anyway to make Go2RTC to accept a connection passing a trackID? Or to not have it advertise (probably the wrong word) it in the SDP for the Go2RTC stream? The only spec type reference I could find seemed to indicate that it should be honored if provided in the describe response

AlexxIT commented 3 days ago

Your question wrong. SETUP request always has control part (trackID in your example). This is part of RTSP proto and go2rtc of course support it.

You should collect logs to find real problem.