The University of Queensland Homepage
UQ VisLab UQ VisLab

 Blackmagic-design Decklink with SAGE on OSX Snow Leopard
Overview

Described here are instructions targeting a specific need on a specific platform. That need is to run the SAGE project's decklinkcapture application under OSX Snow Leopard. The following steps enable enough of the SAGE environment to be constructed so that decklinkcapture itself may be compiled and used to stream HD video content to SAGE tiled display. Until the Mac version of decklinkcapture becomes part of the standard downloadable  SAGE environment, a tarball of the necessary source code is also provided. In particular, the steps outlined below assume SAGE version 3.1 from the EVL download page (which does not include decklinkcapture) will be used.

Please note that these instructions do not result in a complete SAGE user environment under Snow Leopard, just enough to build and run the decklinkcapture application. There are three main steps in this procedure, namely to:
    - install SAGE prerequisites
    - install SAGE
    - add decklinkcapture application


Install SAGE prerequisites

Various prerequisite software packages are needed to enable compilation of the SAGE software. The prerequisites are satisfied from the MacPorts repository, therefore first install MacPorts and read some of its documentation. If you have and existing MacPorts installation, its is suggested that all existing ports are removed so as to begin with a fresh slate. The main reason for this is that Snow Leopard is the first 64bit version of OSX; this not actually helpful at the moment since SAGE  does not compile as a 64bit application and needs to be compiled as 32bit. This may conflict with existing MacPorts ports that have been compiled as 64bin applications or libraries so its just easier to remove them and recompile them also as 32bit. In fact we'll compile the necessary MacPorts ports as both 32bit and 64bit, or universal, versions.

To remove all existing ports, run the following command in a terminal:
    sudo port uninstall -f installed
 
Now install the prerequisite packages with the following commands:
    sudo port install libxml2 +universal
    sudo port install ImageMagick +universal
    sudo port install libsdl +universal
    sudo port install glew +universal
    sudo port install readline +universal
    sudo port install portaudio +universal
    sudo port install glw +universal

N.B. these ports each have their own prerequisites which will also be installed automatically.


Install SAGE

1.  First, set up a SAGE environment, in particular a SAGE_DIRECTORY path and associated program execution and library paths. Edit the .bashrc file in the user's home directory. At the end of the .bashrc file, add the following lines:
     export SAGE_DIRECTORY=$HOME/sage3.0
     export PATH=${SAGE_DIRECTORY}/bin:${PATH}
     export DYLD_FALLBACK_LIBRARY_PATH=${SAGE_DIRECTORY}/lib:${DYLD_FALLBACK_LIBRARY_PATH}

Now source the .bashrc file from the user's .bash_profile file (it may need to be created), or from the system wide /etc/profile file, by adding the lines:
    [ -f ${HOME}/.bashrc ] && .  ${HOME}/.bashrc


Test the enhanced user environment by opening a new shell and running the commands:
    env | grep SAGE
and
    env | grep LD_ 
and
    echo $PATH
and
    echo $DYLD_FALLBACK_LIBRARY_PATH

These commands should return results consistent with the settings made above. There's no point in continuing until this step has been completed successfully.


2. Unpack the SAGE (sage3-03-24-09.tgz) tarball somewhere; the home directory of a generic user is a good place to do this e.g.
    cd
    tar zxvf sage3-03-24-09.tgz

Now apply this patch file - it changes a few things but its main effect is to change compilation from x86_64 mode (the default in Snow Leopard) to i386 mode. The patch can be applied from the directory containing the unpacked SAGE tarball using the command:
    cat sage3-03-24-09.osx.diff | patch -p0


3. The SAGE software can now be built from inside the sage3.0 directory:
    cd $SAGE_DIRECTORY
    make install

Note:
    don't go into the src directory to build; do the build from $SAGE_DIRECTORY
    don't do a plain make first; go straight to make install


Add the decklinkcapture application

Until the DecklinkCapture application is part of a SAGE release, download the DecklinkCaptureOSX tarball. Please note that this contains some significant differences to the Linux DecklinkCapture tarball (which won't work under OSX!).

Unpack the tarball into the $SAGE_DIRECTORY/app directory and inside the newly created $SAGE_DIRECTORY/app/DecklinkCaptureOSX directory, build and install the decklinkcapture application, like this:
    cd $SAGE_DIRECTORY/app/DecklinkCaptureOSX
    make install
which will place the new decklinkcapture application into the $SAGE_DIRECTORY/bin directory, from where it should normally be run.

A matching configuration file (decklinkcapture.conf) will also be needed in $SAGE_DIRECTORY/bin and although a default version is available from $SAGE_DIRECTORY/app/DecklinkCaptureOSX, it will most likely be unsuitable in this case (its intended for running decklinkcapture on the same machine as the SAGE display's fsManager). Instead, complete this decklinkcapture.conf skeleton , rename is as decklinkcapture.conf and place it into the $SAGE_DIRECTORY/bin directory. The crucial items in the skeleton config file which need completion are the fsIP and launcherID fields, which will need appropriate IP addresses inserted (replacing the xxx.xxx.xxx.xxx values).

Now, from the $SAGE_DIRECTORY/bin directory, run some commands like:
    decklinkcapture -h
for help and
    decklinkcapture -l
for a list of devices, capture modes and interfaces.

Finally, run something like:
    decklinkcapture -m 3 -i 1
for sending 1080i50 from the HDMI interface of an Intensity Pro card.


Issues


Contact
    Please send any comments, advice etc., to Chris Willing <c.willing _at_ uq.edu.au>