I have an Ip webcam that shows an image on it's small webserver. I want my raspberry pi to grab these images and save them with a date and time. Sort of like a timelapse. The camera is supposed to only be connected over the internet.
Asked
Active
Viewed 2,649 times
0
-
possible duplicate of [How to get a list of video capture devices (web cameras) on linux ( ubuntu )? (C/C++)](http://stackoverflow.com/questions/4290834/how-to-get-a-list-of-video-capture-devices-web-cameras-on-linux-ubuntu-c) – PW Kad Aug 13 '13 at 17:04
-
No, Im trying to grab a picture off an online source – Dragongeek Aug 13 '13 at 17:08
1 Answers
1
wget
is your friend here. It's a program made to download files from the command line. Does the picture have a static URL? If so, it will be as easy as:
wget -O `date "+%m-%d-%H%M"`.jpg http://example.com/camera/thepicture.jpg
In this command, -O
signifies that wget should write the downloaded file to the name
`date "+%m-%d-%H%M"`.jpg
If you're not familiar with the date
program, it outputs the current system time and date in a format you specify -- the format string I showed here means "month-day-HourMinute" (on a 24-hour clock). So, if I ran this command right now, I would end up with a file named 08-13-1338.jpg
.
This is basically the simplest possible case, but you haven't given too much information about the problem. If this solution doesn't meet your needs, please provide further information about the problem.

c.maclean
- 401
- 2
- 9
-
Thanks! This is exactly what I needed. Where can I specify where to save the file to? – Dragongeek Aug 13 '13 at 19:35
-
Just add a path before the `date` command, like this: `wget -O /home/pictures/`date "+%m-%d-%H%M"`.jpg`. Happy coding :) – c.maclean Aug 13 '13 at 19:45
-
Excuse the poor formatting of my previous comment, apparently you can't use
tags in comments and so nested backticks do not show up. Regardless, to specify where to save the file, just add a path before the `date` command – c.maclean Aug 13 '13 at 20:01