Timelapse using Micro Framework
Time Lapse photography/filming is a technique to show very slow processes. It is the opposite of high speed video. Everything is shown a lot faster then it actually happens. To make a time-lapse video you take a picture every n seconds and merge them to a video. If you take a picture every 5 seconds and put them in a 25fps video the speed increase is 5×25 = 125x. More information on Timelapse can be found on Wikipedia.
Timelapse video of clouds. Made using MFTimelapse with 5 second interval and a Samsung ES15.
There are camera’s that have a time-lapse function build in. This is of course the easiest method. There is only one drawback. Making a time-lapse video is not good for your camera. For a short video you’re making thousands of photos, for each photo the shutter has to open and close. Therefore your camera will wear out very vast.
NOTE: The instructions in this post are my experiences. Be careful when opening a camera. The flash capacitor can hold 300DC voltage even when the camera is off. I’m not liable for any damage and harm to you and/or your camera!
Technique:

Camera shoot button
For my system I’m using the cheapest camera I could find and modified it so I can remotely trigger the focus and shoot button. I used a Samsung ES15 camera. To make your camera ready for timelapse, open up your camera and find the button used to take a picture. On most camera’s this button has one pin to ground and 2 switch pins. The first switch triggers the focus and the second switch triggers the shoot.
A picture of this is shown on the left. It’s easiest to start looking for the ground pin. Most of the times this pin will be surrounded by a big ground plane. Next pin to find is the focus pin. When you notice that your camera is focusing you know you’ve found it. Now it’s time for some soldering, on most camera’s the shoot switch doesn’t work without the focus switch closed. When you’ve closed the focus switch find the shoot switch. Your camera should now take a picture. Make sure both switches are released before trying to take a new photo.
To control the camera I use two GPIO pins on the Embedded Master. One for focus (UART_TXD2) and one for shoot (UART_RXD2). The ES15 refused to take a photo when both switches are closed at the same time.
The software opens the two GPIO pins as TristatePorts. In Idle state they are configured as inputs. To trigger a GPIO port they are set as output port with active low. The time diagram for a photo is a following:
- The focus pin is pulled low by setting TristatePort.Active
- Wait 1000ms (gives time for camera to focus)
- The shoot pin is pulled low by setting TristatePort.Active
- Wait 500ms (Camera is taking photo)
- Release shoot pin by resetting TristatePort.Active
- Release focus pin by resetting TristatePort.Active
- Wait for next photo
Software:
The software is very simple. It allows setting the interval by ticking a checkbox (This is only allowed when not running). And press on “Start timelapse”. The white bar is showing remaining time until next photo and the number displayed is the number of photos taken. To stop the timelapse click on “Stop timelapse”. As said before this program is very simple. I’m thinking of adding some more options like start/stop time, custom input of nr. of seconds, etc.
The software uses UART_TXD2 for focus and UART_RXD2 for shoot. Both GPIO ports are available on the UEXT connector below the TFT screen. How you connect these ports onto your camera is your responsibility.
MFTimelapse Screenshot
Converting photos to movie:
I found Mencoder the easiest to use for converting the (JPEG) photos to a movie. Mencoder is part of Mplayer. For windows you can download a Win32 port on http://oss.netfarm.it/mplayer-win32.php. I always convert my movies to moving JPEG. These files are larger then most formats but every frame is a keyframe so the picture is very high quality.
I use the following command:
mencoder "mf://*.JPG" -vf scale=640:480 -o timelapse.avi -of lavf -ovc lavc -lavcopts vcodec=mjpeg -lavfopts format=avi
Download:
You can download the Visual Studio 2008 solution: MFTimelapse.zip
Be aware that usage of this software is at your own risk. You can comment on the software but I can’t help with questions how to connect the Embedded Master to your camera!
Recent Comments