Capture DropCam (Nest Cam) frames to Google Drive
Updated June 17, 2019: This is now broken for Nest/DropCam devices. It will still work for anything that has a web accessible image URL. Clint points out in the comments below that you can fix up the URL for Nest cams but it looks like you need to be logged into nest.com so it doesn't work from Apps Script. Google is also retiring Works with Nest because they're "...reimagining how technology and services can deliver simple and helpful experiences in your home..." which apparently translates to only working with Google Assistant. I'll update this post if I figure out a work around.
Here's an easy way to capture frames from a DropCam to Google Drive. This only works if you have a public feed for your DropCam.
Go to the public page for your DropCam (Settings -> Public -> Short URL Link) and then view source for that page. Near the top you can find the still image URL for your DropCam:
<meta property="og:image" content="https://nexusapi.dropcam.com/get_image?uuid=12345&height=200" />
In Google Drive create a new Apps Script (If you don't already have Apps Script you can find it via Connect more apps...). Paste in the following code:
Replace the uuid parameter in the URL with the uuid from the still image URL for your DropCam. Note that the height parameter in the script has been changed to 1280 to get the largest possible image. A timestamp is being used to add a random cache busting parameter to the still image URL and is also used as the filename for the image.
The script will save the images to a folder called DCFrames - either create this folder in your drive or change this parameter to the desired folder.
Run the script and check that it's working. If everything looks good go to Resources -> Current project's triggers in the Apps Script editor. You can now set up a timer to save a frame as frequently as every minute (which I'm using to collect frames to make a daily time lapse movie). You can also ask Apps Script to send you an email when the script fails.
Updated 2015-07-01: DropCam is now Nest Cam - assuming that Nest keep the API going everything should keep working as above for both types of camera.
Related Posts
- Get an email when your security camera sees something new (Apps Script + Cloud Vision)
- How to backup Google Photos to Google Drive automatically after July 2019 with Apps Script
- Automate Google PageSpeed Insights and Core Web Vitals Logging with Apps Script
- Monitor page index status with Google Sheets, Apps Script and the Google Search Console API
- Style Transfer for Time Lapse Photography
(Published to the Fediverse as: Capture DropCam (Nest Cam) frames to Google Drive #etc #drive #google #dropcam Use Google Apps Script to automatically save images from your Nest Cam / Drop Cam. Keep an archive or create a timelapse movie. )
Comments
Working again as of July, 2021! I'm sure there's a few ways to get the camera URL, here's how I did it:
1) go to the camera's live page on nest.com:
https:// video.nest.com/live/StKL8UTWsa
2) open Chrome's Dev Tools -> Network tab
3) reload the page and organize the results in the Network tab by type, and look for the jpeg. In my case that's:
https:// nexusapi-us1.camera.home.nest.com/get_image?uuid=d62aa97fdae445af8ebea9328d5fcb06&width=540&public=StKL8UTWsa
Adjust the width to taste.
Hopefully this works longterm! Let there be timelapses again!
Well this BS commenting system forbids the use of links on a topic that is all about links. Will the moderator please switch this restriction off?
I just got mine to work with this link:
https : / / nexusapi-us1.dropcam.com/get_image?uuid=12345&public=blahblah
I got it working, Nest Cam and www.teleport.io, am now able to capture time-lapse with it quite reliably.
The steps:
1. Go to your public Nest Cam page video.nest.com/live/FSh..
2. View source on it and extract the RTMP url from the page html source i.e. rtmps://stream-uc2-bravo.dropcam.com/nexus/fad5..
3. Create a Teleport feed and enter this url in the feed dashboard under Capture image -> 'Manual url'
Timelapse is now automatically created. You can also view all historical images, as well as embed the player on your own website.
If you manage to get a url that gives you an image, an easy way is to use www.teleport.io to grab those images and create time-lapse and historical record automatically.
@Wrybread Thanks for the scripts! I will give this a shot on my home computer and see how it works...Unfortunately, I don't have access to a web server. I already have mine sending a snapshot every minute to a directory in Google Drive. I set a Google API script to make a new folder/directory in Drive each day with that day's date as the name. Then a second script to grab the snapshot every minute and save to the folder named after the current date. So I basically end up with a folder/directory on Drive named "June-14-2019" that contains over a thousand images (one from each minute that day), another folder/directory "June-15-2019" with an image of every minute from that day, etc...I was hoping I could somehow make another Google API Script that would take each day's folder of images and make a daily time lapse (using Google Drive's resources, instead of having a script on the computer locally download over a Gig of images, encode to mp4 and re-upload the finished video to the web)..This does not seem possible though, since there's apparently no way of installing an encoder like FFMPEG on Google Drive....I can sync the images to Google Photos and use the animation function to to create a timelapse. It works, but that platform is limited to only 50 photos per animation; Not even enough to cover one hour considering I take one image per minute...And no way of combining multiple animations into one without downloading locally. Weather Underground does what I'm looking for, but their time lapse is resized so small that it's blurry.
For Nest Cam users, I assume there's no way to email a snapshot on a time interval? If it can email snapshots to your gmail account as attachments, those images will show up on Google Drive. Alternatively, if you can FTP images from the cam to the internet, that would open up other work arounds for grabbing the latest image on a time interval. Lastly, I wonder if there's a way to pass along the log in credentials with the URL. For example, on some of my security cams that are password protected, I can add "username:password" in an area inside the URL which causes external media players to play the live video screen without prompting me to enter login credentials. If Nest Cam supports that, it may allow the script to essentially "log in" to your account as it's requesting the image instead of hitting a "forbidden" error.
Oops, I changed the name of the github repo to:
github DOT com/wrybread/Python-Security-Camera-Timelapser
I posted my script to download images from cameras here:
github DOT com/wrybread/Python-Security-Camera-Image-Downloader-For-Timelapses
Robert, I can't load my image URL even when I'm logged in to my Nest account. Can you post a sample URL you're using?
I'm using this:
https: SLASH SLASH nexusapi-us1.dropcam DOT com/get_image?uuid=MYUUID&width=1000
(Obviously replacing MYUUID with my camera's UUID). Getting rid of the width parameter doesn't fix it. When I log into my Nest account with Chrome and then load that URL in Chrome I still get "forbidden".
I'm hoping there's some other address though, since I can make a Python script that first logs in and then downloads the image.
And @Cleve, most cameras have URLs for getting still images, and most are easier to get than with Nest cameras, assuming you're on the same network. Here's a page showing the format for your camera:
ipcamtalk DOT com/threads/get-still-image-through-url-from-hikvision-nvr-solved.6279/
I'll try to post my scripts to github this week. FYI I have a cron job running on a web server every minute grabbing and saving an image. If you don't have access to a webserver that lets you run Python scripts and schedule tasks using cron you could also have it run on any computer, but the nice thing about a webserver is it's out of sight out of mind, just does it's thing remotely for years.
My second script builds the timelapse video from a directory of still images. You could also use commercial applications for that, and possibly freeware ones, there's a ton of them out there. But I'll post that one too.
All, It looks like this won't work with apps script any more. See the update at the top of the post. The new image URL requires you to be logged in at nest.com, and Google is shutting down the Nest API next month so it doesn't look like that will be a path forward either. Will update if I come up with a way around this but doesn't look good right now.
@Wrybread Great video. This is what I'm looking to do. Would you mind sharing your script? My google/gmail account is clevelandernest ....I'm not familiar with python, so I would not know where to start in writing one myself. I'm assuming the python script runs on Google Drive and creates the video there? I don't have a dropcam, I'm using a Hikvision IP security cam, so unfortunately my URL format would not work for accessing a dropcam.
Add Comment
All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.