RTSPS for Google Nest Cameras

I had a setup reading my google nest cameras and putting them into Security using the rtsp-simple-server to read it from google and rebroadcast to SecuritySpy, but something seems to have stopped working. It may be google, or rtsp-simple-server, but I can't tell. I was hoping to use view cam to look at the server, but I'm not sure how to access it. I have a program to get the google-nest stream, and to extend the tokens so it stays live, but the access for it is something like below, and I can't figure out how to plug this into view cam or security spy to look at them directly. Is there a way to access this camera stream using one of the programs, given the URL below?


rtsps://stream-us1-foxtrot.dropcam.com:443/sdm_live_stream/CiUA2vuxr_Y83eqC9B8mlOYwNfONs0mlre6kgutz8LmjSLMayWNEEnEAEGF6Shiw60XscryVXy5SvAGwC3NGHPG8uJ5aTqAvnOxPAsWdyJ1-BQ5JAS9Y3P5Tcl2s4Bck_OFje99PcQ-fR3xEfamKetxXcPW4QoGl3BKb0n084DlUjykpERrHG1Q38MlR3evr2tpFTVO7XYz_nw?auth=g.0.eyJraWQiOiIyMzhiNTUxZmMyM2EyM2Y4M2E2ZTE3MmJjZTg0YmU3ZjgxMzAzMmM4IiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJuZXN0LXNlY3VyaXR594eSIsInN1YiI6Im5lc3RfaWQ6bmVzdC1waG9lbml4LXByb2Q6MTQxNDQwMSIsInBvbCIoLXNjb3BlLUFQSV9TRE1fU0VSVklDRS1jbGllbnQtMTA2NTg1OTY0NjQyNC1scG9mbWVkZDRqNm5lYzVwbW1tZ2dzM2R2MjNzcWN0OS5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImV4cCI6MTY5MTM3ODYzOX0.T6Ed8UdYXM7im606LQdNTsFHQsZSdi7UNqUxQn_v6ltRfqe5e621bs_vrJv3TVBhedX7C2BQmALEfKoJn56OdmwnLws1_rAwkeh6TvDk-zWPUvr4lOeGHutUOEZfKewO5__Xhv0vTHRF54nP9cYunFi3tBdypy_ULoANowlAHtZtTOAKeO_t_vf4j8q6FV7w9pAACqKK54yIvRPKor5I3cZngT-0l54yIKJEz95HrbucUZxiNcPdZuBGhTQ6uVT3OYx111C3Ny0pMaqyrq0Ekrc0oa7mO5QEsLtbGS4GXfMx8vvVcQxSrkzg0y-RE1_-0-gFMHO-nvz-Q

Comments

  • Normally what you'd do in SecuritySpy/ViewCam is to use the "Manual Configuration" profile, and then to plug into the "Request" box the path section of the URL (i.e. all the text after the third forward slash). However, the path section in this URL is more than 900 characters, which is far longer than what SecuritySpy/ViewCam can accept (maximum 255 characters) so this limitation is going to prevent this from working.

    We're not familiar with RTSPS streams from Nest cameras, nor with rtsp-simple-server. How were you creating the setup for this camera previously in SecuritySpy? And how does the extension of the tokens work? Does Google officially sanction this kind of use of the RTSPS stream?

  • There is an API from google that lets you view a stream from the camera. This is the python module that I use to communicate with google: https://pypi.org/project/python-google-nest/

    The way it works is you first have to authorize the cameras to be viewed, and you get a secret. You use that secret to request a token, which also returns a URL for the stream and an extension token. The token lasts for 5 minutes, and within that time you can request an extension.

    I wrote a program to get the camera stream URL and also extend the tokens every 4 minutes. I then feed the URL into rstp-simple-server (https://github.com/bluenviron/mediamtx), which can read the stream and then republishes it out as a rtsp instead of rtsps, and I set security spy up to read that stream.

    Ideally, and assuming that I can use an API or update a file to update SecuritySpy with the URL of the camera I'd love to cut the rtsp-simple-server out of the equation.

  • I was able to figure out my mistake and get my Nest cameras working again. I still think it would be better if I could do it directly into security spy, but bouncing through the proxy works. I'm happy to share the instructions and code if anyone wants it.

  • Good to hear you worked this out and it's now streaming again via the proxy.

    SecuritySpy can do RTSPS, so I think the only barrier here is the super-long URL that is beyond SecuritySpy's limit (we have never seen an RTSP URL this long - this limit has never been a problem before!). Since this is such an edge case I'm not sure if we'll be raising this limit, so for the moment I think you'll have to continue to use the proxy.

  • Hi @xev - if you could please share your code, I would really appreciate it. Thanks!

  • yeah I wouldn't mind knowing this either . Have a nest cam lying around that I'd like to try to add in here. Thanks