This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Graphics & Multimedia

Time-lapse photography with dvd-slideshow

By Chad Files on February 22, 2008 (4:00:00 PM)

Share    Print    Comments   

Over the last few years I have been experimenting with time-lapse photography. One easy way to compile a time-lapse video is to use dvd-slideshow, a tool for creating video slideshows from digital photos, and more.

To get started, copy your photos into a single directory on your computer, then use dvd-slideshow's dir2slideshow utility to create the control file that dvd-slideshow needs. The -n flag tells dir2slideshow what to name the slideshow:

dir2slideshow -n "Time Lapse Video" /path/to/photos

When dir2slideshow finishes, it leaves a text file in the current directory whose name closely matches the name you provided; underscores replace spaces and special characters in the name. If you edit the file you'll see several lines at the beginning that provide a title and some fade effects to the video when it is rendered. I suggest removing these; you can always go back and add titles later. Also check the last few lines and decide whether you want to remove the additional effect commands there. When you are finished, every line should look something like the following:

./IMG_***.JPG:5

These lines tell dvd-slideshow where to place the images and how long to display them, in seconds. Depending on the target length of your video you may need to change the duration for each image.

This is where things can get tricky. Suppose you estimated a video would take 720 photos, but it really took 912 -- the actual number for the video of ice melting in the figure. If we used them all in a 30-second video, they'd have to go really fast. Instead, I changed the length of the video to 60 seconds. Divide the number of seconds the video needs to be by the number of photos. For the ice melting that means 60/912 = 0.0657. dvd-slideshow balks if you give it more than three numbers to the right of the decimal point, so round off the number. This step takes some practice; don't be discouraged if the result is not what you want the first time.

Once you have a figure for the duration, you can replace the default value in the control file by using a small sed command:

sed 's/:5/:\0.066/g' Time_Lapse_Video.txt > New_Time_Lapse_Video.txt

Finally you're ready to make the video with dvd-slideshow. If you have several hundred photos this will take a while:

dvd-slideshow -f New_Time_Lapse_Video.txt

The command above should produce a video named Time_Lapse_Video.vob. This file is just a DVD quality MPEG video; the vob extension is what DVD players use. You should be able to view the video with most of the standard Linux video players, such as Xine, MPlayer, and Totem. Most of the major video sharing Web sites, such as YouTube and Google Video, will accept the vob file and convert it to a Web-playable version automatically.

Once you know how to use dvd-slideshow to create a time-lapse video, you can start doing other interesting things. With dvd-slideshow you can add audio, titles, and effects to the video by editing the control file before you run the dvd-slideshow command. You can read more about the parameters in the control file on the dvd-slideshow Web site.

Dvd-slideshow also creates a dvdauthor stub when it runs. This file can be incorporated into a dvdauthor control file to eventually make a DVD disk image. The name of the stub is the same as the dvd-slideshow control file, except it has an XML extension.

If you want to do more in-depth video editing, you can use ffmpeg to create a raw digital video (DV) version of the video that you can edit with Kino:

ffmpeg -i Time_Lapse_Video.vob -target ntsc-dv Time_Lapse_Video.dv

With ffmpeg you can convert the video to all sorts of formats and sizes. I encourage you to look at the ffmpeg documentation for more information.

Creating time-lapse videos with Linux is not only possible but not that hard to do.

Chad Files, a software developer and writer, has been developing software applications for more than 10 years, and is a contributing developer to many open source projects.

Share    Print    Comments   

Comments

on Time-lapse photography with dvd-slideshow

Note: Comments are owned by the poster. We are not responsible for their content.

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 198.91.8.99] on February 22, 2008 05:18 PM
The video is broke

#

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 198.91.8.99] on February 22, 2008 05:18 PM

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 146.114.69.89] on February 22, 2008 05:59 PM
"The video is broke"

Your grammar is "broke"

#

ffmpeg as encoder

Posted by: Anonymous [ip: 24.4.200.219] on February 22, 2008 06:09 PM
ffmpeg is probably fine to generate DV files, but it's an atrocious MPEG2 encoder. It has poor to non-existent rate control, and the image quality is bad.
mpeg2enc, the MPEG2 encoder that comes with mjpegtools, is better. Has usable rate control, provides better image quality.
Recently, I started to experiment with HC Encoder. It's a Windows app, but it runs very well under WINE. It's as fast or faster than ffmpeg, and the image quality is better than mpeg2enc. It has excellent rate control too. I think I might use it exclusively from now on.

#

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 69.248.159.33] on February 22, 2008 09:42 PM
Woohoo! I can hardly wait for the sequel: "Watching Paint Dry"

Seriously, a nice idea. Thanks for the article.

Are there any tools that would let you tweak the images for alignment or brightness/color, e.g. if you collected the images over a period of weeks or months and therefore had some variation in exact camera placement or lighting? I mean, you could use Gimp obviously, but does it give you any way to preview the images as a video or animation? Having to render the slide show and then go back and say "Oops I need to shift frame 73 slightly to the left" is not going to be much fun.

#

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 71.248.244.77] on February 22, 2008 10:28 PM
Nice work!

#

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 71.68.53.102] on February 23, 2008 01:45 AM
Just about any picture manager should work.

#

Time-lapse photography with dvd-slideshow

Posted by: Anonymous [ip: 159.153.4.51] on February 26, 2008 11:16 AM
When making timelapse it helps to use your cameras manual settings. Manual focus and manual exposure/white balance will help reduce shifting and strobing in your frames.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya