-
Notifications
You must be signed in to change notification settings - Fork 7
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/
- 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
- You will need nine libraries:
- yasm (from source)
- x264 (from source - use the following instead of the configure line included in the compiliation guides:
./configure --enable-static --disable-opencl
) - fdk-aac (from source)
- libmp3lame (package Ubuntu: libmp3lame-dev)
- libvpx (from source)
- libtheora (package) for ubuntu
sudo apt-get install libtheora-dev
for CentOS see the Additional Libraries section - libvorbis (package Ubuntu: libvorbis-dev)
- libfaac (multiverse package) ubuntu instructions, CentOS instructions
- ffmpeg (from source)
- You will not need libopus
- 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
andmake
commands, but use eithersudo make install
(if your user has sudo privileges) orsu -c 'make install'
when installing the libraries - 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.
- 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
- 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
- If you get the following error when configuring ffmpeg
ERROR: libx264 not found
- Double-check that you ran the x264 section with the following configure line
./configure --enable-static --disable-opencl
- Try running
cd ~/ffmpeg-sources/x264 | sudo ldconfig
- Try re-running the x264 section with the following configure line
./configure --enable-static --prefix=/usr
- Double-check that you ran the x264 section with the following configure line
- Be sure to add all the libraries to your path with
sudo ldconfig
after you've installed ffmpeg itself - 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