I am using the following API by Google, https://developers.google.com/nest/device-access/traits/device/camera-live-stream
I have successfully been able to see a list of my devices and relevant information. I also am able to make a successful GenerateRtspStream
request. I receive the following response as documented on their API
{
"results" : {
"streamUrls" : {
"rtsp_url" : "rtsps://someurl.com/CjY5Y3VKaTZwR3o4Y19YbTVfMF...?auth=g.0.streamingToken"
},
"streamExtensionToken" : "CjY5Y3VKaTZwR3o4Y19YbTVfMF...",
"streamToken" : "g.0.streamingToken",
"expiresAt" : "2018-01-04T18:30:00.000Z"
}
}
The problem however is I am unable to access the video feed. I have tried using things like VLC player and Pot Player to view the live feed, but they say that URL does not exist. I have also tried using OpenCV
in python
to try and access the live-feed as well and it also does not work ( I have tested opencv
on local files and they work just fine ).
Am I doing something wrong with rtsps
urls? How do I access the live-feed, either in python
or some third-party application like VLC Player
Here is some examples of what I have already tried doing:
import cv2 as cv
x = cv.VideoCapture(STREAM_URL)
# ret is False --- it works on local files as it returns True and I am able to view the media
ret, img = x.read()
Here is the attempt using Pot Player/VLC
My goal is to do processing on this video-feed/image in python, so ideally my solution would be using opencv
or something along those lines. I was mainly using VLC
and other players to debug the issue with this url first.
UPDATE
I have tested using the following public link rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov :
MYURL = "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"
MYURL = STREAM_URL
import cv2 as cv
x = cv.VideoCapture(MYURL)
while(True):
ret, img = x.read()
if not ret:
print('URL not working')
break
cv.imshow('frame', img)
cv.waitKey(1)
And it works perfectly with opencv
as well as Pot Player
. So maybe the issue is with the Google Devices Access API? The URL they provide may not be correct? Or am I missing something here?
Maybe it has to do with the rtsps
URL vs rtsp
? How can I fix that?