Compiling / installing shotdetect for OS X
How to compile

Easy version (late 2015)


make sure you have homebrew installed
install dependencies  
download source code:
git clone https://github.com/johmathe/Shotdetect.git
cd Shotdetect
run install script: ./compile.sh all
find the binary "shotdetect-cmd" in the build directory.
for details, check How to use section below 


Old version (up to late 2015)

brew install gd    # ... obviously, http://brew.sh is needed for this!
git clone https://github.com/johmathe/Shotdetect.git
cd Shotdetect


I found XML output was broken as of 2014-02-11, so I applied these two patches. This might be a hack:

curl https://patch-diff.githubusercontent.com/raw/johmathe/Shotdetect/pull/8.patch | git apply
curl https://patch-diff.githubusercontent.com/raw/johmathe/Shotdetect/pull/9.patch | git apply


Finally:

mkdir -p build; cd build
cmake -D USE_WXWIDGETS:BOOL=OFF ..    # make sure you include the two dots! :)
make


The resulting binary is shotdetect-cmd.

How to use

Here is a sample command that worked for me:

./shotdetect-cmd -i test.mp4 -o outputDir  -s 60 -w -v -f -l -m -r -a FOO

Flags explained:

-i file      : input file path
-o path      : output path (MUST exist already)
-a id        : (required!) movie ID (alphanumeric, creates subfolder in output path)
-s threshold : threshold (optional, default=75, 60 is recommended in the docs(??))

-w           : generate xml of audio
-v           : generate xml of video infos

-m           : generate the thumbnail images
-r           : generate the images in native resolution

-f           : generate 1st image for each shot  ( -m or/and -r flags must be set)
-l           : generate last image for each shot ( -m or/and -r flags must be set)


Troubleshooting

On a second install in spring of 2015, shotdetect complained:

dyld: Library not loaded: /usr/local/lib/libtiff.5.dylib
  Referenced from: /usr/local/lib/libgd.3.dylib
  Reason: image not found
Trace/BPT trap: 5


I could fix this with brew reinstall libtiff.