{"id":820,"date":"2008-05-20T23:56:40","date_gmt":"2008-05-20T14:56:40","guid":{"rendered":"https:\/\/regex.info\/blog\/2008-05-20\/820"},"modified":"2008-05-20T23:56:40","modified_gmt":"2008-05-20T14:56:40","slug":"panning-a-timelapse-with-lightroom-and-perl","status":"publish","type":"post","link":"https:\/\/regex.info\/blog\/2008-05-20\/820","title":{"rendered":"Panning a Timelapse with Lightroom and Perl"},"content":{"rendered":"\n\n<div style='text-align:center; float:right; border: solid 1px #999;\npadding: 7px; margin-left:1em; margin-bottom:30px; width:400px'>\n\n<object width=\"400\" height=\"225\"><param name=\"allowfullscreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><param name=\"movie\" value=\"http:\/\/vimeo.com\/moogaloop.swf?clip_id=5149646&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" \/><embed src=\"http:\/\/vimeo.com\/moogaloop.swf?clip_id=5149646&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1\" type=\"application\/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"400\" height=\"225\"><\/embed><\/object><p><a href=\"http:\/\/vimeo.com\/5149646\">Santa Ponsa<\/a> from <a href=\"http:\/\/vimeo.com\/seanmcfoto\">Sean McCormack<\/a> on <a href=\"http:\/\/vimeo.com\">Vimeo<\/a>.<\/p>\n\n<br\/><span style='font-size:150%'>Timelapse Panning Video<\/span>\n<br\/><small>one hour compressed down to 12 seconds &nbsp;&middot;&nbsp; no sound<\/small>\n<br\/>by <a href=\"http:\/\/lightroom-blog.com\/2008\/05\/panning-timelapse-using-lightroom.html\">Sean McCormack<\/a>\n<br\/>( <small>larger high-def version <a href=\"http:\/\/vimeo.com\/5149646\">is here<\/a><\/small> )\n<\/div>\n\n<p style='margin-top:0px'>At right is <span class='nobr'>a short<\/span> timelapse video (12 seconds,\nno sound) that Lightroom expert Sean McCormack made from the collection of\n300 images he ended up with after setting his camera up on <span class='nobr'>a tripod<\/span>\nand having it take <span class='nobr'>a shot<\/span> every 10 seconds for 50 minutes.<\/p>\n\n<p>To see the high-resolution version, <a\nhref=\"http:\/\/vimeo.com\/5149646\">go here<\/a> and look for the &#8220;four\narrows&#8221; icon at the lower-right of the video. Click that to put the video\ninto full-screen mode. Then, click the &#8220;scaling is on&#8221; badge in the upper\nright to turn scaling off so you see the original size. Then, play the\nvideo.<\/p>\n\n<p>He didn't move the camera during the hour the pictures were being taken,\nso the original images from the camera were, of course, of one static view. <span class='nobr'>To create<\/span> the panning effect, Sean used <span class='nobr'>a combination<\/span> of Adobe Lightroom\nand little Perl script that <span class='nobr'>I created<\/span> for him.<\/p>\n\n<p>I'm publishing the script here in case the more adventurous timelapse\nmakers among you wish to use it. <span class='nobr'>I say<\/span> <i>adventurous<\/i> because it's not\nparticularly straightforward, it requires some technical abilities, and\nit's possible that it could corrupt the images (but you <i>do<\/i> have\nbackups, right?).<\/p>\n\n<style type=\"text\/css\">\n#post820 .h { font-size: 120%; font-weight: bold }\n<\/style>\n\n<p class='h'>Prerequisites<\/p>\n<p>The instructions assume that...<\/p>\n<ul>\n  <li><p>You already have the original frames.<\/p><\/li>\n  <li><p>You have <b>perl<\/b> available on your system.<\/p>\n       <p>Macs come with perl already installed. Windows users can get <span class='nobr'>a free<\/span> version at <a\n       href=\"http:\/\/www.activestate.com\/\">ActiveState<\/a>.<\/p><\/li>\n  <li><p>You can work in a command window (Win) or <span class='nobr'>a Terminal<\/span> Window (Mac).<\/p><\/li>\n  <li><p>You know how to convert a bunch of images into <span class='nobr'>a video.<\/span><\/p><\/li>\n<\/ul>\n\n<p>The script itself is here: <a href=\"\/pan\">pan<\/a> (save as <span class='nobr'>a raw<\/span> text file; the instructions assume that you name the file &#8220;<tt>pan<\/tt>&#8221;)<\/p>\n\n\n<p class='h'>Instructions<\/p>\n\n<ol>\n<li><p>Make backups of the images. Really.<\/p><\/li>\n\n<li><p>Load the frames into Adobe Lightroom.<\/p><\/li>\n\n<li><p>Crop the <b>first frame<\/b> where you want your pan to start. You'll probably want to use <span class='nobr'>a crop<\/span> with\n    the same aspect ratio as your target video format. <i>Do not use any\n    rotation<\/i> because the panning script can't yet handle rotation.<\/p><\/li>\n\n<li><p>Copy that crop (Ctrl-Shift-C) and apply it (Ctrl-Shift-V) to the <b>final frame<\/b>. Then, ensuring that the aspect ratio is locked,\n    move\/resize the crop to how you want it at the end of the video.<\/p>\n\n    <p>If you don't resize the crop, but only move it, you'll end up with <span class='nobr'>a\n    simple<\/span> pan. <span class='nobr'>If you also<\/span> resize the crop, you'll end up with <span class='nobr'>a zoom<\/span>-in\n    or zoom-out <a href=\"http:\/\/en.wikipedia.org\/wiki\/Ken_burns_effect\">Ken\n    Burns effect<\/a>.<\/p><\/li>\n\n<li><p>Now, apply a crop (any crop) to all the intervening frames. You can, for example, simply apply\n    the crop you happened to have from step #3 above. It doesn't matter\n    exactly what crop you apply because it'll end up getting changed by my\n    script, but you must apply <i>some<\/i> crop at this point.<\/p><\/li>\n\n<li><p>Select all the frames, and &#8220;Save Metadata to Files&#8221; (Ctrl-S).<\/p><\/li>\n\n<li><p>Now switch to a terminal\/command window, and <b>cd<\/b> to the folder\n     holding the images in question.<\/p><\/li>\n\n<li><p>Run the command &#8220;<tt>perl pan<\/tt>&#8221; and name all the files for the frames, in order, as arguments. <span class='nobr'>If all the<\/span> frames are by themselves in one folder, and the images are named sequentially, you can usually get away with simply typing:<\/p>\n\n     <pre>   perl pan *.jpg<\/pre>\n\n     <p>with the caveat that you'll have to give the full path to the\n     script (or first copy the script to image folder).<\/p>\n\n     <p><b>WARNING:<\/b> the script writes <span class='nobr'>a new<\/span> crop directly into the intervening frames, but does so in\n     <span class='nobr'>a way<\/span> that's not very smart and is very brittle; it could easily screw\n     up and corrupt your images. <span class='nobr'>Be sure to<\/span> have backups.<\/p><\/li>\n\n<li><p>Back in Lightroom, select all the frames and &#8220;Read metadata from Files&#8221;. Lightroom will\n     load the crop info that the script wrote to the files. (The script\n     does not modify the first and last frames, so you don't need to\n     include those frames in this step, but it doesn't hurt.)<\/p><\/li>\n\n<\/ol>\n\n<p>You can now export all the frames and create the video. <span class='nobr'>Be sure to<\/span> resize\n   to uniform dimensions if the pan involves any kind of zooming.<\/p>\n\n<p>I've never actually done one of these myself (my experiences with\ntimelapse photography is limited to <a\nhref=\"\/blog\/2008-03-14\/763\">this short cherry-blossom\ntimelapse<\/a>), but I'll try some day soon. <span class='nobr'>I'd like to<\/span> see what others\ncome up with, so if you make one, let me know!<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Santa Ponsa from Sean McCormack on Vimeo.<\/p> Timelapse Panning Video one hour compressed down to 12 seconds &nbsp; - &nbsp; no sound by Sean McCormack ( larger high-def version is here ) <p style='margin-top:0px'>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.<\/p> <p>To see the high-resolution version, go here and look for the \"four arrows\" icon at the lower-right of the video. [...]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13,4],"tags":[],"_links":{"self":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/820"}],"collection":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/comments?post=820"}],"version-history":[{"count":0,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/posts\/820\/revisions"}],"wp:attachment":[{"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/media?parent=820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/categories?post=820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regex.info\/blog\/wp-json\/wp\/v2\/tags?post=820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}