1

Using Google's Nest Device Access API, I can generate an RTSP camera stream using the GenerateRtspStream command and subsequently stop the stream using the StopRtspStream command. Makes sense, however these streams are only alive for 5 minutes by default - so the API also features another command: ExtendRtspStream.

On the face of it, this sounds like it should "extend" the stream you had originally created, however these RTSP stream urls include an auth query parameter and extending a stream simply issues a new token to use for this, which means that the url for the stream changes every time it gets extended. So in reality the stream isn't getting extended at all as the url you use to access the stream still gets invalidated, and you have to restart it with a new url to continue watching the stream. So what's the point? You may as well just call the GenerateRtspStream command and switch over to that one once the first expires. Is there some way to seamlessly change the RTSP url mid-stream that I'm not aware of using FFMPEG, perhaps? Or to have a proxy server that broadcasts a static RTSP url and seamlessly switches the actual url each time it gets extended?


Rant starts here: I'm really hoping that this behaviour is actually a bug or oversight in the design of the API, and that ExtendRtspStream is supposed to keep the same url alive for as long as needed, because it's awfully pointless to have an RTSP stream that only stays alive for a max of 5 minutes. Heck, it'd be more useful to have an API that just returns the latest single-image snapshot from the camera every 10 seconds or so - but alas, there's no API for that either.

6twenty
  • 822
  • 5
  • 11
  • Did you find a way extend the stream without invalidating it? – trianta2 Dec 18 '21 at 04:23
  • No, I haven’t been able to find anyone to contact to confirm if this behaviour is intentional or not (and if it is, how they expect anyone to actually use it) – 6twenty Dec 19 '21 at 05:23
  • I see. Well at least it's consistent with the SDM API being awful to use. – trianta2 Dec 19 '21 at 18:01
  • FWIW, my solution was to start another subscriber in parallel staggered ~3 minutes out (3 minutes because it can take a while for the feed to start). I'm only interested in the audio, so I do a cross correlation between adjacent clips to find when they overlap, and merge the clips for one continuous segment. – trianta2 Dec 28 '21 at 19:07
  • 1
    Clever! That's the sort of thing you'd think you wouldn't have to resort to, but glad you found a way to do it – 6twenty Dec 28 '21 at 22:10
  • Can you open a ticket on the Public Issue Tracker (https://issuetracker.google.com) ? Please attach the logs for your issue as it will help us in analysis of the issue. – Siddhant Priyadarshi Jun 30 '23 at 15:35
  • @SiddhantPriyadarshi Sorry, but no. I no longer own Nest devices and lost interest in trying to make this work a long time ago. – 6twenty Jul 02 '23 at 00:16

0 Answers0