This article explains how to use a IP security camera and free open source video editing software to create a time-lapse movie. Please note that this process is not completely automated and does require some manual processing, but not much. Also, if you are going to do this project, I assume that you have a network IP camera that is capable of capturing snapshot images at an interval that you can configure.
As an alternative to IP cameras, you can use a CCTV camera with a network video server. Again though, the video server must support still image captures.
I will use mencoder on a Windows PC to encode the video. Please note that mencoder can be run on other operating systems and the process will be almost identical to this, but in this article I specifically use a Windows computer to document the process.
Configure IP Camera to Capture Images
Time lapse photography is something that I have experimented with and written about in the past. Please reference this article that I wrote in 2012 to see how to configure a Zavio IP camera to take timed snapshots. You can see the video that was created from that project here. At that time, I used commercial software to create the time -lapse movie of the snapshots that I captured of my ant farm. I saved all of the images from that original project and I will reuse them here.
If you are not using a Zavio camera for your project, you should check the documentation of your IP camera to see if it supports taking interval based snapshot photos. I think that most IP cameras that have an on board SD card support this function.
If you are going to use a CCTV camera, this Zavio video server can be configured in the same way as a Zavio camera to take snapshots.
After you have captured the images for the duration that you choose, download the images from your IP camera to your PC. The images will most likely be JPEG type. Save them all into a single directory and remember where you put them. We will come back to that location shortly.
Download Mencoder Software
Mencoder is a free open source software package that supports video decoding, encoding and filtering from the command line. Mencoder is released under the GNU General Public License. Download it here.
Be sure to download either the 32-bit or 64-bit binary version depending on which version of Windows your computer is running. If you are unsure if you are running 32 or 64 bit, right click on Computer and select properties, or select Control Panel > System & Security > Set the name of this Computer. The following screen will display and you can see if your system is 32 or 64 bit.
After you download the zipped mencoder file, unzip it. It will be unzipped into a folder that is named something like “mplayer-svn-37324-2-x86_64”. Rename that folder “Mencoder” and move the Mencoder folder into the C:\Program Files directory. So, the new location will be C:\Program Files\Mencoder
Create Time-Lapse Movie using Mencoder
Remember the location of your snapshot images? I hope so. We need to go there now.
Open up a command line window. You can do this by selecting Start then typing the following in the “search programs and files” field: cmd. Press enter or click on the cmd program that the search finds. A command line shell will open. Change directory to the location of your snapshot images. I put mine in C:\Users\admin\Downloads\Time-Lapse Pics.
Once you are in your snapshots directory, run the following command. Please note that you may want to change a few of the options of this command. My snapshots were captured at 720p resolution so I set the video scale to 1280:720 so that it matches the original size of my photos. You can change this to match yours or scale it down to the video size that you want.
I set the frame rate of my movie to 12 frames per second. This is set by setting fps=12. You can change this as you see fit. You probably want to experiment with the framerate to get the right effect for your time-lapse. Make a video with the frames per second set to 1 or 2, then again with it set to 12 and you will see what I mean. I compare 2 FPS to 12 FPS below.
Here is the command that you run to create the video.
\Program Files\Mencoder\mencoder “mf://*.jpg” -mf fps=12:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vbitrate=3000 -vf scale=1280:720 -oac copy -o movie.avi
Here is a screenshot of my session from the command line.
Time Lapse Videos
I originally captured 1600 images over the course of 4 days for my movie. I encoded the video twice, then uploaded them to YouTube. On the first video the frame rate is set to 12 FPS. On the second, I lowered it to 2. Watch both videos below to see the difference. Note: if you are going to play both videos at the same time, you should turn off the audio. The mix of the two songs is not good.
12 FPS Time-Lapse
2 FPS Time-Lapse
That is it. If you follow these steps, you should be good to go. If not or if you have questions, please let me know. Thanks for checking out my article!
*This article originally appeared in cctvcamerapro website.