Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bruchu/7552598 to your computer and use it in GitHub Desktop.
Save bruchu/7552598 to your computer and use it in GitHub Desktop.
## Get FFMpeg working on heroku by building binaries using vulcan
# also added instructions on how to compile with libmp3lame and libx264
gem install vulcan
vulcan create foo
#clone the app vulcan just created
git clone [email protected]:foo
git clone --depth 1 git://git.videolan.org/x264
cd x264
vulcan build -v -s . -c "./configure --enable-static --enable-shared --disable-asm --prefix=/app/vendor/x264 && make && make install"
## once done download and extract the tar to the vulcan app to vendor
# add files to git and push to the heroku foo app
## Download the latest source for Lame mp3 and extract to foo and cd to the dir
vulcan build -v -s . -c "./configure --enable-shared --disable-asm --prefix=/app/vendor/mp3lame && make && make install"
## once done download and extract the tar to the vulcan app to vendor
# add files to git and push to the heroku foo app
##Download latest ogg source from http://www.xiph.org/downloads/ and extract to foo and cd to the dir
vulcan build -v -s . -c "./configure --enable-shared --disable-asm --prefix=/app/vendor/libogg && make && make install"
## once done download and extract the tar to the vulcan app to vendor
# add files to git and push to the heroku foo app
cd vendor
tar xzvf /tmp/..tgz
git add libogg
git commit -m'add libogg'
git push
##Download latest vorbis source from http://www.xiph.org/downloads/ and extract to foo and cd to the dir
vulcan build -v -s . -c "./configure --enable-shared --disable-asm --prefix=/app/vendor/libvorbis --with-ogg-libraries=/app/vendor/libogg/lib --with-ogg-includes=/app/vendor/libogg/include && make && make install"
## once done download and extract the tar to the vulcan app to vendor
# add files to git and push to the heroku foo app
cd faac-1.28
vulcan build -v -s . -c "./configure --enable-shared --disable-asm --prefix=/app/vendor/faac && make && make install"
#Now we are finally ready to compile ffmpeg with these dependancies
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
vulcan build -v -s . -c "./configure --enable-shared --enable-libfaac --enable-nonfree --enable-gpl --enable-libx264 --enable-libvorbis --enable-libmp3lame --disable-asm --prefix=/app/vendor/ffmpeg --extra-cflags='-I/app/vendor/x264/include -I/app/vendor/mp3lame/include -I/app/vendor/faac/include -I/app/vendor/libvorbis/include -I/app/vendor/libogg/include' --extra-ldflags='-L/app/vendor/x264/lib -L/app/vendor/mp3lame/lib -L/app/vendor/faac/lib -L/app/vendor/libvorbis/lib -L/app/vendor/libogg/lib' && make && make install"
## once done, you'll see something along the lines of:
# >> Downloading build artifacts to: /tmp/ffmpeg.tgz
# (available at http://foo.herokuapp.com/output/d21f6bb8-6db6-4397-b02e-347806945881)
#
# Download the .tgz via the link or cd to /tmp then:
tar xvf ffmpeg.tgz
mkdir /path/to/app/vendor/ffmpeg
mv ffmpeg/* /path/to/app/vendor/ffmpeg/
# cd to your app then:
heroku config:set PATH=bin:vendor/ffmpeg/bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin -a yourapp
#in the above, make sure you are simply appending 'vendor/ffmpeg/bin' to whatever is already set when you run 'heroku config' and look at the currently set value for PATH. overwriting it will break your app.
heroku config:set LD_LIBRARY_PATH=vendor/ffmpeg/lib:/usr/local/lib -a yourapp
git add .
git commit -m "vendor ffmpeg"
git push heroku master
# enjoy!
@sbauch
Copy link

sbauch commented Apr 24, 2014

@ttseng did you ever solve? I'm getting the same error (though line 142 instead of 140)

@mhui
Copy link

mhui commented Sep 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment