Skip to content

Installation: ffmpeg

acozine edited this page Nov 22, 2013 · 35 revisions

You must install ffmpeg largely from source - the package installation will not work with bawstun/HydraDAM. Installation for bawstun/HydraDAM differs slightly from the standard ffmpeg compilation guides, so read through this page before beginning your compilation guide, and keep this page open as you work through the compilation sequence. Standard compilation guides (with thanks to the creators of ffmpeg for maintaining relatively up-to-date compilation guides!):
Ubuntu: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
CentOS: http://ffmpeg.org/trac/ffmpeg/wiki/CentosCompilationGuide
Alternate CentOS Installation: http://cumulusclips.org/docs/install-ffmpeg-x264-on-centos/

HydraDAM-specific instructions for ffmpeg installation:

  1. Set up your library paths before compiling the libraries
export LD_LIBRARY_PATH=/usr/local/lib/
sudo echo $LD_LIBRARY_PATH | sudo tee /etc/ld.so.conf.d/custom-libs.conf
sudo ldconfig
  1. You will need nine libraries:
    1. yasm (from source)
    2. x264 (from source - use the following instead of the configure line included in the compiliation guides: ./configure --enable-static --disable-opencl)
    3. fdk-aac (from source)
    4. libmp3lame (package Ubuntu: libmp3lame-dev)
    5. libvpx (from source)
    6. libtheora (package) for ubuntu sudo apt-get install libtheora-dev for CentOS see the Additional Libraries section
    7. libvorbis (package Ubuntu: libvorbis-dev)
    8. libfaac (multiverse package) ubuntu instructions, CentOS instructions
    9. ffmpeg (from source)
  2. You will not need libopus
  3. Use normal user privileges when compiling from source except for the final step for each library - i.e. log in as a regular user for all the ./configure and make commands, but use either sudo make install (if your user has sudo privileges) or su -c 'make install' when installing the libraries
  4. The audio codec libraries, libfdk_aac and libfaac, are not currently compatible with the GPL. In order to incorporate them into your ffmpeg build, you need to enable the nonfree configure option. See the details on the ffmpeg site for further information.
  5. Use the following instead of the configure line included in the compiliation guides
./configure --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfaac
  1. If the line above does not work, you may need some extra flags to compile ffmpeg successfully - try this instead
./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libfaac
  1. If you get the following error when configuring ffmpeg
    ERROR: libx264 not found
    1. Double-check that you ran the x264 section with the following configure line ./configure --enable-static --disable-opencl
    2. Try running cd ~/ffmpeg-sources/x264 | sudo ldconfig
    3. Try re-running the x264 section with the following configure line ./configure --enable-static --prefix=/usr
  2. Be sure to add all the libraries to your path with sudo ldconfig after you've installed ffmpeg itself
  3. Confirm ffmpeg by copying a video onto the system, then executing
    ffmpeg -itsoffset -4 -i videofile.name -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
    and you should get a usable jpg file called test.jpg as a result
Clone this wiki locally