Santa Ponsa from Sean McCormack on Vimeo.
Timelapse Panning Video
one hour compressed down to 12 seconds · no sound
by Sean McCormack
( larger high-def version is here )
At right is a short timelapse video (12 seconds, no sound) that Lightroom expert Sean McCormack made from the collection of 300 images he ended up with after setting his camera up on a tripod and having it take a shot every 10 seconds for 50 minutes.
To see the high-resolution version, go here and look for the “four arrows” icon at the lower-right of the video. Click that to put the video into full-screen mode. Then, click the “scaling is on” badge in the upper right to turn scaling off so you see the original size. Then, play the video.
He didn't move the camera during the hour the pictures were being taken, so the original images from the camera were, of course, of one static view. To create the panning effect, Sean used a combination of Adobe Lightroom and little Perl script that I created for him.
I'm publishing the script here in case the more adventurous timelapse makers among you wish to use it. I say adventurous because it's not particularly straightforward, it requires some technical abilities, and it's possible that it could corrupt the images (but you do have backups, right?).
Prerequisites
The instructions assume that...
You already have the original frames.
You have perl available on your system.
Macs come with perl already installed. Windows users can get a free version at ActiveState.
You can work in a command window (Win) or a Terminal Window (Mac).
You know how to convert a bunch of images into a video.
The script itself is here: pan (save as a raw text file; the instructions assume that you name the file “pan”)
Instructions
Make backups of the images. Really.
Load the frames into Adobe Lightroom.
Crop the first frame where you want your pan to start. You'll probably want to use a crop with the same aspect ratio as your target video format. Do not use any rotation because the panning script can't yet handle rotation.
Copy that crop (Ctrl-Shift-C) and apply it (Ctrl-Shift-V) to the final frame. Then, ensuring that the aspect ratio is locked, move/resize the crop to how you want it at the end of the video.
If you don't resize the crop, but only move it, you'll end up with a simple pan. If you also resize the crop, you'll end up with a zoom-in or zoom-out Ken Burns effect.
Now, apply a crop (any crop) to all the intervening frames. You can, for example, simply apply the crop you happened to have from step #3 above. It doesn't matter exactly what crop you apply because it'll end up getting changed by my script, but you must apply some crop at this point.
Select all the frames, and “Save Metadata to Files” (Ctrl-S).
Now switch to a terminal/command window, and cd to the folder holding the images in question.
Run the command “perl pan” and name all the files for the frames, in order, as arguments. If all the frames are by themselves in one folder, and the images are named sequentially, you can usually get away with simply typing:
perl pan *.jpg
with the caveat that you'll have to give the full path to the script (or first copy the script to image folder).
WARNING: the script writes a new crop directly into the intervening frames, but does so in a way that's not very smart and is very brittle; it could easily screw up and corrupt your images. Be sure to have backups.
Back in Lightroom, select all the frames and “Read metadata from Files”. Lightroom will load the crop info that the script wrote to the files. (The script does not modify the first and last frames, so you don't need to include those frames in this step, but it doesn't hurt.)
You can now export all the frames and create the video. Be sure to resize to uniform dimensions if the pan involves any kind of zooming.
I've never actually done one of these myself (my experiences with timelapse photography is limited to this short cherry-blossom timelapse), but I'll try some day soon. I'd like to see what others come up with, so if you make one, let me know!
Thanks for that. It will be very useful. Sean warned me it was coming before you posted it, so that’s why I had it on my website so fast. Perhaps it can be extended to do gradual exposure compensation to compensate for changes in light (sunsets and such).
Why not simply drop all photos in a video application like Premiere or Vegas?
That’s much easier and offers far more possibilities.
I think because Sean’s desire to do the panning was less than his desire not to spend hundreds of dollars on a video app with which to do it. If he already had one that could do it, then by all means, that would have been easier. —Jeffrey
Yep.. I was being suitably tight in this economic downturn.
This may be heresy on this blog, but Windows Movie Maker is free, and I think would do something similar. No?
Well you answered your own question (“No”), but even if Movie Maker were to do this, it’s “free” only for those who have paid for Microsoft Windows and some hardware to run it on. Sean doesn’t run Windows. Apple’s free (in a comparable sense) iMovie doesn’t allow for it either. —Jeffy
Help. I can’t seem to save the script as a raw text file. My only options are text file or all files?
Help?
Todd
Ok. I was able to save it as a text file, but now it is saying can’t open perl script “pan” : no such file or director. I do have it in the right folder though.
TB
Hi Jeffrey,
Cool script. I don’t know anything about perl but it does look like your script requires that you have to have at least 3 arguments. There doesn’t seem to be any provision for entering the sequence of images in the *.jpg format.
Is there something I’m missing here? Help please
Hmm…couldn’t get it to work. All my files got corrupted and I couldn’t work out what I was doing wrong.
Right-o. Ended up writing my own panning script with the help of ExifTool. Thanks for the inspiration. The script is quite rough since I know nothing about the Perl. I’ll try to refine it and make it a bit easier to use. Who knows…maybe someone else may find it useful.
Lim,
I enter perl pan.pl *.JPG and it works fine for me.
I’ve just created a new movie by splitting the files into subfolders and running varying crops on them to mix pan and zoom and variations thereof in a test movie..
The new movie is literally only a test movie. I changed settings during the capture phase so I’m not pleased with the capture results, but it works as a sample I can try again.
Now if only it could be a plugin!
http://www.vimeo.com/1808623
I followed the instructions (apart from installing Strawberry Perl) and I got the following error message:
pan: expected three or more images on the command line.
Any thoughts? I don’t have spaces in the path name and all the jpgs are sequential.
Would it be possible to add support for rotation? I can think of several cool special effects that could be done using this. 🙂 Many thanks.
Actually, I ran this serveral times after working out I could get round the problem by listing all the filenames in full. I then found that the script mangled all jpgs apart from the first and last one. Has something really changed in LR3 to stop the script working? Thanks. J
The script is run outside of Lightroom, so shouldn’t really be affected by the Lightroom version. It does some pretty ugly image XMP hacking, but I didn’t think it would “mangle” anything. Perhaps you could send a copy of one unmangled file, and I could look into it… —Jeffrey
Wouldn’t it be possible to do the samethin by a LR-plugin now? LR3 now can also create the Video.
http://www.gwegner.de/allgemein/zeitraffer-lightroom/ has a nice instruction (in German).
Finally I finished the first beta of LR-Timelapse, a tool that allows you to make different transitions between development settings in Lightroom – not only crop for pan and zoom but also exposure, white balance and so on.
It comes with a nice user interface so no scripts are needed.
I would be glad if some of you would like to test it an give me feedback.
You can find the project page here: LR-Timelapse