source: multimedia/videoutils/ffmpeg.xml@ 07584d8

10.0 10.1 11.0 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 07584d8 was 07584d8, checked in by Krejzi <krejzi@…>, 8 years ago

added hardware accelerated video decoding chapter and other misc fixes

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@11658 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 22.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY ffmpeg-download-http
8 "http://ffmpeg.org/releases/ffmpeg-&ffmpeg-version;.tar.bz2">
9 <!ENTITY ffmpeg-download-ftp " ">
10 <!ENTITY ffmpeg-md5sum "5071a26cc149f380908ce79ec2a677ef">
11 <!ENTITY ffmpeg-size "5.7 MB">
12 <!ENTITY ffmpeg-buildsize "100 MB">
13 <!ENTITY ffmpeg-time "4.0 SBU">
14]>
15
16<sect1 id="ffmpeg" xreflabel="FFmpeg-&ffmpeg-version;">
17 <?dbhtml filename="ffmpeg.html"?>
18
19 <sect1info>
20 <othername>$LastChangedBy$</othername>
21 <date>$Date$</date>
22 </sect1info>
23
24 <title>FFmpeg-&ffmpeg-version;</title>
25
26 <indexterm zone="ffmpeg">
27 <primary sortas="a-FFmpeg">FFmpeg</primary>
28 </indexterm>
29
30 <sect2 role="package">
31 <title>Introduction to FFmpeg</title>
32
33 <para>
34 <application>FFmpeg</application> is a solution to record, convert and
35 stream audio and video. It is a very fast video and audio converter and it
36 can also acquire from a live audio/video source. Designed to be intuitive,
37 the command-line interface (<command>ffmpeg</command>) tries to figure out
38 all the parameters, when possible. <application>FFmpeg</application> can
39 also convert from any sample rate to any other, and resize video on the
40 fly with a high quality polyphase filter.
41 <application>FFmpeg</application> can use a Video4Linux compatible video
42 source and any Open Sound System audio source.
43 </para>
44
45 &lfs73_checked;
46
47 <bridgehead renderas="sect3">Package Information</bridgehead>
48 <itemizedlist spacing="compact">
49 <listitem>
50 <para>
51 Download (HTTP): <ulink url="&ffmpeg-download-http;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download (FTP): <ulink url="&ffmpeg-download-ftp;"/>
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download MD5 sum: &ffmpeg-md5sum;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download size: &ffmpeg-size;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated disk space required: &ffmpeg-buildsize;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Estimated build time: &ffmpeg-time;
77 </para>
78 </listitem>
79 </itemizedlist>
80
81 <bridgehead renderas="sect3">FFmpeg Dependencies</bridgehead>
82
83 <!-- All dependencies are listed in the order as they are displayed in
84 the configure script. This makes it easy for readers (and editors)
85 to match up the dependency list with what is required or desired. -->
86
87 <bridgehead renderas="sect4">Recommended</bridgehead>
88 <para role="recommended">
89 <xref linkend="faac"/>,
90 <xref linkend="freetype2"/>,
91 <xref linkend="lame"/>,
92 <xref linkend="openjpeg"/>,
93 <xref linkend="pulseaudio"/>,
94 <xref linkend="speex"/>,
95 <xref linkend="libtheora"/>,
96 <xref linkend="libvorbis"/>,
97 <xref linkend="libvpx"/>,
98 <xref linkend="xvid"/>,
99 <xref linkend="openssl"/>,
100 <xref linkend="sdl"/>,
101 <xref linkend="xorg7-lib"/>,
102 <xref linkend="yasm"/>
103 </para>
104
105 <bridgehead renderas="sect4">Recommended (For Hardware Video Decoding)</bridgehead>
106 <para>
107 <xref linkend="libva"/> and
108 <xref linkend="libvdpau"/>
109 (with the corresponding driver package)
110 </para>
111
112 <bridgehead renderas="sect4">Optional</bridgehead>
113 <para role="optional">
114 <xref linkend="fontconfig"/>,
115 <ulink url="http://www.piksel.org/frei0r">frei0r</ulink>,
116 <xref linkend="gnutls"/>,
117 <ulink url="http://tipok.org.ua/node/17">libaacplus</ulink>,
118 <ulink url="http://code.google.com/p/libass/">libass</ulink>,
119 <ulink url="http://www.videolan.org/developers/libbluray.html">libbluray</ulink>,
120 <ulink url="http://caca.zoy.org/">libcaca</ulink>,
121 <ulink url="http://www.celt-codec.org/">libcelt</ulink>,
122 <ulink url="http://ftp.gnu.org/pub/gnu/libcdio/">libcdio</ulink>,
123 <ulink url="http://sourceforge.net/projects/libdc1394">libdc1394</ulink>,
124 <ulink url="http://sourceforge.net/projects/opencore-amr/">fdk-aac</ulink>,
125 <ulink url="http://www.speech.cs.cmu.edu/flite/">Flite</ulink>,
126 <ulink url="http://www.quut.com/gsm/">GSM</ulink>,
127 <ulink url="https://ieee1394.wiki.kernel.org/index.php/Libraries">libiec61883</ulink>,
128 <ulink url="https://github.com/dekkers/libilbc">libilbc</ulink>,
129 <ulink url="http://sourceforge.net/projects/modplug-xmms/">libmodplug</ulink>,
130 <ulink url="http://svn.mplayerhq.hu/nut/src/trunk/">libnut</ulink> (SVN checkout),
131 <ulink url="http://sourceforge.net/projects/opencore-amr">OpenCore AMR</ulink>,
132 <ulink url="http://opencv.org/">OpenCV</ulink>,
133 <ulink url="http://www.opus-codec.org/">Opus</ulink>,
134 <ulink url="http://sourceforge.net/projects/librtmp">librtmp</ulink>,
135 <ulink url="http://diracvideo.org/">Schroedinger</ulink>,
136 <ulink url="http://www.twolame.org/">TwoLAME</ulink>,
137 <ulink url="http://linuxtv.org/downloads/v4l-utils/">Video4Linux</ulink>,
138 <ulink url="http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/">vo-aaenc</ulink>,
139 <ulink url="http://sourceforge.net/projects/opencore-amr/files/vo-amrwbenc/">vo-amrwbenc</ulink>,
140 <ulink url="http://www.videolan.org/developers/x264.html">x264</ulink>,
141 <ulink url="http://xavs.sourceforge.net/">libxavs</ulink> (SVN checkout),
142 <ulink url="http://kcat.strangesoft.net/openal-releases/">OpenAL</ulink>, and
143 <ulink url="http://www.nongnu.org/texi2html">texi2html</ulink> (to build HTML documentation)
144 </para>
145
146 <para condition="html" role="usernotes">
147 User Notes: <ulink url="&blfs-wiki;/ffmpeg"/>
148 </para>
149 </sect2>
150
151 <sect2 role="installation">
152 <title>Installation of FFmpeg</title>
153
154 <para>
155 If <application>Xorg</application> is installed in a prefix other
156 than <filename class='directory'>/usr</filename>, the build will fail. Fix
157 this by issuing the following command:
158 </para>
159
160<screen><userinput>export LIBRARY_PATH=$XORG_PREFIX/lib</userinput></screen>
161
162 <para>
163 Install <application>FFmpeg</application> by running the following
164 commands:
165 </para>
166
167 <!-- The confiure optinos are listed in the order as they are displayed in
168 the configure script. This makes it easy for readers (and editors)
169 to match up the options with what is required or desired. -->
170
171<screen><userinput>sed -i 's/-lflite"/-lflite -lasound"/' configure &amp;&amp;
172./configure --prefix=/usr \
173 --enable-gpl \
174 --enable-version3 \
175 --enable-nonfree \
176 --disable-static \
177 --enable-shared \
178 --enable-x11grab \
179 --enable-libfaac \
180 --enable-libfreetype \
181 --enable-libmp3lame \
182 --enable-libopenjpeg \
183 --enable-libpulse \
184 --enable-libspeex \
185 --enable-libtheora \
186 --enable-libvorbis \
187 --enable-libvpx \
188 --enable-libxvid \
189 --enable-openssl \
190 --disable-debug &amp;&amp;
191make &amp;&amp;
192gcc tools/qt-faststart.c -o tools/qt-faststart &amp;&amp;
193unset LIBRARY_PATH</userinput></screen>
194
195 <para>
196 HTML documentation was built in the previous step if
197 <ulink url="http://www.nongnu.org/texi2html">texi2html</ulink> is
198 installed. If the HTML was built (check for any
199 <filename class="extension">.html</filename> files in the
200 <filename class="directory">doc</filename> directory) and you have
201 <xref linkend="texlive"/> installed and wish to build PDF and
202 Postscript versions of the documentation, issue the following commands:
203 </para>
204
205<screen><userinput>pushd doc &amp;&amp;
206for DOCNAME in `basename -s .html *.html`
207do
208 texi2pdf -b $DOCNAME.texi &amp;&amp;
209 texi2dvi -b $DOCNAME.texi &amp;&amp;
210 dvips -o $DOCNAME.ps \
211 $DOCNAME.dvi &amp;&amp;
212done &amp;&amp;
213popd &amp;&amp;
214unset DOCNAME</userinput></screen>
215
216 <para>
217 If you have <xref linkend="doxygen"/> installed and wish to create the API
218 documentation (takes about 300 MB of space), issue the command
219 <command>doxygen doc/Doxyfile</command>.
220 </para>
221
222 <para>
223 To properly test the installation you must have <xref linkend="rsync"/>
224 installed and follow the instructions for the
225 <ulink url="http://ffmpeg.org/fate.html">
226 FFmpeg Automated Testing Environment</ulink>. Note that the BLFS team has
227 not performed this regression testing.
228 </para>
229
230 <para>
231 Now, as the <systemitem class="username">root</systemitem> user:
232 </para>
233
234<screen role="root"><userinput>make install &amp;&amp;
235install -v -m755 tools/qt-faststart /usr/bin &amp;&amp;
236install -v -m755 -d /usr/share/doc/ffmpeg-&ffmpeg-version; &amp;&amp;
237install -v -m644 doc/*.txt \
238 /usr/share/doc/ffmpeg-&ffmpeg-version;</userinput></screen>
239
240 <para>
241 If HTML documentation was built, issue the following command to install it:
242 </para>
243
244<screen role="root"><userinput>install -v -m644 doc/*.html \
245 /usr/share/doc/ffmpeg-&ffmpeg-version;</userinput></screen>
246
247 <para>
248 If you used <command>doxygen</command> to create the API documentation,
249 install it (another 300 MB of space) by issuing the following commands
250 as the <systemitem class="username">root</systemitem> user:
251 </para>
252
253<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/ffmpeg-&ffmpeg-version;/api &amp;&amp;
254install -v -m644 doc/doxy/html/* \
255 /usr/share/doc/ffmpeg-&ffmpeg-version;/api</userinput></screen>
256
257 </sect2>
258
259 <sect2 role="commands">
260 <title>Command Explanations</title>
261
262 <para>
263 <command>sed -i ...</command>: This command adds the
264 <application>ALSA</application> library to the
265 <application>Flite</application> <envar>LDFLAGS</envar> variable and
266 enables the discovery of <application>Flite</application>.
267 </para>
268
269 <para>
270 <command>gcc tools/qt-faststart.c -o tools/qt-faststart</command>:
271 This builds the <command>qt-faststart</command> program which can
272 modify QuickTime formatted movies
273 (<filename class="extension">.mov</filename> or
274 <filename class="extension">.mp4</filename>) so that the header information
275 is located at the beginning of the file instead of the end. This allows
276 the movie file to begin playing before the entire file has been downloaded.
277 </para>
278
279 <para>
280 <parameter>--enable-gpl</parameter>: Enables the use of GPL code and
281 permits support for postprocessing, swscale and many other features.
282 </para>
283
284 <para>
285 <parameter>--enable-version3</parameter>: Enables the use of (L)GPL
286 version 3 code.
287 </para>
288
289 <para>
290 <parameter>--enable-nonfree</parameter>: Enables the use of nonfree
291 code. Note that the resulting libraries and binaries will be
292 unredistributable.
293 </para>
294
295 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
296 href="../../xincludes/static-libraries.xml"/>
297
298 <para>
299 <parameter>--enable-shared</parameter>: Enables building shared libraries,
300 otherwise only static libraries are built and installed.
301 </para>
302
303 <para>
304 <parameter>--enable-x11grab</parameter>: Enables X11 grabbing.
305 </para>
306
307 <para>
308 <parameter>--enable-libfaac</parameter>: Enables AAC encoding via
309 <filename class="libraryfile">libfaac</filename>.
310 </para>
311
312 <para>
313 <parameter>--enable-libfreetype</parameter>: Enables the use of
314 <filename class="libraryfile">libfreetype</filename>.
315 </para>
316
317 <para>
318 <parameter>--enable-libmp3lame</parameter>: Enables MP3 encoding via
319 <filename class="libraryfile">libmp3lame</filename>.
320 </para>
321
322 <para>
323 <parameter>--enable-libopenjpeg</parameter>: Enables JPEG 2000 de/encoding
324 via <filename class="libraryfile">libopenjpeg</filename>.
325 </para>
326
327 <para>
328 <parameter>--enable-libpulse</parameter>: Enables
329 <application>Pulseaudio</application> input via
330 <filename class="libraryfile">libpulse</filename>.
331 </para>
332
333 <para>
334 <parameter>--enable-libspeex</parameter>: Enables
335 <application>Speex</application> de/encoding
336 via <filename class="libraryfile">libspeex</filename>.
337 </para>
338
339 <para>
340 <parameter>--enable-libtheora</parameter>: Enables
341 <application>Theora</application> encoding
342 via <filename class="libraryfile">libtheora</filename>.
343 </para>
344
345 <para>
346 <parameter>--enable-libvorbis</parameter>: Enables
347 <application>Vorbis</application> de/encoding
348 via <filename class="libraryfile">libvorbis</filename>.
349 </para>
350
351 <para>
352 <parameter>--enable-libvpx</parameter>: Enables VP8 de/encoding
353 via <filename class="libraryfile">libvpx</filename>.
354 </para>
355
356 <para>
357 <parameter>--enable-libxvid</parameter>: Enables
358 <application>Xvid</application> encoding
359 via <filename class="libraryfile">libxvidcore</filename>.
360 </para>
361
362 <para>
363 <parameter>--enable-openssl</parameter>: Enables
364 <application>OpenSSL</application> cryptography.
365 </para>
366
367 <para>
368 <parameter>--disable-debug</parameter>: Disables building debugging
369 symbols into the programs and libraries.
370 </para>
371
372 <para>
373 <option>--enable-<replaceable>&lt;codec&gt;</replaceable></option>:
374 <application>FFmpeg</application> comes with code to compile decoders for
375 almost every codec you could think of. The only reason to enable a
376 specific codec (and make <application>FFmpeg</application> link to the
377 prerequisite shared library installed on your system) is to make
378 <application>FFmpeg</application> compile an <emphasis>encoder</emphasis>
379 for that codec. <application>FFmpeg</application> provides an excellent
380 collection of decoders. If you just want to use
381 <application>FFmpeg</application> to watch video or listen to music (via
382 other applications such as <application>Gstreamer</application> or
383 <application>Xine</application>) then you will not benefit from linking
384 <application>FFmpeg</application> to other codec libraries.
385 </para>
386
387 </sect2>
388
389 <sect2 role="configuration">
390 <title>Configuring FFmpeg</title>
391
392 <sect3 id="ffmpeg-config">
393 <title>Config Files</title>
394
395 <para>
396 <filename>/etc/ffserver.conf</filename> and
397 <filename>~/.ffmpeg/ffserver-config</filename>
398 </para>
399
400 <indexterm zone="ffmpeg ffmpeg-config">
401 <primary
402 sortas="e-AA.ffmpeg-ffserver-config">~/.ffmpeg/ffserver-config</primary>
403 </indexterm>
404
405 <indexterm zone="ffmpeg ffmpeg-config">
406 <primary sortas="e-etc-ffserver.conf">/etc/ffserver.conf</primary>
407 </indexterm>
408
409 <para>
410 You'll find a sample <command>ffserver</command> configuration file at
411 <filename>doc/ffserver.conf</filename> in the source tree.
412 </para>
413
414 </sect3>
415
416 </sect2>
417
418 <sect2 role="content">
419 <title>Contents</title>
420
421 <segmentedlist>
422 <segtitle>Installed Programs</segtitle>
423 <segtitle>Installed Libraries</segtitle>
424 <segtitle>Installed Directories</segtitle>
425
426 <seglistitem>
427 <seg>
428 ffmpeg, ffplay, ffprobe, ffserver and
429 qt-faststart
430 </seg>
431 <seg>
432 libavcodec.so, libavdevice.so, libavfilter.so,
433 libavformat.so, libavutil.so, libpostproc.so,
434 libswresample and libswscale.so
435 </seg>
436 <seg>
437 /usr/include/libavcodec,
438 /usr/include/libavdevice,
439 /usr/include/libavfilter,
440 /usr/include/libavformat,
441 /usr/include/libavutil,
442 /usr/include/libpostproc,
443 /usr/include/libswresample
444 /usr/include/libswscale,
445 /usr/share/ffmpeg and
446 /usr/share/doc/ffmpeg-&ffmpeg-version;
447 </seg>
448 </seglistitem>
449 </segmentedlist>
450
451 <variablelist>
452 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
453 <?dbfo list-presentation="list"?>
454 <?dbhtml list-presentation="table"?>
455
456 <varlistentry id="ffmpeg-prog">
457 <term><command>ffmpeg</command></term>
458 <listitem>
459 <para>
460 is a command-line tool to convert video files, network streams and
461 input from a TV card to several video formats.
462 </para>
463 <indexterm zone="ffmpeg ffmpeg-prog">
464 <primary sortas="b-ffmpeg">ffmpeg</primary>
465 </indexterm>
466 </listitem>
467 </varlistentry>
468
469 <varlistentry id="ffplay">
470 <term><command>ffplay</command></term>
471 <listitem>
472 <para>
473 is a very simple and portable media player using the
474 <filename>ffmpeg</filename> libraries and the SDL library.
475 </para>
476 <indexterm zone="ffmpeg ffplay">
477 <primary sortas="b-ffplay">ffplay</primary>
478 </indexterm>
479 </listitem>
480 </varlistentry>
481
482 <varlistentry id="ffprobe">
483 <term><command>ffprobe</command></term>
484 <listitem>
485 <para>
486 gathers information from multimedia streams and prints it in a human
487 and machine-readable fashion.
488 </para>
489 <indexterm zone="ffmpeg ffprobe">
490 <primary sortas="b-ffprobe">ffprobe</primary>
491 </indexterm>
492 </listitem>
493 </varlistentry>
494
495 <varlistentry id="ffserver">
496 <term><command>ffserver</command></term>
497 <listitem>
498 <para>
499 is a streaming server for everything that <command>ffmpeg</command>
500 could use as input (files, streams, TV card input, webcam, etc).
501 </para>
502 <indexterm zone="ffmpeg ffserver">
503 <primary sortas="b-ffserver">ffserver</primary>
504 </indexterm>
505 </listitem>
506 </varlistentry>
507
508 <varlistentry id="qt-faststart">
509 <term><command>qt-faststart</command></term>
510 <listitem>
511 <para>
512 moves the index file to the front of quicktime (mov/mp4) videos.
513 </para>
514 <indexterm zone="ffmpeg qt-faststart">
515 <primary sortas="b-qt-faststart">qt-faststart</primary>
516 </indexterm>
517 </listitem>
518 </varlistentry>
519
520 <varlistentry id="libavcodec">
521 <term><filename class="libraryfile">libavcodec.so</filename></term>
522 <listitem>
523 <para>
524 is a library containing the <application>FFmpeg</application> codecs
525 (both encoding and decoding).
526 </para>
527 <indexterm zone="ffmpeg libavcodec">
528 <primary sortas="c-libavcodec">libavcodec.so</primary>
529 </indexterm>
530 </listitem>
531 </varlistentry>
532
533 <varlistentry id="libavdevice">
534 <term><filename class="libraryfile">libavdevice.so</filename></term>
535 <listitem>
536 <para>
537 is the <application>FFmpeg</application> device handling library.
538 </para>
539 <indexterm zone="ffmpeg libavdevice">
540 <primary sortas="c-libavdevice">libavdevice.so</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="libavfilter">
546 <term><filename class="libraryfile">libavfilter.so</filename></term>
547 <listitem>
548 <para>
549 is a library of filters that can alter video or audio between the
550 decoder and the encoder (or output).
551 </para>
552 <indexterm zone="ffmpeg libavfilter">
553 <primary sortas="c-libavfilter">libavfilter.so</primary>
554 </indexterm>
555 </listitem>
556 </varlistentry>
557
558 <varlistentry id="libavformat">
559 <term><filename class="libraryfile">libavformat.so</filename></term>
560 <listitem>
561 <para>
562 is a library containing the file formats handling (mux and demux
563 code for several formats) used by <command>ffplay</command> as well
564 as allowing the generation of audio or video streams.
565 </para>
566 <indexterm zone="ffmpeg libavformat">
567 <primary sortas="c-libavformat">libavformat.so</primary>
568 </indexterm>
569 </listitem>
570 </varlistentry>
571
572 <varlistentry id="libavutil">
573 <term><filename class="libraryfile">libavutil.so</filename></term>
574 <listitem>
575 <para>
576 is the <application>FFmpeg</application> utility library.
577 </para>
578 <indexterm zone="ffmpeg libavutil">
579 <primary sortas="c-libavutil">libavutil.so</primary>
580 </indexterm>
581 </listitem>
582 </varlistentry>
583
584 <varlistentry id="libpostproc">
585 <term><filename class="libraryfile">libpostproc.so</filename></term>
586 <listitem>
587 <para>
588 is the <application>FFmpeg</application> post processing library.
589 </para>
590 <indexterm zone="ffmpeg libpostproc">
591 <primary sortas="c-libpostproc">libpostproc.so</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="libswresample">
597 <term><filename class="libraryfile">libswresample.so</filename></term>
598 <listitem>
599 <para>
600 is the <application>FFmpeg</application> audio rescaling library,
601 it contains functions for converting audio sample formats.
602 </para>
603 <indexterm zone="ffmpeg libswresample">
604 <primary sortas="c-libswresample">libswresample.so</primary>
605 </indexterm>
606 </listitem>
607 </varlistentry>
608
609 <varlistentry id="libswscale">
610 <term><filename class="libraryfile">libswscale.so</filename></term>
611 <listitem>
612 <para>
613 is the <application>FFmpeg</application> image rescaling library.
614 </para>
615 <indexterm zone="ffmpeg libswscale">
616 <primary sortas="c-libswscale">libswscale.so</primary>
617 </indexterm>
618 </listitem>
619 </varlistentry>
620
621 </variablelist>
622
623 </sect2>
624
625</sect1>
Note: See TracBrowser for help on using the repository browser.