Here how I did to install all MagicLantern tools on my Lion system with homebrew instead of macport (too many failed port for having all working).

Basic Utilities[edit | edit source]

NOTE: you can skip a lot of step using the script (post feedback please) We first need to install some basic utilities to be able to have all things working.

  • XCode4 (NOTE: XCode 4.3: Command Lines Tools is now an optional install. You’ll need to enable under Preferences > Downloads.)
    • downloadable from AppStore here .
  • Homebrew (to install various packages easily)
    • from Terminal use this code to install it:
ruby -e "$(curl -f​sSL"

Downloading Magic Lantern source and tools[edit | edit source]

To have the most updated version for scripts and tools, and to be able to compile ML first we need to get the source code using mercurial.

From Terminal install mercurial with homebrew and then download the sources in home dir:

brew install mercurial;
cd ~/;
hg clone;


Install mercurial from the link here: /

Summon Arm toolchain install[edit | edit source]

To use the summon arm toolchain script from ML something has to be installed:

curl -O
tar -xvf libusb.pkg.tar.gz
sudo installer -pkg libusb.pkg -target /
  • Ad then some other stuff with homebrew:
​brew install binutils gmp mpfr libmpc wget
  • Now it's time to start the summon arm script:
cd ~/magic-lantern/toolchain/;
sudo summon-arm;

Wait until finished.

Lion Compliling Issue[edit | edit source]

You need to make some changes to ~/magic-lantern/src/ to compile on Lion (a patch is ready but needs more tester).

add -mlong-calls\ under CFLAGS=\


	$(FLAGS) \
	-Os \
	-Wall \
	-W \
	-mstructure-size-boundary=32 \
	-Wno-unused-parameter \
	-Wno-implicit-function-declaration \
	-Wno-unused-function \
	-Wno-missing-field-initializers \
	-Wno-format \
	-std=gnu99 \
	-D__ARM__ \
	-I$(SRC_DIR) \

Compiling Magic Lantern options[edit | edit source]

After the toolchain is installed you can compile ML for a specific camera with:

cd ~/magic-lantern/;
make 600D;

for the 600D.

After compilation you will find your autoexec.bin in ~/magic-lantern/platform/600D.102/ for example.

Other options are:

all : to make an autoexec.bin that supports all models;

clean : to remove some stuff used in previous compiling;

zip : to make a full zip with all needed stuff not only the autoexec.bin

Make a card bootable[edit | edit source]

Format the card with the camera (needs to be called EOS_DIGITAL) and then use this as script from your mac:

#! /bin/bash  
# patch the SD/CF card bootsector to make it bootable on Canon DSLR
# See,4214.0.html

# change this on linux

# Fix for osx, auto detects the card if formatted incamera before using this script
if [[$OSTYPE == darwin* ]]; then
  dev=/dev/$(diskutil list | grep EOS_DIGITAL | awk '{print $6}' )
  echo $dev
  diskutil unmount $dev

# read the boot sector to determine the filesystem version
DEV32=`dd if=$dev bs=1 skip=82 count=8`
DEV16=`dd if=$dev bs=1 skip=54 count=8`
if [ "$DEV16" != 'FAT16   ' -a "$DEV32" != 'FAT32   ' ]; then
  echo "Error: "$dev" is not a FAT16 or FAT32 device"
  echo "Format your card in camera before using this script on Osx"
  echo debug $dev $DEV16 $DEV32
if [ "$DEV16" = 'FAT16   ' ]; then
elif [ "$DEV32" = 'FAT32   ' ]; then
  echo "Error: "$dev" is not a FAT16 or FAT32 device"
echo "Applying "$FS" parameters on "$dev" device:"
echo " writing EOS_DEVELOP at offset" $offset1 "(Volume label)"
echo EOS_DEVELOP | dd of="$dev" bs=1 seek=$offset1 count=11
echo " writing BOOTDISK at offset" $offset2 "(Boot code)"
echo BOOTDISK | dd of="$dev" bs=1 seek=$offset2 count=8

422 to JPG conversion with Phyton script [DRAFT][edit | edit source]

To be able to use the script we need numpy and PIL:

cd ~/magic-lantern/; #go to ML source folder
wget; #download installer script for numpy
sudo bash; #install numpy
brew install pil;  #install PIL

Cropmarks .bmp to RLE compression [DRAFT][edit | edit source]

to be added.

Ruby script

​#!/usr/bin/env ruby
if ARGV.count!=1 then
  puts "Usage: "+__FILE__+" [filename]"
end[0],"rb") do |f|[0]+".rle","wb+") do |out|
    sign =
    header ="V*")
    palette = nil
    palette =[2]-54) if header[2]-54>0
    data =[8]).unpack("C*")
    width = header[4]
    height = header[5]

    newdata = []
    count = 0
    color = 0
    x = 0
    data.each do |d|
      if x==0 then
        color = d
	count = 0
      if d == color and count<255 then
        newdata << count
	newdata << color
	count = 1
	color = d
      if x==width then
        x = 0
	newdata << count
	newdata << color
	newdata << 0
	newdata << 0
    newdata << 0
    newdata << 1

    header[0] = newdata.length + 54 + (palette.nil? and 0 or palette.length)
    header[7] = 1 #set compression to RLE8
    header[8] = newdata.length
    out.print "BM"
    out.print header.pack("V*")
    out.print palette unless palette.nil?
    out.print newdata.pack("C*")

HDR Photo fusion with enfuse [DRAFT][edit | edit source]

  1. Install enfuse/enblend for mac download here;
  2. or use terminal:
  3. ​wget;
tar xvfz enblend-enfuse-4.0-mac.tar.gz;
cp enblend-enfuse-4.0-mac/enfuse /usr/bin/;
cp enblend-enfuse-4.0-mac/enblend /usr/bin/;

  1. Use the script in the card
  2. (to be added more info).

HDR Video workflow (with enfuse and mplayer) [DRAFT][edit | edit source]

  1. If you don't have yet done it (for photo HDR fusion), install enfuse/enblend for mac download here;
  2. Install mplayer:
brew install mplayer;
  1. Copy the video in a folder and use this as script to convert it (by Ro-Man from Vimeo ML group )

processFrames() {
noframes=`ls *.png | wc -l`
echo "$noframes frames extracted..."
for i in `seq 1 2 $noframes`; do
in1=`printf "%08d.png" "$i"`
in2=`printf "%08d.png" "$((i+1))"`
out=`printf "out%08d.jpg" "$n"`
echo "creating HDR frame $out from $in1 and $in2 ..."
enfuse --compression=95 -o $out $in1 $in2
let n++
rm *.png
encodeVideo() {
# 2 stage encoding with mpreg4 codec, settings from mencoder wiki
# optimal_bitrate = (40..60) * 25 * width * height / 256
mencoder mf://./out*.jpg -mf w=1920:h=1080:fps=15:type=jpg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:$opts -o /dev/null
mencoder mf://./out*.jpg -mf w=1920:h=1080:fps=15:type=jpg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:$opts -o output.avi
rm out*.jpg

mplayer -vo png:z=1 $1
Community content is available under CC-BY-SA unless otherwise noted.