3
<!-- Created by texi2html 1.56k from ffmpeg-doc.texi on 16 September 2003 -->
5
<TITLE>FFmpeg Documentation</TITLE>
8
<H1>FFmpeg Documentation</H1>
11
<H1>Table of Contents</H1>
13
<LI><A NAME="TOC1" HREF="ffmpeg-doc.html#SEC1">1. Introduction</A>
14
<LI><A NAME="TOC2" HREF="ffmpeg-doc.html#SEC2">2. Quick Start</A>
16
<LI><A NAME="TOC3" HREF="ffmpeg-doc.html#SEC3">2.1 Video and Audio grabbing</A>
17
<LI><A NAME="TOC4" HREF="ffmpeg-doc.html#SEC4">2.2 Video and Audio file format conversion</A>
19
<LI><A NAME="TOC5" HREF="ffmpeg-doc.html#SEC5">3. Invocation</A>
21
<LI><A NAME="TOC6" HREF="ffmpeg-doc.html#SEC6">3.1 Syntax</A>
22
<LI><A NAME="TOC7" HREF="ffmpeg-doc.html#SEC7">3.2 Main options</A>
23
<LI><A NAME="TOC8" HREF="ffmpeg-doc.html#SEC8">3.3 Video Options</A>
24
<LI><A NAME="TOC9" HREF="ffmpeg-doc.html#SEC9">3.4 Advanced Video Options</A>
25
<LI><A NAME="TOC10" HREF="ffmpeg-doc.html#SEC10">3.5 Audio Options</A>
26
<LI><A NAME="TOC11" HREF="ffmpeg-doc.html#SEC11">3.6 Audio/Video grab options</A>
27
<LI><A NAME="TOC12" HREF="ffmpeg-doc.html#SEC12">3.7 Advanced options</A>
28
<LI><A NAME="TOC13" HREF="ffmpeg-doc.html#SEC13">3.8 FFmpeg formula evaluator</A>
29
<LI><A NAME="TOC14" HREF="ffmpeg-doc.html#SEC14">3.9 Protocols</A>
31
<LI><A NAME="TOC15" HREF="ffmpeg-doc.html#SEC15">4. Tips</A>
32
<LI><A NAME="TOC16" HREF="ffmpeg-doc.html#SEC16">5. Supported File Formats and Codecs</A>
34
<LI><A NAME="TOC17" HREF="ffmpeg-doc.html#SEC17">5.1 File Formats</A>
35
<LI><A NAME="TOC18" HREF="ffmpeg-doc.html#SEC18">5.2 Image Formats</A>
36
<LI><A NAME="TOC19" HREF="ffmpeg-doc.html#SEC19">5.3 Video Codecs</A>
37
<LI><A NAME="TOC20" HREF="ffmpeg-doc.html#SEC20">5.4 Audio Codecs</A>
39
<LI><A NAME="TOC21" HREF="ffmpeg-doc.html#SEC21">6. Platform Specific information</A>
41
<LI><A NAME="TOC22" HREF="ffmpeg-doc.html#SEC22">6.1 Linux</A>
42
<LI><A NAME="TOC23" HREF="ffmpeg-doc.html#SEC23">6.2 BSD</A>
43
<LI><A NAME="TOC24" HREF="ffmpeg-doc.html#SEC24">6.3 Windows</A>
45
<LI><A NAME="TOC25" HREF="ffmpeg-doc.html#SEC25">6.3.1 Native Windows compilation</A>
46
<LI><A NAME="TOC26" HREF="ffmpeg-doc.html#SEC26">6.3.2 Cross compilation for Windows with Linux</A>
48
<LI><A NAME="TOC27" HREF="ffmpeg-doc.html#SEC27">6.4 MacOS X</A>
49
<LI><A NAME="TOC28" HREF="ffmpeg-doc.html#SEC28">6.5 BeOS</A>
51
<LI><A NAME="TOC29" HREF="ffmpeg-doc.html#SEC29">7. Developers Guide</A>
53
<LI><A NAME="TOC30" HREF="ffmpeg-doc.html#SEC30">7.1 API</A>
54
<LI><A NAME="TOC31" HREF="ffmpeg-doc.html#SEC31">7.2 Integrating libavcodec or libavformat in your program</A>
55
<LI><A NAME="TOC32" HREF="ffmpeg-doc.html#SEC32">7.3 Coding Rules</A>
56
<LI><A NAME="TOC33" HREF="ffmpeg-doc.html#SEC33">7.4 Submitting patches</A>
57
<LI><A NAME="TOC34" HREF="ffmpeg-doc.html#SEC34">7.5 Regression tests</A>
68
<H1><A NAME="SEC1" HREF="ffmpeg-doc.html#TOC1">1. Introduction</A></H1>
71
FFmpeg is a very fast video and audio converter. It can also grab from
72
a live audio/video source.
74
The command line interface is designed to be intuitive, in the sense
75
that ffmpeg tries to figure out all the parameters, when
76
possible. You have usually to give only the target bitrate you want.
80
FFmpeg can also convert from any sample rate to any other, and resize
81
video on the fly with a high quality polyphase filter.
86
<H1><A NAME="SEC2" HREF="ffmpeg-doc.html#TOC2">2. Quick Start</A></H1>
90
<H2><A NAME="SEC3" HREF="ffmpeg-doc.html#TOC3">2.1 Video and Audio grabbing</A></H2>
93
FFmpeg can use a video4linux compatible video source and any Open Sound
103
Note that you must activate the right video source and channel before
104
launching ffmpeg. You can use any TV viewer such as xawtv
105
(<A HREF="http://bytesex.org/xawtv/">http://bytesex.org/xawtv/</A>) by Gerd Knorr which I find very
106
good. You must also set correctly the audio recording levels with a
112
<H2><A NAME="SEC4" HREF="ffmpeg-doc.html#TOC4">2.2 Video and Audio file format conversion</A></H2>
115
* ffmpeg can use any supported file format and protocol as input:
123
* You can input from YUV files:
128
ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
132
It will use the files:
135
/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
136
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
140
The Y files use twice the resolution of the U and V files. They are
141
raw files, without header. They can be generated by all decent video
142
decoders. You must specify the size of the image with the <SAMP>`-s'</SAMP> option
143
if ffmpeg cannot guess it.
147
* You can input from a RAW YUV420P file:
152
ffmpeg -i /tmp/test.yuv /tmp/out.avi
156
The RAW YUV420P is a file containing RAW YUV planar, for each frame first
157
come the Y plane followed by U and V planes, which are half vertical and
158
horizontal resolution.
162
* You can output to a RAW YUV420P file:
167
ffmpeg -i mydivx.avi -o hugefile.yuv
171
* You can set several input files and output files:
176
ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
180
Convert the audio file a.wav and the raw yuv video file a.yuv
185
* You can also do audio and video conversions at the same time:
190
ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
194
Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
198
* You can encode to several formats at the same time and define a
199
mapping from input stream to output streams:
204
ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
208
Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
209
file:index' specify which input stream is used for each output
210
stream, in the order of the definition of output streams.
214
* You can transcode decrypted VOBs
219
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
223
This is a typical DVD ripper example, input from a VOB file, output
224
to an AVI file with MPEG-4 video and MP3 audio, note that in this
225
command we use B frames so the MPEG-4 stream is DivX5 compatible, GOP
226
size is 300 that means an INTRA frame every 10 seconds for 29.97 fps
227
input video. Also the audio stream is MP3 encoded so you need LAME
228
support which is enabled using <CODE>--enable-mp3lame</CODE> when
229
configuring. The mapping is particularly useful for DVD transcoding
230
to get the desired audio language.
234
NOTE: to see the supported input formats, use <CODE>ffmpeg -formats</CODE>.
239
<H1><A NAME="SEC5" HREF="ffmpeg-doc.html#TOC5">3. Invocation</A></H1>
243
<H2><A NAME="SEC6" HREF="ffmpeg-doc.html#TOC6">3.1 Syntax</A></H2>
246
The generic syntax is:
251
ffmpeg [[options][<SAMP>`-i'</SAMP> <VAR>input_file</VAR>]]... {[options] <VAR>output_file</VAR>}...
255
If no input file is given, audio/video grabbing is done.
259
As a general rule, options are applied to the next specified
260
file. For example, if you give the <SAMP>`-b 64'</SAMP> option, it sets the video
261
bitrate of the next file. Format option may be needed for raw input
266
By default, ffmpeg tries to convert as losslessly as possible: it
267
uses the same audio and video parameter for the outputs as the one
268
specified for the inputs.
273
<H2><A NAME="SEC7" HREF="ffmpeg-doc.html#TOC7">3.2 Main options</A></H2>
277
<DT><SAMP>`-L'</SAMP>
281
<DT><SAMP>`-h'</SAMP>
285
<DT><SAMP>`-formats'</SAMP>
287
show available formats, codecs, protocols, ...
289
<DT><SAMP>`-f fmt'</SAMP>
293
<DT><SAMP>`-i filename'</SAMP>
297
<DT><SAMP>`-y'</SAMP>
299
overwrite output files
301
<DT><SAMP>`-t duration'</SAMP>
303
set the recording time in seconds. <CODE>hh:mm:ss[.xxx]</CODE> syntax is also
306
<DT><SAMP>`-title string'</SAMP>
310
<DT><SAMP>`-author string'</SAMP>
314
<DT><SAMP>`-copyright string'</SAMP>
318
<DT><SAMP>`-comment string'</SAMP>
322
<DT><SAMP>`-hq'</SAMP>
324
activate high quality settings
330
<H2><A NAME="SEC8" HREF="ffmpeg-doc.html#TOC8">3.3 Video Options</A></H2>
334
<DT><SAMP>`-b bitrate'</SAMP>
336
set the video bitrate in kbit/s (default = 200 kb/s)
337
<DT><SAMP>`-r fps'</SAMP>
339
set frame rate (default = 25)
340
<DT><SAMP>`-s size'</SAMP>
342
set frame size. The format is <SAMP>`WxH'</SAMP> (default 160x128). The
343
following abbreviations are recognized:
346
<DT><SAMP>`sqcif'</SAMP>
349
<DT><SAMP>`qcif'</SAMP>
352
<DT><SAMP>`cif'</SAMP>
355
<DT><SAMP>`4cif'</SAMP>
360
<DT><SAMP>`-aspect aspect'</SAMP>
362
set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
363
<DT><SAMP>`-croptop size'</SAMP>
365
set top crop band size (in pixels)
366
<DT><SAMP>`-cropbottom size'</SAMP>
368
set bottom crop band size (in pixels)
369
<DT><SAMP>`-cropleft size'</SAMP>
371
set left crop band size (in pixels)
372
<DT><SAMP>`-cropright size'</SAMP>
374
set right crop band size (in pixels)
375
<DT><SAMP>`-vn'</SAMP>
377
disable video recording
378
<DT><SAMP>`-bt tolerance'</SAMP>
380
set video bitrate tolerance (in kbit/s)
381
<DT><SAMP>`-maxrate bitrate'</SAMP>
383
set max video bitrate tolerance (in kbit/s)
384
<DT><SAMP>`-minrate bitrate'</SAMP>
386
set min video bitrate tolerance (in kbit/s)
387
<DT><SAMP>`-bufsize size'</SAMP>
389
set ratecontrol buffere size (in kbit)
390
<DT><SAMP>`-vcodec codec'</SAMP>
392
force video codec to <VAR>codec</VAR>. Use the <CODE>copy</CODE> special value to
393
tell that the raw codec data must be copied as is.
394
<DT><SAMP>`-sameq'</SAMP>
396
use same video quality as source (implies VBR)
398
<DT><SAMP>`-pass n'</SAMP>
400
select the pass number (1 or 2). It is useful to do two pass
401
encoding. The statistics of the video are recorded in the first pass and
402
the video at the exact requested bit rate is generated in the second
405
<DT><SAMP>`-passlogfile file'</SAMP>
407
select two pass log file name to <VAR>file</VAR>.
413
<H2><A NAME="SEC9" HREF="ffmpeg-doc.html#TOC9">3.4 Advanced Video Options</A></H2>
417
<DT><SAMP>`-g gop_size'</SAMP>
419
set the group of picture size
420
<DT><SAMP>`-intra'</SAMP>
422
use only intra frames
423
<DT><SAMP>`-qscale q'</SAMP>
425
use fixed video quantiser scale (VBR)
426
<DT><SAMP>`-qmin q'</SAMP>
428
min video quantiser scale (VBR)
429
<DT><SAMP>`-qmax q'</SAMP>
431
max video quantiser scale (VBR)
432
<DT><SAMP>`-qdiff q'</SAMP>
434
max difference between the quantiser scale (VBR)
435
<DT><SAMP>`-qblur blur'</SAMP>
437
video quantiser scale blur (VBR)
438
<DT><SAMP>`-qcomp compression'</SAMP>
440
video quantiser scale compression (VBR)
442
<DT><SAMP>`-rc_init_cplx complexity'</SAMP>
444
initial complexity for 1-pass encoding
445
<DT><SAMP>`-b_qfactor factor'</SAMP>
447
qp factor between p and b frames
448
<DT><SAMP>`-i_qfactor factor'</SAMP>
450
qp factor between p and i frames
451
<DT><SAMP>`-b_qoffset offset'</SAMP>
453
qp offset between p and b frames
454
<DT><SAMP>`-i_qoffset offset'</SAMP>
456
qp offset between p and i frames
457
<DT><SAMP>`-rc_eq equation'</SAMP>
459
set rate control equation (see section <A HREF="ffmpeg-doc.html#SEC13">3.8 FFmpeg formula evaluator</A>). Default is <CODE>tex^qComp</CODE>.
460
<DT><SAMP>`-rc_override override'</SAMP>
462
rate control override for specific intervals
463
<DT><SAMP>`-me method'</SAMP>
465
set motion estimation method to <VAR>method</VAR>. Available methods are
466
(from lower to best quality):
469
<DT><SAMP>`zero'</SAMP>
471
Try just the (0, 0) vector.
472
<DT><SAMP>`phods'</SAMP>
474
<DT><SAMP>`log'</SAMP>
476
<DT><SAMP>`x1'</SAMP>
478
<DT><SAMP>`epzs'</SAMP>
481
<DT><SAMP>`full'</SAMP>
483
exhaustive search (slow and marginally better than epzs)
486
<DT><SAMP>`-dct_algo algo'</SAMP>
488
set dct algorithm to <VAR>algo</VAR>. Available values are:
493
FF_DCT_AUTO (default)
511
<DT><SAMP>`-idct_algo algo'</SAMP>
513
set idct algorithm to <VAR>algo</VAR>. Available values are:
518
FF_IDCT_AUTO (default)
546
<DT><SAMP>`10'</SAMP>
551
<DT><SAMP>`-er n'</SAMP>
553
set error resilience to <VAR>n</VAR>.
558
FF_ER_CAREFULL (default)
567
FF_ER_VERY_AGGRESSIVE
570
<DT><SAMP>`-ec bit_mask'</SAMP>
572
set error concealment to <VAR>bit_mask</VAR>. <VAR>bit_mask</VAR> is a bit mask of
573
the following values:
578
FF_EC_GUESS_MVS (default=enabled)
581
FF_EC_DEBLOCK (default=enabled)
584
<DT><SAMP>`-bf frames'</SAMP>
586
use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)
587
<DT><SAMP>`-mbd mode'</SAMP>
594
FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in ffmpeg)
597
FF_MB_DECISION_BITS: chooses the one which needs the fewest bits
600
FF_MB_DECISION_RD: rate distoration
603
<DT><SAMP>`-4mv'</SAMP>
605
use four motion vector by macroblock (only MPEG-4)
606
<DT><SAMP>`-part'</SAMP>
608
use data partitioning (only MPEG-4)
609
<DT><SAMP>`-bug param'</SAMP>
611
workaround not auto detected encoder bugs
612
<DT><SAMP>`-strict strictness'</SAMP>
614
how strictly to follow the standarts
615
<DT><SAMP>`-aic'</SAMP>
617
enable Advanced intra coding (h263+)
618
<DT><SAMP>`-umv'</SAMP>
620
enable Unlimited Motion Vector (h263+)
622
<DT><SAMP>`-deinterlace'</SAMP>
625
<DT><SAMP>`-psnr'</SAMP>
627
calculate PSNR of compressed frames
628
<DT><SAMP>`-vstats'</SAMP>
630
dump video coding statistics to <TT>`vstats_HHMMSS.log'</TT>.
631
<DT><SAMP>`-vhook module'</SAMP>
633
insert video processing <VAR>module</VAR>. <VAR>module</VAR> contains the module
634
name and its parameters separated by spaces.
639
<H2><A NAME="SEC10" HREF="ffmpeg-doc.html#TOC10">3.5 Audio Options</A></H2>
643
<DT><SAMP>`-ab bitrate'</SAMP>
645
set audio bitrate (in kbit/s)
646
<DT><SAMP>`-ar freq'</SAMP>
648
set the audio sampling freq (default = 44100 Hz)
649
<DT><SAMP>`-ab bitrate'</SAMP>
651
set the audio bitrate in kbit/s (default = 64)
652
<DT><SAMP>`-ac channels'</SAMP>
654
set the number of audio channels (default = 1)
655
<DT><SAMP>`-an'</SAMP>
657
disable audio recording
658
<DT><SAMP>`-acodec codec'</SAMP>
660
force audio codec to <VAR>codec</VAR>. Use the <CODE>copy</CODE> special value to
661
tell that the raw codec data must be copied as is.
666
<H2><A NAME="SEC11" HREF="ffmpeg-doc.html#TOC11">3.6 Audio/Video grab options</A></H2>
670
<DT><SAMP>`-vd device'</SAMP>
672
set video grab device (e.g. <TT>`/dev/video0'</TT>)
673
<DT><SAMP>`-vc channel'</SAMP>
675
set video grab channel (DV1394 only)
676
<DT><SAMP>`-tvstd standard'</SAMP>
678
set television standard (NTSC, PAL (SECAM))
679
<DT><SAMP>`-dv1394'</SAMP>
682
<DT><SAMP>`-ad device'</SAMP>
684
set audio device (e.g. <TT>`/dev/dsp'</TT>)
689
<H2><A NAME="SEC12" HREF="ffmpeg-doc.html#TOC12">3.7 Advanced options</A></H2>
693
<DT><SAMP>`-map file:stream'</SAMP>
695
set input stream mapping
696
<DT><SAMP>`-debug'</SAMP>
698
print specific debug info
699
<DT><SAMP>`-benchmark'</SAMP>
701
add timings for benchmarking
702
<DT><SAMP>`-hex'</SAMP>
704
dump each input packet
705
<DT><SAMP>`-bitexact'</SAMP>
707
only use bit exact algorithms (for codec testing)
708
<DT><SAMP>`-ps size'</SAMP>
710
set packet size in bits
711
<DT><SAMP>`-re'</SAMP>
713
read input at native frame rate. Mainly used to simulate a grab device.
714
<DT><SAMP>`-loop'</SAMP>
716
loop over the input stream. Currently it works only for image
717
streams. This option is used for ffserver automatic testing.
722
<H2><A NAME="SEC13" HREF="ffmpeg-doc.html#TOC13">3.8 FFmpeg formula evaluator</A></H2>
725
When evaluating a rate control string, FFmpeg uses an internal formula
730
The following binary operators are available: <CODE>+</CODE>, <CODE>-</CODE>,
731
<CODE>*</CODE>, <CODE>/</CODE>, <CODE>^</CODE>.
735
The following unary operators are available: <CODE>+</CODE>, <CODE>-</CODE>,
740
The following functions are available:
743
<DT><VAR>sinh(x)</VAR>
745
<DT><VAR>cosh(x)</VAR>
747
<DT><VAR>tanh(x)</VAR>
749
<DT><VAR>sin(x)</VAR>
751
<DT><VAR>cos(x)</VAR>
753
<DT><VAR>tan(x)</VAR>
755
<DT><VAR>exp(x)</VAR>
757
<DT><VAR>log(x)</VAR>
759
<DT><VAR>squish(x)</VAR>
761
<DT><VAR>gauss(x)</VAR>
763
<DT><VAR>abs(x)</VAR>
765
<DT><VAR>max(x, y)</VAR>
767
<DT><VAR>min(x, y)</VAR>
769
<DT><VAR>gt(x, y)</VAR>
771
<DT><VAR>lt(x, y)</VAR>
773
<DT><VAR>eq(x, y)</VAR>
775
<DT><VAR>bits2qp(bits)</VAR>
777
<DT><VAR>qp2bits(qp)</VAR>
782
The following constants are available:
799
<DT><VAR>iCount</VAR>
815
<DT><VAR>avgIITex</VAR>
817
<DT><VAR>avgPITex</VAR>
819
<DT><VAR>avgPPTex</VAR>
821
<DT><VAR>avgBPTex</VAR>
823
<DT><VAR>avgTex</VAR>
829
<H2><A NAME="SEC14" HREF="ffmpeg-doc.html#TOC14">3.9 Protocols</A></H2>
832
The filename can be <TT>`-'</TT> to read from the standard input or to write
833
to the standard output.
837
ffmpeg handles also many protocols specified with the URL syntax.
841
Use 'ffmpeg -formats' to have a list of the supported protocols.
845
The protocol <CODE>http:</CODE> is currently used only to communicate with
846
ffserver (see the ffserver documentation). When ffmpeg will be a
847
video player it will also be used for streaming :-)
852
<H1><A NAME="SEC15" HREF="ffmpeg-doc.html#TOC15">4. Tips</A></H1>
856
<LI>For streaming at very low bit rate application, use a low frame rate
858
and a small gop size. This is especially true for real video where
859
the Linux player does not seem to be very fast, so it can miss
860
frames. An example is:
864
ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
867
<LI>The parameter 'q' which is displayed while encoding is the current
869
quantizer. The value of 1 indicates that a very good quality could
870
be achieved. The value of 31 indicates the worst quality. If q=31
871
too often, it means that the encoder cannot compress enough to meet
872
your bit rate. You must either increase the bit rate, decrease the
873
frame rate or decrease the frame size.
875
<LI>If your computer is not fast enough, you can speed up the
877
compression at the expense of the compression ratio. You can use
878
'-me zero' to speed up motion estimation, and '-intra' to disable
879
completely motion estimation (you have only I frames, which means it
880
is about as good as JPEG compression).
882
<LI>To have very low bitrates in audio, reduce the sampling frequency
884
(down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
886
<LI>To have a constant quality (but a variable bitrate), use the option
888
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
891
<LI>When converting video files, you can use the '-sameq' option which
893
uses in the encoder the same quality factor than in the decoder. It
894
allows to be almost lossless in encoding.
900
<H1><A NAME="SEC16" HREF="ffmpeg-doc.html#TOC16">5. Supported File Formats and Codecs</A></H1>
903
You can use the <CODE>-formats</CODE> option to have an exhaustive list.
908
<H2><A NAME="SEC17" HREF="ffmpeg-doc.html#TOC17">5.1 File Formats</A></H2>
911
FFmpeg supports the following file formats through the <CODE>libavformat</CODE>
917
<TR><TD>Supported File Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
920
<TR><TD>MPEG audio </TD><TD> X </TD><TD> X</TD>
923
<TR><TD>MPEG1 systems </TD><TD> X </TD><TD> X</TD>
925
</TD><TD> muxed audio and video
927
<TR><TD>MPEG2 PS </TD><TD> X </TD><TD> X</TD>
929
</TD><TD> also known as <CODE>VOB</CODE> file
931
<TR><TD>MPEG2 TS </TD><TD> </TD><TD> X</TD>
933
</TD><TD> also known as DVB Transport Stream
935
<TR><TD>ASF</TD><TD> X </TD><TD> X</TD>
938
<TR><TD>AVI</TD><TD> X </TD><TD> X</TD>
941
<TR><TD>WAV</TD><TD> X </TD><TD> X</TD>
944
<TR><TD>Macromedia Flash</TD><TD> X </TD><TD> X</TD>
946
</TD><TD> Only embedded audio is decoded
948
<TR><TD>FLV </TD><TD> X </TD><TD> X</TD>
950
</TD><TD> Macromedia Flash video files
952
<TR><TD>Real Audio and Video </TD><TD> X </TD><TD> X</TD>
955
<TR><TD>Raw AC3 </TD><TD> X </TD><TD> X</TD>
958
<TR><TD>Raw MJPEG </TD><TD> X </TD><TD> X</TD>
961
<TR><TD>Raw MPEG video </TD><TD> X </TD><TD> X</TD>
964
<TR><TD>Raw PCM8/16 bits, mulaw/Alaw</TD><TD> X </TD><TD> X</TD>
967
<TR><TD>SUN AU format </TD><TD> X </TD><TD> X</TD>
970
<TR><TD>Quicktime </TD><TD> X </TD><TD> X</TD>
973
<TR><TD>MPEG4 </TD><TD> X </TD><TD> X</TD>
975
</TD><TD> MPEG4 is a variant of Quicktime
977
<TR><TD>Raw MPEG4 video </TD><TD> X </TD><TD> X</TD>
980
<TR><TD>DV </TD><TD> </TD><TD> X</TD>
983
<TR><TD>4xm </TD><TD> </TD><TD> X</TD>
985
</TD><TD> 4X Technologies format, used in some games
987
<TR><TD>Playstation STR </TD><TD> </TD><TD> X</TD>
990
<TR><TD>Id RoQ </TD><TD> </TD><TD> X</TD>
992
</TD><TD> used in Quake III, Jedi Knight 2, other computer games
994
<TR><TD>Interplay MVE </TD><TD> </TD><TD> X</TD>
996
</TD><TD> format used in various Interplay computer games
998
<TR><TD>WC3 Movie </TD><TD> </TD><TD> X</TD>
1000
</TD><TD> multimedia format used in Origin's Wing Commander III computer game
1004
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
1009
<H2><A NAME="SEC18" HREF="ffmpeg-doc.html#TOC18">5.2 Image Formats</A></H2>
1012
FFmpeg can read and write images for each frame of a video sequence. The
1013
following image formats are supported:
1018
<TR><TD>Supported Image Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
1021
<TR><TD>PGM, PPM </TD><TD> X </TD><TD> X</TD>
1024
<TR><TD>PAM </TD><TD> X </TD><TD> X </TD><TD> PAM is a PNM extension with alpha support</TD>
1027
<TR><TD>PGMYUV </TD><TD> X </TD><TD> X </TD><TD> PGM with U and V components in YUV 4:2:0</TD>
1030
<TR><TD>JPEG </TD><TD> X </TD><TD> X </TD><TD> Progressive JPEG is not supported</TD>
1033
<TR><TD>.Y.U.V </TD><TD> X </TD><TD> X </TD><TD> One raw file per component</TD>
1036
<TR><TD>Animated GIF </TD><TD> X </TD><TD> X </TD><TD> Only uncompressed GIFs are generated</TD>
1039
<TR><TD>PNG </TD><TD> X </TD><TD> X </TD><TD> 2 bit and 4 bit/pixel not supported yet</TD>
1044
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
1049
<H2><A NAME="SEC19" HREF="ffmpeg-doc.html#TOC19">5.3 Video Codecs</A></H2>
1053
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
1056
<TR><TD>MPEG1 video </TD><TD> X </TD><TD> X</TD>
1059
<TR><TD>MPEG2 video </TD><TD> X </TD><TD> X</TD>
1062
<TR><TD>MPEG4 </TD><TD> X </TD><TD> X </TD><TD> Also known as DIVX4/5</TD>
1065
<TR><TD>MSMPEG4 V1 </TD><TD> X </TD><TD> X</TD>
1068
<TR><TD>MSMPEG4 V2 </TD><TD> X </TD><TD> X</TD>
1071
<TR><TD>MSMPEG4 V3 </TD><TD> X </TD><TD> X </TD><TD> Also known as DIVX3</TD>
1074
<TR><TD>WMV7 </TD><TD> X </TD><TD> X</TD>
1077
<TR><TD>WMV8 </TD><TD> X </TD><TD> X </TD><TD> Not completely working</TD>
1080
<TR><TD>H263(+) </TD><TD> X </TD><TD> X </TD><TD> Also known as Real Video 1.0</TD>
1083
<TR><TD>MJPEG </TD><TD> X </TD><TD> X</TD>
1086
<TR><TD>DV </TD><TD> </TD><TD> X</TD>
1089
<TR><TD>Huff YUV </TD><TD> X </TD><TD> X</TD>
1092
<TR><TD>Asus v1 </TD><TD> X </TD><TD> X </TD><TD> fourcc: ASV1</TD>
1095
<TR><TD>Asus v2 </TD><TD> X </TD><TD> X </TD><TD> fourcc: ASV2</TD>
1098
<TR><TD>Creative YUV </TD><TD> </TD><TD> X </TD><TD> fourcc: CYUV</TD>
1101
<TR><TD>H.264 </TD><TD> </TD><TD> X</TD>
1104
<TR><TD>Sorenson Video 1 </TD><TD> </TD><TD> X </TD><TD> fourcc: SVQ1</TD>
1107
<TR><TD>Sorenson Video 3 </TD><TD> </TD><TD> X </TD><TD> fourcc: SVQ3</TD>
1110
<TR><TD>On2 VP3 </TD><TD> </TD><TD> X </TD><TD> still experimental</TD>
1113
<TR><TD>Intel Indeo 3 </TD><TD> </TD><TD> X </TD><TD> only works on i386 right now</TD>
1116
<TR><TD>FLV </TD><TD> X </TD><TD> X </TD><TD> Flash H263 variant</TD>
1119
<TR><TD>ATI VCR1 </TD><TD> </TD><TD> X </TD><TD> fourcc: VCR1</TD>
1122
<TR><TD>Cirrus Logic AccuPak </TD><TD> </TD><TD> X </TD><TD> fourcc: CLJR</TD>
1125
<TR><TD>4X Video </TD><TD> </TD><TD> X </TD><TD> used in certain computer games</TD>
1128
<TR><TD>Sony Playstation MDEC </TD><TD> </TD><TD> X</TD>
1131
<TR><TD>Id RoQ </TD><TD> </TD><TD> X </TD><TD> used in Quake III, Jedi Knight 2, other computer games</TD>
1134
<TR><TD>Xan/WC3 </TD><TD> </TD><TD> X </TD><TD> used in Wing Commander III .MVE files</TD>
1137
<TR><TD>Interplay Video </TD><TD> </TD><TD> X </TD><TD> used in Interplay .MVE files</TD>
1142
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
1146
Check at <A HREF="http://www.mplayerhq.hu/~michael/codec-features.html">http://www.mplayerhq.hu/~michael/codec-features.html</A> to
1147
get a precise comparison of FFmpeg MPEG4 codec compared to the other
1153
<H2><A NAME="SEC20" HREF="ffmpeg-doc.html#TOC20">5.4 Audio Codecs</A></H2>
1157
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
1160
<TR><TD>MPEG audio layer 2 </TD><TD> IX </TD><TD> IX</TD>
1163
<TR><TD>MPEG audio layer 1/3 </TD><TD> IX </TD><TD> IX</TD>
1165
</TD><TD> MP3 encoding is supported through the external library LAME
1167
<TR><TD>AC3 </TD><TD> IX </TD><TD> X</TD>
1169
</TD><TD> liba52 is used internally for decoding
1171
<TR><TD>Vorbis </TD><TD> X </TD><TD> X</TD>
1173
</TD><TD> supported through the external library libvorbis
1175
<TR><TD>WMA V1/V2 </TD><TD> </TD><TD> X</TD>
1178
<TR><TD>Microsoft ADPCM </TD><TD> X </TD><TD> X</TD>
1181
<TR><TD>MS IMA ADPCM </TD><TD> X </TD><TD> X</TD>
1184
<TR><TD>QT IMA ADPCM </TD><TD> </TD><TD> X</TD>
1187
<TR><TD>4X IMA ADPCM </TD><TD> </TD><TD> X</TD>
1190
<TR><TD>Duck DK3 IMA ADPCM </TD><TD> </TD><TD> X</TD>
1192
</TD><TD> used in some Sega Saturn console games
1194
<TR><TD>Duck DK4 IMA ADPCM </TD><TD> </TD><TD> X</TD>
1196
</TD><TD> used in some Sega Saturn console games
1198
<TR><TD>RA144 </TD><TD> </TD><TD> X</TD>
1200
</TD><TD> Real 14400 bit/s codec
1202
<TR><TD>RA288 </TD><TD> </TD><TD> X</TD>
1204
</TD><TD> Real 28800 bit/s codec
1206
<TR><TD>AMR-NB </TD><TD> X </TD><TD> X</TD>
1208
</TD><TD> supported through an external library
1210
<TR><TD>DV audio </TD><TD> </TD><TD> X</TD>
1213
<TR><TD>Id RoQ DPCM </TD><TD> </TD><TD> X</TD>
1215
</TD><TD> used in Quake III, Jedi Knight 2, other computer games
1217
<TR><TD>Interplay MVE DPCM </TD><TD> </TD><TD> X</TD>
1219
</TD><TD> used in various Interplay computer games
1221
<TR><TD>Xan DPCM </TD><TD> </TD><TD> X</TD>
1223
</TD><TD> used in Origin's Wing Commander IV AVI files
1227
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
1231
<CODE>I</CODE> means that an integer only version is available too (ensures highest
1232
performances on systems without hardware floating point support).
1237
<H1><A NAME="SEC21" HREF="ffmpeg-doc.html#TOC21">6. Platform Specific information</A></H1>
1241
<H2><A NAME="SEC22" HREF="ffmpeg-doc.html#TOC22">6.1 Linux</A></H2>
1244
ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
1245
preferred compiler now for ffmpeg. All future optimizations will depend on
1246
features only found in GCC 3.2.
1251
<H2><A NAME="SEC23" HREF="ffmpeg-doc.html#TOC23">6.2 BSD</A></H2>
1255
<H2><A NAME="SEC24" HREF="ffmpeg-doc.html#TOC24">6.3 Windows</A></H2>
1259
<H3><A NAME="SEC25" HREF="ffmpeg-doc.html#TOC25">6.3.1 Native Windows compilation</A></H3>
1263
<LI>Install the current versions of MSYS and MinGW from
1265
<A HREF="http://www.mingw.org/">http://www.mingw.org/</A>. You can find detailed installation
1266
instructions in the download section and the FAQ.
1268
<LI>If you want to test the FFmpeg Simple Media Player, also download
1270
the MinGW development library of SDL 1.2.x
1271
(<TT>`SDL-devel-1.2.x-mingw32.tar.gz'</TT>) from
1272
<A HREF="http://www.libsdl.org">http://www.libsdl.org</A>. Unpack it in a temporary place, and
1273
unpack the archive <TT>`i386-mingw32msvc.tar.gz'</TT> in the MinGW tool
1274
directory. Edit the <TT>`sdl-config'</TT> script so that it gives the
1275
correct SDL directory when invoked.
1277
<LI>Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
1280
<LI>Start the MSYS shell (file <TT>`msys.bat'</TT>).
1282
<LI>Change to the FFMPEG directory and follow
1284
the instructions of how to compile ffmpeg (file
1285
<TT>`INSTALL'</TT>). Usually, launching <TT>`./configure'</TT> and <TT>`make'</TT>
1286
suffices. If you have problems using SDL, verify that
1287
<TT>`sdl-config'</TT> can be launched from the MSYS command line.
1289
<LI>You can install FFmpeg in <TT>`Program Files/FFmpeg'</TT> by typing <TT>`make install'</TT>. Don't forget to copy <TT>`SDL.dll'</TT> at the place you launch
1300
<LI>The target <TT>`make wininstaller'</TT> can be used to create a
1302
Nullsoft based Windows installer for FFmpeg and FFplay. <TT>`SDL.dll'</TT>
1303
must be copied in the ffmpeg directory in order to build the
1306
<LI>By using <CODE>./configure --enable-shared</CODE> when configuring ffmpeg,
1308
you can build <TT>`avcodec.dll'</TT> and <TT>`avformat.dll'</TT>. With
1309
<CODE>make install</CODE> you install the FFmpeg DLLs and the associated
1310
headers in <TT>`Program Files/FFmpeg'</TT>.
1312
<LI>Visual C++ compatibility: if you used <CODE>./configure --enable-shared</CODE>
1314
when configuring FFmpeg, then FFmpeg tries to use the Microsoft Visual
1315
C++ <CODE>lib</CODE> tool to build <CODE>avcodec.lib</CODE> and
1316
<CODE>avformat.lib</CODE>. With these libraries, you can link your Visual C++
1317
code directly with the FFmpeg DLLs.
1323
<H3><A NAME="SEC26" HREF="ffmpeg-doc.html#TOC26">6.3.2 Cross compilation for Windows with Linux</A></H3>
1326
You must use the MinGW cross compilation tools available at
1327
<A HREF="http://www.mingw.org/">http://www.mingw.org/</A>.
1331
Then configure ffmpeg with the following options:
1334
./configure --enable-mingw32 --cross-prefix=i386-mingw32msvc-
1338
(you can change the cross-prefix according to the prefix choosen for the
1343
Then you can easily test ffmpeg with wine
1344
(<A HREF="http://www.winehq.com/">http://www.winehq.com/</A>).
1349
<H2><A NAME="SEC27" HREF="ffmpeg-doc.html#TOC27">6.4 MacOS X</A></H2>
1353
<H2><A NAME="SEC28" HREF="ffmpeg-doc.html#TOC28">6.5 BeOS</A></H2>
1356
The configure script should guess the configuration itself.
1357
Networking support is currently not finished.
1358
errno issues fixed by Andrew Bachmann.
1366
Fran�ois Revol - revol at free dot fr - April 2002
1370
The configure script should guess the configuration itself,
1371
however I still didn't tested building on net_server version of BeOS.
1375
ffserver is broken (needs poll() implementation).
1379
There is still issues with errno codes, which are negative in BeOs, and
1380
that ffmpeg negates when returning. This ends up turning errors into
1381
valid results, then crashes.
1387
<H1><A NAME="SEC29" HREF="ffmpeg-doc.html#TOC29">7. Developers Guide</A></H1>
1391
<H2><A NAME="SEC30" HREF="ffmpeg-doc.html#TOC30">7.1 API</A></H2>
1394
<LI>libavcodec is the library containing the codecs (both encoding and
1396
decoding). See <TT>`libavcodec/apiexample.c'</TT> to see how to use it.
1398
<LI>libavformat is the library containing the file formats handling (mux and
1400
demux code for several formats). See <TT>`ffplay.c'</TT> to use it in a
1401
player. See <TT>`output_example.c'</TT> to use it to generate audio or video
1408
<H2><A NAME="SEC31" HREF="ffmpeg-doc.html#TOC31">7.2 Integrating libavcodec or libavformat in your program</A></H2>
1411
You can integrate all the source code of the libraries to link them
1412
statically to avoid any version problem. All you need is to provide a
1413
'config.mak' and a 'config.h' in the parent directory. See the defines
1414
generated by ./configure to understand what is needed.
1418
You can use libavcodec or libavformat in your commercial program, but
1419
<EM>any patch you make must be published</EM>. The best way to proceed is
1420
to send your patches to the ffmpeg mailing list.
1425
<H2><A NAME="SEC32" HREF="ffmpeg-doc.html#TOC32">7.3 Coding Rules</A></H2>
1428
ffmpeg is programmed in ANSI C language. GCC extensions are
1429
tolerated. Indent size is 4. The TAB character should not be used.
1433
The presentation is the one specified by 'indent -i4 -kr'.
1437
Main priority in ffmpeg is simplicity and small code size (=less
1442
Comments: for functions visible from other modules, use the JavaDoc
1443
format (see examples in <TT>`libav/utils.c'</TT>) so that a documentation
1444
can be generated automatically.
1449
<H2><A NAME="SEC33" HREF="ffmpeg-doc.html#TOC33">7.4 Submitting patches</A></H2>
1452
When you submit your patch, try to send a unified diff (diff '-u'
1453
option). I cannot read other diffs :-)
1457
Run the regression tests before submitting a patch so that you can
1458
verify that there are no big problems.
1462
Patches should be posted as base64 encoded attachments (or any other
1463
encoding which ensures that the patch wont be trashed during
1464
transmission) to the ffmpeg-devel mailinglist, see
1465
<A HREF="http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel">http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel</A>
1470
<H2><A NAME="SEC34" HREF="ffmpeg-doc.html#TOC34">7.5 Regression tests</A></H2>
1473
Before submitting a patch (or committing with CVS), you should at least
1474
test that you did not break anything.
1478
The regression test build a synthetic video stream and a synthetic
1479
audio stream. Then these are encoded then decoded with all codecs or
1480
formats. The CRC (or MD5) of each generated file is recorded in a
1481
result file. Then a 'diff' is launched with the reference results and
1486
The regression test then goes on to test the ffserver code with a
1487
limited set of streams. It is important that this step runs correctly
1492
Run 'make test' to test all the codecs.
1496
Run 'make fulltest' to test all the codecs, formats and ffserver.
1500
[Of course, some patches may change the regression tests results. In
1501
this case, the regression tests reference results shall be modified
1506
This document was generated on 16 September 2003 using
1507
<A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A> 1.56k.