Video Utilities

This chapter always seems to be the favorite chapter. It's probably because there is a lot of satisfaction in playing your first video when you have spent so much time getting to that point. All those libraries, all the configurations and your reward is that you finally get to watch a movie. Not to worry though, there is always one more CODEC to install.

FFmpeg-0.4.9-pre1

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.

Package Information

Additional Downloads

FFmpeg Dependencies

Optional

libvorbis-1.1.2, LAME-3.96.1, Imlib2-1.2.2, X Window System, SDL-1.2.11, FreeType-2.1.10, MPlayer-1.0pre7try2 (for the shared post-processing library), FAAC, FAAD2, AMR narrowband (floating point) or AMR naarrowband (fixed point), AMR wideband, and teTeX-3.0 (to build HTML documentation)

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

Installation of FFmpeg

Install FFmpeg by running the following commands:

[Note]

Note

Review the doc/optimization.txt file in the source tree for information about optimizing the build.

patch -Np1 -i ../ffmpeg-0.4.9-pre1-gcc4-1.patch &&
patch -Np1 -i ../ffmpeg-0.4.9-pre1-amr_fixes-1.patch &&
sed -i "s/static uint64/const uint64/" \
    libavcodec/liba52/resample_mmx.c &&
./configure --prefix=/usr --enable-shared \
    --enable-pthreads --disable-ffplay &&
make

If you have teTeX installed, the man pages and HTML documentation were built during the make process. Skip to the root user installation steps if you don't need other formats of the documentation, or issue any or all of the following commands to create the additional formats.

for DOCFILE in faq ffmpeg-doc ffplay-doc ffserver-doc hooks
do
    texi2pdf -b $DOCFILE.texi
    texi2dvi -b $DOCFILE.texi
    dvips -o $DOCFILE.ps $DOCFILE.dvi
    makeinfo --plaintext --force -o $DOCFILE.txt $DOCFILE.texi
done

If you do not have teTeX installed, use the following command to build the man pages:

make -C doc ff{mpeg,play,server}.1

This package does not come with a test suite that works.

Now, as the root user:

make install

If you have teTeX installed on your system, install the documentation by issuing the following commands as the root user (modify the command appropriately to reflect the documentation formats you've created):

install -v -m755 -d /usr/share/doc/ffmpeg-0.4.9-pre1 &&
install -v -m644 doc/*.{html,dvi,pdf,ps,txt} \
    /usr/share/doc/ffmpeg-0.4.9-pre1

Command Explanations

sed -i -e "s/static uint64/const uint64/" libavcodec/liba52/resample_mmx.c: This command fixes an issue on machines with MMX capability and use GCC >= 3.4.x to compile in A52 support using the --enable-a52 parameter passed to the configure script.

--enable-shared: This switch is needed to build the libavcodec and libavformat shared libraries.

--enable-pthreads: This switch enables the build to link against the Posix threads library.

--disable-ffplay: Only installs the server part. ffplay requires X for building. Remove this option if X is installed.

--enable-<codec>: Review the available options and codecs using the ./configure --help command. Also review the information at the end of the configure script (cat the file or view it using a text editor) for information about building support for the AMR codecs.

Configuring FFmpeg

Config Files

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

You'll find a sample ffserver configuration file at http://ffmpeg.sourceforge.net/sample.html (also doc/ffserver.conf in the source tree).

Contents

Installed Programs: ffmpeg, ffserver, and optionally, ffplay
Installed Libraries: libavcodec.so, libavformat.so, and video hook modules
Installed Directories: /usr/include/ffmpeg, /usr/lib/vhook, and /usr/share/doc/ffmpeg-0.4.9-pre1

Short Descriptions

ffmpeg

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

ffplay

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

ffserver

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

libavcodec.so

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

libavformat.so

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.

Last updated on 2007-01-15 17:25:53 -0600