Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top