Command line time-lapse for OSX with de-flicker.

This is incomplete, but it may be useful.

Adapted from:

If you have not already, Install macports.

Open Terminal.

sudo port install ImageMagick (why they spell it CK I don't know)

sudo port install p5-perlmagick

sudo cpan install File::Type

sudo cpan install Term:ProgressBar

On first run cpan will ask some questions, just press enter to select the defaults.

These commands install the necessary software, and it may take some time. sudo will ask for your system password, you will need administrator privileges.

Once the above software is installed. Put the below script file somewhere where your path can find it. Please remember that I did not write the original script, Vangelis Tasoulas wrote it and I just changed a few things so it would play nice with OSX.

cd ~
mkdir scripts
open scripts

Copy the file there with finder.

cd scripts
chmod +x timelapse-deflicker

add the scripts folder to your profile:

cd ~

open .profile

Edit in text edit and add ~/scripts to your path so it looks something like this:

# MacPorts Installer addition on 2012-11-20_at_14:09:39: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:~/scripts:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

Now navigate to the folder that has your time-lapse images and run timelapse-deflicker

You might like to add the verbose -v and debug -d options.

timelapse-deflicker -v -d

Before you start you might like to read the help file:

timelapse-deflicker -h
-w    Choose the rolling average window for luminance smoothing (Default 15)
-p    Number of luminance smoothing passes (Default 1)
       Sometimes 2 passes might give better results.
       Usually you would not want a number higher than 2.
-h    Usage
-v    Verbose
-d    Debug

Note the two other options. My understanding is that the default -w 15 will smooth luminance changes over a half second window. (assuming 30fps).

Navigate to the newley created deflickerd folder.

cd deflickered

Now the final step. ffmpeg is a quick and easy way to put images together into a movie.

sudo port install ffmpeg

I compress to prores 422 so it is ready for editing.

ffmpeg -r 30 -f image2 -start_number 1 -i IMG_%04d.JPG -codec:v prores -profile:v 2

There are many other ffmpeg options: