0

I know this is a relatively simple question, but it is unclear to me if it is possible to schedule the google nest camera to take an image every 15 minutes and have it upload to the cloud.

I have looked at the SDM (Smart Device Management) API and found the following POST request:

sdm.devices.traits.CameraEventImage

POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "sdm.devices.commands.CameraEventImage.GenerateImage",
  "params" : {
    "eventId" : "26TU35cUFaYxYbQFumKQIilunU..."
  }
}

I am wondering if anyone has any experience with this. Is making this API call sufficient to trigger the camera to take an image, or does this need to programmed directly onto the camera.

Pit
  • 736
  • 3
  • 17

1 Answers1

0

I haven't found a way to generate an image directly through that command. However, I was able to execute GenerateRtspStream which gives you an rtsps link that is valid for 5 minutes and then create an image from that livestream link through ffmpeg with the commands shown in this stack overflow answer

{
  "command" : "sdm.devices.commands.CameraLiveStream.GenerateRtspStream",
  "params" : {
  }
}

which returns a response with the model

{
    "results": {
        "streamUrls": {
            "rtspUrl": "rtsps://stream:xxx"
        },
        "streamExtensionToken": "xxxx",
        "streamToken": "xxxx",
        "expiresAt": "datetime"
    }
}

and execute this command for converting rtsp(s) to an image with the name "nest-camera-image.jpg"

ffmpeg -y -i rtsp://admin:admin@192.168.10.113:554/live -vframes 1 nest-camera-image.jpg
Dan
  • 409
  • 3
  • 9
  • Dan, what you have pasted above is different from what google sdm api returns as the url, it start with rtsps and also there is no username and password, just a token. How do we use all that and pass it to ffmpeg in the command line? – sagar Mar 24 '23 at 15:50