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.

本パッケージは LFS-11.1 において正しくビルドでき動作することが確認されています。

Package Information

  • Download (HTTP): https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz

  • Download MD5 sum: 7b9d5b652d20e8c5405304ad72636d4a

  • Download size: 9.2 MB

  • Estimated disk space required: 176 MB (add 2.4 GB for the FATE suite/tests, add 1.4 GB for documentation)

  • Estimated build time: 1.3 SBU (using parallelism=4; add 3.6 SBU (with THREADS=4) to run the FATE suite after sample files are downloaded; add 0.7 SBU for doxygen docs)

FFmpeg Dependencies


Recommended for desktop use


Doxygen-1.9.2, Fontconfig-2.13.1, FriBidi-1.0.9, frei0r-plugins-1.7.0, libcdio-2.1.0 (to identify and play CDs), libdrm-2.4.107 (for kmsgrab input), libwebp-1.2.1, opencv-4.5.3, OpenJPEG-2.4.0, GnuTLS-3.7.2, PulseAudio-15.0, Samba-4.15.0, Speex-1.2.0, texlive-20210325 (or install-tl-unx) for PDF and PS documentation, v4l-utils-1.20.0, XviD-1.3.7, X ウィンドウシステム, Flite, GSM, libaacplus, libbluray, libcaca, libcelt, libdc1394, libdca, libiec61883, libilbc, libmodplug, libnut (Git checkout), librtmp, libssh, OpenAL, OpenCore AMR, Schroedinger, TwoLAME, vo-aaenc, vo-amrwbenc, and ZVBI

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

Installation of FFmpeg

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      \
            --disable-debug      \
            --enable-avresample  \
            --enable-libass      \
            --enable-libfdk-aac  \
            --enable-libfreetype \
            --enable-libmp3lame  \
            --enable-libopus     \
            --enable-libtheora   \
            --enable-libvorbis   \
            --enable-libvpx      \
            --enable-libx264     \
            --enable-libx265     \
            --enable-openssl     \
            --docdir=/usr/share/doc/ffmpeg-4.4 &&

make &&

gcc tools/qt-faststart.c -o tools/qt-faststart

HTML documentation was built in the previous step. If you have texlive-20210325 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   \
done &&
popd &&

If you have Doxygen-1.9.2 installed and you wish to build (if --disable-doc was used) or rebuild the html documentation, issue:

doxygen doc/Doxyfile

The fate-suite tests include comparisons with installed files, and should not be run before the package is installed. Therefore, if you desire to run them, instructions are given further below.

Now, as the root user:

make install &&

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

If the PDF and Postscript documentation was built, issue the following commands, as the root user, to install them:

install -v -m644 doc/*.pdf /usr/share/doc/ffmpeg-4.4 &&
install -v -m644 doc/*.ps  /usr/share/doc/ffmpeg-4.4

If you used doxygen to manually create the API documentation, install it by issuing the following commands as the root user:

install -v -m755 -d /usr/share/doc/ffmpeg-4.4/api                     &&
cp -vr doc/doxy/html/* /usr/share/doc/ffmpeg-4.4/api                  &&
find /usr/share/doc/ffmpeg-4.4/api -type f -exec chmod -c 0644 \{} \; &&
find /usr/share/doc/ffmpeg-4.4/api -type d -exec chmod -c 0755 \{} \;

To properly test the installation you must have rsync-3.2.3 installed and follow the instructions for the FFmpeg Automated Testing Environment (FATE). First, about 1 GB of sample files used to run FATE are downloaded with the command:

make fate-rsync SAMPLES=fate-suite/

The fate-suite directory is created and the files are downloaded there. That command actually runs an rsync command, to obtain the sample files. You may want to compress and keep this directory for testing again, in another system, or when a new version of ffmpeg is launched. Then, you unpack the sample files in the source directory, and run, again, the make fate-rsync ... command above, to sync with the repository. Now, the download size and time are drastically reduced. Estimated values in "Package Information" do not include the download SBU. Some samples may have been removed, in the new version, so, in order to be sure local and server fate samples are identical, when you use previously saved samples, run the following command:

rsync -vrltLW  --delete --timeout=60 --contimeout=60 \
      rsync://fate-suite.ffmpeg.org/fate-suite/ fate-suite/

Next, FATE is executed, with the commands (you obtain a number of tests larger than 3700):

make fate THREADS=N SAMPLES=fate-suite/ | tee ../fate.log &&
grep ^TEST ../fate.log | wc -l

where N is an integer, N ≤ number of cores in the system.

Command Explanations

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

find ... ;: Fixes permissions of documentation files and directories.

--enable-libfreetype: Enables Freetype support.

--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: このスイッチはスタティックライブラリをインストールしないようにします。

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

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

--enable-avresample: Enables Transcode-1.1.7 to be compiled.

--enable-libass: Enables ASS/SSA subtitle format rendering via libass.

--enable-libdrm: Use this switch if libdrm-2.4.107 is installed to build the kmsgrab input module which is useful for screen capturing or streaming.

--enable-libfdk-aac: Enables currently the highest-quality AAC audio encoding via libfdk-aac.

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

--enable-libvorbis --enable-libtheora: Enables Theora video encoding via libvorbis and libtheora.

--enable-libvorbis --enable-libvpx: Enables WebM encoding via libvorbis and libvpx.

--enable-libx264: Enables high-quality H.264/MPEG-4 AVC encoding via libx264.

--enable-libx265: Enables high-quality H.265/HEVC encoding via libx265.

--enable-openssl: Enables HTTPS protocol for network streams.

--enable-gnutls: Use this option instead of --enable-openssl, if you want to use GnuTLS instead of OpenSSL for HTTPS protocol.

--disable-doc: Disables building html documentation. This is only needed if Doxygen-1.9.2 is installed and you do not want to build the html documentation.

--enable-libpulse: Enables support for Pulseaudio for audio output.

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.



Support for most of the dependency packages requires using options passed to the configure script. View the output from ./configure --help for complete information about enabling dependency packages.


Installed Programs: ffmpeg, ffplay, ffprobe, and qt-faststart
Installed Libraries: libavcodec.so, libavdevice.so, libavfilter.so, libavformat.so, libavutil.so, libavresample.so, libpostproc.so, libswresample.so, and libswscale.so
Installed Directories: /usr/include/libav{codec,device,filter,format,resample,util}, /usr/include/libpostproc, /usr/include/libsw{resample,scale}, /usr/share/doc/ffmpeg-4.4, and /usr/share/ffmpeg

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


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 a library containing functions for resampling audio and video.


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