Introduction to FFmpeg

FFmpeg is a solution to record, convert and stream audio and video. It is a very fast video and audio converter and it can also acquire from a live audio/video source. Designed to be intuitive, the command-line interface (ffmpeg) tries to figure out all the parameters, when possible. FFmpeg can also convert from any sample rate to any other, and resize video on the fly with a high quality polyphase filter. FFmpeg can use a Video4Linux compatible video source and any Open Sound System audio source.

This package is known to build and work properly using an LFS-7.4 platform.

Package Information

FFmpeg Dependencies


Recommended (For Hardware Video Decoding)

libva-1.2.1 and libvdpau-0.7 (with the corresponding driver package)


Fontconfig-2.10.93, frei0r, GnuTLS-3.2.4, libaacplus, libass, libbluray, libcaca, libcelt, libcdio, libdc1394, fdk-aac, Flite, GSM, libiec61883, libilbc, libmodplug, libnut (SVN checkout), OpenCore AMR, OpenCV, Opus, librtmp, Schroedinger, TwoLAME, Video4Linux, vo-aaenc, vo-amrwbenc, x264, libxavs (SVN checkout), OpenAL, and texi2html (to build HTML documentation)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/ffmpeg

Installation of FFmpeg

If Xorg is installed in a prefix other than /usr, the build will fail. Fix this by issuing the following command:


Install FFmpeg by running the following commands:

sed -i 's/-lflite"/-lflite -lasound"/' configure &&
./configure --prefix=/usr        \
            --enable-gpl         \
            --enable-version3    \
            --enable-nonfree     \
            --disable-static     \
            --enable-shared      \
            --enable-x11grab     \
            --enable-libfaac     \
            --enable-libfreetype \
            --enable-libmp3lame  \
            --enable-libopenjpeg \
            --enable-libpulse    \
            --enable-libspeex    \
            --enable-libtheora   \
            --enable-libvorbis   \
            --enable-libvpx      \
            --enable-libxvid     \
            --enable-openssl     \
            --disable-debug      &&
make &&
gcc tools/qt-faststart.c -o tools/qt-faststart &&

HTML documentation was built in the previous step if texi2html is installed. If the HTML was built (check for any .html files in the doc directory) and you have texlive-20130530 installed and wish to build PDF and Postscript versions of the documentation, issue the following commands:

pushd doc &&
for DOCNAME in `basename -s .html *.html`
    texi2pdf -b $DOCNAME.texi &&
    texi2dvi -b $DOCNAME.texi &&
    dvips -o    $DOCNAME.ps   \
                $DOCNAME.dvi  &&
done                          &&
popd                          &&

If you have Doxygen-1.8.5 installed and wish to create the API documentation (takes about 300 MB of space), issue the command doxygen doc/Doxyfile.

To properly test the installation you must have rsync-3.0.9 installed and follow the instructions for the FFmpeg Automated Testing Environment. Note that the BLFS team has not performed this regression testing.

Now, as the root user:

make install &&
install -v -m755    tools/qt-faststart /usr/bin &&
install -v -m755 -d /usr/share/doc/ffmpeg-1.2.2 &&
install -v -m644    doc/*.txt \

If HTML documentation was built, issue the following command to install it:

install -v -m644 doc/*.html \

If you used doxygen to create the API documentation, install it (another 300 MB of space) by issuing the following commands as the root user:

install -v -m755 -d /usr/share/doc/ffmpeg-1.2.2/api &&
install -v -m644    doc/doxy/html/* \

Command Explanations

sed -i ...: This command adds the ALSA library to the Flite LDFLAGS variable and enables the discovery of Flite.

gcc tools/qt-faststart.c -o tools/qt-faststart: This builds the qt-faststart program which can modify QuickTime formatted movies (.mov or .mp4) so that the header information is located at the beginning of the file instead of the end. This allows the movie file to begin playing before the entire file has been downloaded.

--enable-gpl: Enables the use of GPL code and permits support for postprocessing, swscale and many other features.

--enable-version3: Enables the use of (L)GPL version 3 code.

--enable-nonfree: Enables the use of nonfree code. Note that the resulting libraries and binaries will be unredistributable.

--disable-static: This switch prevents installation of static versions of the libraries.

--enable-shared: Enables building shared libraries, otherwise only static libraries are built and installed.

--enable-x11grab: Enables X11 grabbing.

--enable-libfaac: Enables AAC encoding via libfaac.

--enable-libfreetype: Enables the use of libfreetype.

--enable-libmp3lame: Enables MP3 encoding via libmp3lame.

--enable-libopenjpeg: Enables JPEG 2000 de/encoding via libopenjpeg.

--enable-libpulse: Enables Pulseaudio input via libpulse.

--enable-libspeex: Enables Speex de/encoding via libspeex.

--enable-libtheora: Enables Theora encoding via libtheora.

--enable-libvorbis: Enables Vorbis de/encoding via libvorbis.

--enable-libvpx: Enables VP8 de/encoding via libvpx.

--enable-libxvid: Enables Xvid encoding via libxvidcore.

--enable-openssl: Enables OpenSSL cryptography.

--disable-debug: Disables building debugging symbols into the programs and libraries.

--enable-<codec>: FFmpeg comes with code to compile decoders for almost every codec you could think of. The only reason to enable a specific codec (and make FFmpeg link to the prerequisite shared library installed on your system) is to make FFmpeg compile an encoder for that codec. FFmpeg provides an excellent collection of decoders. If you just want to use FFmpeg to watch video or listen to music (via other applications such as Gstreamer or Xine) then you will not benefit from linking FFmpeg to other codec libraries.

Configuring FFmpeg

Config Files

/etc/ffserver.conf and ~/.ffmpeg/ffserver-config

You'll find a sample ffserver configuration file at doc/ffserver.conf in the source tree.


Installed Programs: ffmpeg, ffplay, ffprobe, ffserver and qt-faststart
Installed Libraries: libavcodec.so, libavdevice.so, libavfilter.so, libavformat.so, libavutil.so, libpostproc.so, libswresample and libswscale.so
Installed Directories: /usr/include/libavcodec, /usr/include/libavdevice, /usr/include/libavfilter, /usr/include/libavformat, /usr/include/libavutil, /usr/include/libpostproc, /usr/include/libswresample /usr/include/libswscale, /usr/share/ffmpeg and /usr/share/doc/ffmpeg-1.2.2

Short Descriptions


is a command-line tool to convert video files, network streams and input from a TV card to several video formats.


is a very simple and portable media player using the ffmpeg libraries and the SDL library.


gathers information from multimedia streams and prints it in a human and machine-readable fashion.


is a streaming server for everything that ffmpeg could use as input (files, streams, TV card input, webcam, etc).


moves the index file to the front of quicktime (mov/mp4) videos.


is a library containing the FFmpeg codecs (both encoding and decoding).


is the FFmpeg device handling library.


is a library of filters that can alter video or audio between the decoder and the encoder (or output).


is a library containing the file formats handling (mux and demux code for several formats) used by ffplay as well as allowing the generation of audio or video streams.


is the FFmpeg utility library.


is the FFmpeg post processing library.


is the FFmpeg audio rescaling library, it contains functions for converting audio sample formats.


is the FFmpeg image rescaling library.

Last updated on 2013-08-25 13:35:12 -0700