People have contacted me about doing timelapse photography, so I'm going to post this article and expand it over time with details about how this is done.
Available Timelapse Methods
In short, I'm using 2 methods:
(1) CHDK with a Canon camera, and
(2) GB Timelapse software.
CHDK is a good choice because you don't need a computer dedicated to the camera. It does take more time to set up, but once you do, it's very stable and completely portable, plus (as a bonus) it adds many more features to your camera.
GB Timelapse software has a decent user interface, but my major problem with it is this: If you have your computer doing other work, GB Timelapse may crash often (in our experience), which is quite frustrating when doing timelapse.
On the other hand, I have used it on a dedicate XP machine that does nothing else but timelapse and it works for weeks without a single glitch. So if you can dedicate a machine to timelapse, this may work well for you.
Of course, GBTimelapse much simpler than using CHDK, but CHDK is not really hard. You just have to take the time to read the instructions. Also, with GB Timelapse, make sure you have the right operating system for your camera. Some cameras require XP, for example.
Links
To learn about the CHDK method, visit the official CHDK Wiki.
The CHDK documentation is currently hard to follow, so I will try to write more organized and simplified instructions below.
I will be expanding this page shortly with more details about my method for doing timelapse.
Using CHDK
I will be expanding this section shortly.
This process is a little detailed, but it's not difficult as long as you follow the instructions. The hardest part is just finding the documentation you need and finding an Intervalometer script to install within the CHDK operating system.
Following are the basic steps to using CHDK:
(1) Check your camera's software version. You actually need to load a file on your camera's memory card to do this.
(2) Download the correct CHDK version for your camera.
(3) Download and add "Intervalometer" software to the CHDK software.
(4) Learn how to use CHDK.
Finding an Intervalometer Script that Works with Your Camera
This is the one I'm using on my Canon A650IS. It works fine even though the documentation does not mention this particular model.
I am using the original version of the script, as shown here:
Code
rem Author - Keoeeit
rem Written for S-Series
rem Should be okay on others
rem Use Endless mode with caution
rem See documentation for important info
rem first version
@title Ultra Intervalometer
@param a Delay 1st Shot (Mins)
@default a 0
@param b Delay 1st Shot (Secs)
@default b 0
@param c Number of Shots
@default c 5
@param d Interval (Minutes)
@default d 0
@param e Interval (Seconds)
@default e 0
@param f Interval (10th Seconds)
@default f 5
@param g Endless? No=0 Yes=1
@default g 0
p=a*60000+b*1000
t=d*60000+e*1000+f*100
if c<1 then let c=5
if t<100 then let t=100
if g<0 then let g=0
if g>1 then let g=1
if p<0 then let p=0
z=t*c
y=p+z
print "1 Cycle Time:", y/60000; "min", y%60000/1000; "sec"
goto "interval"
:interval
if p>0 then gosub "pause"
print "Shot 1 of", c
shoot
if c=1 then end
for n=2 to c
sleep t
print "Shot", n, "of", c
shoot
next n
if g=1 then goto "interval" else end
:pause
n=(a*60)+b
for m=1 to n
q=n-m
print "Intvl Begins:", q/60; "min", q%60; "sec"
sleep 930
next m
return
When you are ready to convert your thousands of timelapse images into a movie, it's necessary to have your images named properly.
For example, your timelapse software (or camera) may begin numbering images at some value other than zero. Then, it may flip - like an odometer - back to zero after it runs out of numbers.
This situation can cause ffmpeg, MEncoder, and other processors to process the images in the wrong order.
So occasionally, you may need to rename all of your images for a particular timelapse session so they sort upward alphabetically according to the time they were taken.
I wrote a file-renaming utility for just this reason. It's free, so feel free to download it here:
To rename all of the files in the current directory so they sort properly by ffmpeg and MEncoder, just rename them according to their modification date. Make sure that the year is first, then the month, then the day, etc. so the final file names looks like this:
Once you download the utility, you can issue this command to rename all of the JPG files in the current directory in this format:
Code
rtrenamefiles -file-mask *.jpg
If you prefer to have the files named sequentially from 1 to 10000 (or whatever is your total number of images), follow the above command with this command:
Now your files will be renamed sequentially (starting at 1) according to the date they were modified. It's best to use the last-modified date because this is the date the files were last written to and usually reflects the actual date the picture was taken. The creation date can change if the image is simply copied from one location to another.
If you have any problems, feel free to contact me.
Good luck with your timelapse movies. Be sure to post them here on this forum.
Russ Tanner, Founder, Administrator, Programmer GlobalSkywatch.com My Chemtrail Story
Once you have all of your timelapse images ready to merge into a movie, it's easy to create a movie from it.
Just install MPlayer on your computer. When you do this, a command line utility called MEncoder will automatically be installed. This utility will enable you to easily encode a series of JPG files into a movie.
I have been using mencoder to add captions to timelapse video that I create from a series of photos. I perform these 2 functions in a single step using mencoder.
Following are some samples.
Basic Title for Video
This puts a title on the screen for the first few seconds of the video.
The -font argument needs to be provided with the path to a font file. In this example, I used the Verdana font located in my Windows\fonts folder.
-sub title.srt
The -sub argument specifies an "srt" file that exists in the current directory. This file is called a "SubRip Title" file and normally has the extension "srt". The text for the title(s) is located in this file.
The "srt" file has the following format:
Code
1
00:00:00,000 --> 00:00:15,000
This is the text of the first title.
2
00:00:30,000 --> 00:01:00,000
This is the text of the second title.
The "1" and "2 are simply serial numbers indicating the title "number".
The second line represents the time the title starts and ends in hours:minutes:seconds. The "seconds" field contains 3 decimal places after the comma. Note that the comma is a decimal delimiter used in France (the origin of the "srt" file format). Americans should think of this as a decimal point (because that's what it represents).
The third line is the actual text that you want to have displayed. This text is limited to a maximum of 2 lines in length.
So, if you wanted to have a single title displayed throughout the length of your video, your "srt" file may look like this:
Code
1
00:00:00,000 --> 99:00:00,000
This is my subtitle.
Note that the start time is the very beginning of the video and the end time is much longer than the video. This ensures the title is displayed all the way through the video.
-subalign 2
This tells mencoder to align the title with the bottom of the video.
-subfont-autoscale 0
This tells mencoder to interpret the value of the -subfont-text-scale argument as "points".
-subfont-text-scale 16
This tells mencoder to make the font size of the title 16 points. In order for this argument to be interpreted as a "point" size, the argument -subfont-autoscale must be set to 0 (zero).
Russ Tanner, Founder, Administrator, Programmer GlobalSkywatch.com My Chemtrail Story
-sub <subtitlefile1,subtitlefile2,...>
Use/display these subtitle files. Only one file can be displayed at the same time.
-sub-bg-alpha <0-255>
Specify the alpha channel value for subtitles and OSD backgrounds. Big values mean more transparency. 0 means completely
transparent.
-sub-bg-color <0-255>
Specify the color value for subtitles and OSD backgrounds. Currently subtitles are grayscale so this value is equivalent to
the intensity of the color. 255 means white and 0 black.
-sub-demuxer <[+]name> (-subfile only) (BETA CODE)
Force subtitle demuxer type for -subfile. Use a + before the
name to force it, this will skip some checks! Give the demuxer
name as printed by -sub-demuxer help. For backward compatibility it also accepts the demuxer ID as defined in subreader.h.
-sub-fuzziness <mode>
Adjust matching fuzziness when searching for subtitles:
0 exact match
1 Load all subs containing movie name.
2 Load all subs in the current directory.
-sub-no-text-pp
Disables any kind of text post processing done after loading the
subtitles. Used for debug purposes.
-subalign <0-2>
Specify which edge of the subtitles should be aligned at the
height given by -subpos.
0 Align subtitle top edge (original behavior).
1 Align subtitle center.
2 Align subtitle bottom edge (default).
-subcc
Display DVD Closed Caption (CC) subtitles. These are not the
VOB subtitles, these are special ASCII subtitles for the hearing
impaired encoded in the VOB userdata stream on most region 1
DVDs. CC subtitles have not been spotted on DVDs from other regions so far.
-subcp <codepage> (iconv only)
If your system supports iconv(3), you can use this option to
specify the subtitle codepage.
EXAMPLE:
-subcp latin2
-subcp cp1250
-subcp enca:<language>:<fallback codepage> (ENCA only)
You can specify your language using a two letter language code
to make ENCA detect the codepage automatically. If unsure, enter anything and watch mplayer -v output for available languages. Fallback codepage specifies the codepage to use, when
autodetection fails.
EXAMPLE:
-subcp enca:cs:latin2
Guess the encoding, assuming the subtitles are Czech,
fall back on latin 2, if the detection fails.
-subcp enca:pl:cp1250
Guess the encoding for Polish, fall back on cp1250.
-subdelay <sec>
Delays subtitles by <sec> seconds. Can be negative.
-subfile <filename> (BETA CODE)
Currently useless. Same as -audiofile, but for subtitle streams
(OggDS?).
-subfont <path to font (FreeType), font pattern (Fontconfig)> (FreeType
only)
Sets the subtitle font (see -font). If no -subfont is given,
-font is used.
-subfont-autoscale <0-3> (FreeType only)
Sets the autoscale mode.
NOTE: 0 means that text scale and OSD scale are font heights in
points.
The mode can be:
0 no autoscale
1 proportional to movie height
2 proportional to movie width
3 proportional to movie diagonal (default)
-subfont-blur <0-8> (FreeType only)
Sets the font blur radius (default: 2).
-subfont-encoding <value> (FreeType only)
Sets the font encoding. When set to unicode, all the glyphs
from the font file will be rendered and unicode will be used
(default: unicode).
-subfont-osd-scale <0-100> (FreeType only)
Sets the autoscale coefficient of the OSD elements (default: 6).
-subfont-outline <0-8> (FreeType only)
Sets the font outline thickness (default: 2).
-subfont-text-scale <0-100> (FreeType only)
Sets the subtitle text autoscale coefficient as percentage of
the screen size (default: 5).
-subfps <rate>
Specify the framerate of the subtitle file (default: movie fps).
NOTE: <rate> > movie fps speeds the subtitles up for frame-based
subtitle files and slows them down for time-based ones.
-subpos <0-100> (useful with -vf expand)
Specify the position of subtitles on the screen. The value is
the vertical position of the subtitle in % of the screen height.
-subwidth <10-100>
Specify the maximum width of subtitles on the screen. Useful
for TV-out. The value is the width of the subtitle in % of the
screen width.
DOS Script for Joining JPGs in Multiple Subdirectories Into an AVI
This is a small DOS script that I wrote that turns JPGs from multiple subdirectories into a single AVI (movie).
This script requires that mencoder be installed.
When I capture a series of JPG pictures on my Canon A650 camera using CHDK with an intervalometer script, they are stored on the SD card like this:
Code
123CANON
124CANON
125CANON
126CANON
As you can see above, pictures are stored in each subsequent *CANON directory. The pics are spread out across many directories because this camera formats the SD card in DOS (12-bit) format which can only contain a limited number of files (JPGs) per directory.
When I copy the SD card contents to my hard drive, my file system setup looks like this:
Now, the problem is this: In order to turn all these pictures into a movie, you have to put them into a single directory and have them named so they sort according to their creation date (actually the "last modified" date is more reliable).
I run a custom script from this directory (I call this a "date-root" directory because it is the root directory for a specific date):
C:\Timelapse\2010-08-10
and it performs this sequence of events:
(1) Rename files in all subdirectories (like "123CANON", etc.) to date-modified (like "2010-08-10_11-23-53.jpg"). This ensures that the files are joined in the right order by mencoder in step 3.
(2) Copy all files from all subdirectories (like "123CANON", etc.) up one level to the date-root directory (in this example: "2010-08-10"). This is required because mencoder needs all joined files to be in a single directory.
(3) Use mencoder to join all JPG files in the date-root directory into a single AVI movie.
I wrote the following script so you can do all these steps with a single command. Just run the script in the date-root directory (like C:\Timelapse\2010-08-10). A movie file called "_movie.avi" will be created in the current directory. This is your final movie with all JPGs joined together. This file can be uploaded directly to YouTube as is.
If you make a mistake, you can run the script more than once in the same directory with no ill effects.
To use this script, your computer must meet the following requirements:
(1) Have mencoder installed (2) Have rtrenamefiles installed (3) Have the system "PATH" variable point to both of the above executable (EXE) programs. (Do this from Control Panel > System > Advanced - depends on operating system)
If you want the movie to have a title, just create a file called "_title.srt" in the date-root directory with the format described in a previous post on this thread. You will also have to make sure the -font argument of mencoder points to a valid font on your computer.
To use this batch file, just copy the following text and place it into a file called jpg-to-avi.bat. Make sure the Windows environment variable PATH points to it (see above).
Code
:: JPG to AVI by Russ Tanner v 1.00
:: No warranty is expressed or implied.
:: Use at your own risk.
:: Distribute freely.
:: Available at: http://urlbam.com/ha/M002z
@echo off
:: In all subdirectories:
:: (1) Rename each *.jpg file to its modified date.
:: (2) Copy each *.jpg file to its parent directory.
for /d %%x in (*) do (
echo Processing Directory %%x
cd %%x
rtrenamefiles -file-mask *.jpg
for %%y in (*.jpg) do (
echo Copying %%y
copy %%y ..\*
)
cd ..
)
:: Encode all JPGs to an AVI.
mencoder "mf://*.jpg" -o _movie.avi -ovc lavc -lavcopts vcodec=mjpeg -font c:\windows\fonts\verdana.ttf -sub _title.srt -subalign 2 -subfont-autoscale 0 -subfont-text-scale 16
Russ Tanner, Founder, Administrator, Programmer GlobalSkywatch.com My Chemtrail Story
When I first purchased GB Timelapse to control one of my Canon timelapse cameras, I was having issues with it disconnecting from the camera, sometimes once a day, sometimes once every 5 minutes.
Through MUCH turmoil and experimentation, I found the source of the issues and want to post them here to save you all the time and trouble.
USB Extension Cables
My first problem was that the was camera disconnecting from the computer and from the GB Timelapse program. I discovered that this was the USB extension cables I was using.
I had purchased some nice USB 2.0 repeater cables that can be daisy changed up to 16 feet. This allowed me to put the camera away from the computer (so the computer didn't have to be next to the window).
I moved the computer to the window and removed the USB extension cables. 90% of my disconnect problems vanished.
The canon remote drivers that GB timelapse uses to communicate with the camera are very finicky about errors in communication via the USB cable.
Extra Shielding
To get rid of the remaining 10% of disconnect issues, I tried putting tin foil around the USB cable and then alligator-clipping the foil to the computer ground (the case) as an experiment (photos below) to see if it was picking up EMF noise.
Sure enough, this eliminated 9% of the remaining 10% of my disconnect issues, but it would still disconnect a few times a week, which was frustrating if it was in the middle of a great chemtrail capture.
Stainless Steel Shielding
Finally, I purchased some high quality braided stainless steel shielding and wrapped the USB cable in it instead of the foil. I then clipped the shielding to the computer case (ground) with an alligator clip.
This has eliminated all remaining disconnect issues and I have now run my camera for about 3 months non-stop without a single disconnect.
I cut it so it actually covers nearly all of the cable. It even covers the noise-reducing metal bead/cylinder at the end of the cable. I then secured it at each end with a nylon cable tie (see photos below).
Raising Windows Process Priority
When I recently connected a web cam to the same computer for automatically uploading pictures to our server, I once again began having the same disconnect issues with GB Timelapse.
I solved this issue by Raising the Process/Thread priority from "Normal" to "Above Norma" for GB Timelapse. I figured perhaps YawCam (the web cam software that I'm using) was stealing just enough CPU time to interfere with the USB communication between the camera and the computer.
You can change a thread or process priority by pressing Ctrl-Alt-Delete (as if you want to reset the computer), then go to the Task Manager, then go to the "Processes" tab. Right click on GB Timelapse, then "Priority", then set it to "Above Normal".
I haven't had a single disconnect issue since.
I hope this saves you a lot of time and trouble.
If you have any problems or questions about doing timelapse, please feel free to let me know.
Last edited by admin; 12/10/1103:11 PM.
Russ Tanner, Founder, Administrator, Programmer GlobalSkywatch.com My Chemtrail Story