[libav.git] / doc / ffmpeg-doc.texi
1 \input texinfo @c -*- texinfo -*-
3 @settitle FFmpeg Documentation
4 @titlepage
5 @sp 7
6 @center @titlefont{FFmpeg Documentation}
7 @sp 3
8 @end titlepage
11 @chapter Introduction
13 FFmpeg is a very fast video and audio converter. It can also grab from
14 a live audio/video source.
16 The command line interface is designed to be intuitive, in the sense
17 that ffmpeg tries to figure out all the parameters, when
18 possible. You have usually to give only the target bitrate you want.
20 FFmpeg can also convert from any sample rate to any other, and resize
21 video on the fly with a high quality polyphase filter.
23 @chapter Quick Start
25 @c man begin EXAMPLES
26 @section Video and Audio grabbing
28 FFmpeg can use a video4linux compatible video source and any Open Sound
29 System audio source:
31 @example
32 ffmpeg /tmp/out.mpg
33 @end example
35 Note that you must activate the right video source and channel before
36 launching ffmpeg. You can use any TV viewer such as xawtv
37 (@url{http://bytesex.org/xawtv/}) by Gerd Knorr which I find very
38 good. You must also set correctly the audio recording levels with a
39 standard mixer.
41 @section Video and Audio file format conversion
43 * ffmpeg can use any supported file format and protocol as input:
45 Examples:
47 * You can input from YUV files:
49 @example
50 ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
51 @end example
53 It will use the files:
54 @example
55 /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
56 /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
57 @end example
59 The Y files use twice the resolution of the U and V files. They are
60 raw files, without header. They can be generated by all decent video
61 decoders. You must specify the size of the image with the @option{-s} option
62 if ffmpeg cannot guess it.
64 * You can input from a RAW YUV420P file:
66 @example
67 ffmpeg -i /tmp/test.yuv /tmp/out.avi
68 @end example
70 The RAW YUV420P is a file containing RAW YUV planar, for each frame first
71 come the Y plane followed by U and V planes, which are half vertical and
72 horizontal resolution.
74 * You can output to a RAW YUV420P file:
76 @example
77 ffmpeg -i mydivx.avi -o hugefile.yuv
78 @end example
80 * You can set several input files and output files:
82 @example
83 ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
84 @end example
86 Convert the audio file a.wav and the raw yuv video file a.yuv
87 to mpeg file a.mpg
89 * You can also do audio and video conversions at the same time:
91 @example
92 ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
93 @end example
95 Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
97 * You can encode to several formats at the same time and define a
98 mapping from input stream to output streams:
100 @example
101 ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
102 @end example
104 Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
105 file:index' specify which input stream is used for each output
106 stream, in the order of the definition of output streams.
108 * You can transcode decrypted VOBs
110 @example
111 ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
112 @end example
114 This is a typical DVD ripper example, input from a VOB file, output
115 to an AVI file with MPEG-4 video and MP3 audio, note that in this
116 command we use B frames so the MPEG-4 stream is DivX5 compatible, GOP
117 size is 300 that means an INTRA frame every 10 seconds for 29.97 fps
118 input video. Also the audio stream is MP3 encoded so you need LAME
119 support which is enabled using @code{--enable-mp3lame} when
120 configuring. The mapping is particularly useful for DVD transcoding
121 to get the desired audio language.
123 NOTE: to see the supported input formats, use @code{ffmpeg -formats}.
124 @c man end
126 @chapter Invocation
128 @section Syntax
130 The generic syntax is:
132 @example
133 @c man begin SYNOPSIS
134 ffmpeg [[options][@option{-i} @var{input_file}]]... @{[options] @var{output_file}@}...
135 @c man end
136 @end example
137 @c man begin DESCRIPTION
138 If no input file is given, audio/video grabbing is done.
140 As a general rule, options are applied to the next specified
141 file. For example, if you give the @option{-b 64} option, it sets the video
142 bitrate of the next file. Format option may be needed for raw input
143 files.
145 By default, ffmpeg tries to convert as losslessly as possible: it
146 uses the same audio and video parameter for the outputs as the one
147 specified for the inputs.
148 @c man end
150 @c man begin OPTIONS
151 @section Main options
153 @table @option
154 @item -L
155 show license
157 @item -h
158 show help
160 @item -formats
161 show available formats, codecs, protocols, ...
163 @item -f fmt
164 force format
166 @item -i filename
167 input file name
169 @item -y
170 overwrite output files
172 @item -t duration
173 set the recording time in seconds. @code{hh:mm:ss[.xxx]} syntax is also
174 supported.
176 @item -ss position
177 seek to given time position. @code{hh:mm:ss[.xxx]} syntax is also
178 supported.
180 @item -title string
181 set the title
183 @item -author string
184 set the author
186 @item -copyright string
187 set the copyright
189 @item -comment string
190 set the comment
192 @item -target type
193 specify target file type ("vcd", "svcd" or "dvd"). All the format
194 options (bitrate, codecs, buffer sizes) are automatically set by this
195 option. You can just type:
197 @example
198 ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
199 @end example
201 @item -hq
202 activate high quality settings
204 @end table
206 @section Video Options
208 @table @option
209 @item -b bitrate
210 set the video bitrate in kbit/s (default = 200 kb/s)
211 @item -r fps
212 set frame rate (default = 25)
213 @item -s size
214 set frame size. The format is @samp{WxH} (default 160x128). The
215 following abbreviations are recognized:
216 @table @samp
217 @item sqcif
218 128x96
219 @item qcif
220 176x144
221 @item cif
222 352x288
223 @item 4cif
224 704x576
225 @end table
227 @item -aspect aspect
228 set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
229 @item -croptop size
230 set top crop band size (in pixels)
231 @item -cropbottom size
232 set bottom crop band size (in pixels)
233 @item -cropleft size
234 set left crop band size (in pixels)
235 @item -cropright size
236 set right crop band size (in pixels)
237 @item -vn
238 disable video recording
239 @item -bt tolerance
240 set video bitrate tolerance (in kbit/s)
241 @item -maxrate bitrate
242 set max video bitrate tolerance (in kbit/s)
243 @item -minrate bitrate
244 set min video bitrate tolerance (in kbit/s)
245 @item -bufsize size
246 set ratecontrol buffere size (in kbit)
247 @item -vcodec codec
248 force video codec to @var{codec}. Use the @code{copy} special value to
249 tell that the raw codec data must be copied as is.
250 @item -sameq
251 use same video quality as source (implies VBR)
253 @item -pass n
254 select the pass number (1 or 2). It is useful to do two pass
255 encoding. The statistics of the video are recorded in the first pass and
256 the video at the exact requested bit rate is generated in the second
257 pass.
259 @item -passlogfile file
260 select two pass log file name to @var{file}.
262 @end table
264 @section Advanced Video Options
266 @table @option
267 @item -g gop_size
268 set the group of picture size
269 @item -intra
270 use only intra frames
271 @item -qscale q
272 use fixed video quantiser scale (VBR)
273 @item -qmin q
274 min video quantiser scale (VBR)
275 @item -qmax q
276 max video quantiser scale (VBR)
277 @item -qdiff q
278 max difference between the quantiser scale (VBR)
279 @item -qblur blur
280 video quantiser scale blur (VBR)
281 @item -qcomp compression
282 video quantiser scale compression (VBR)
284 @item -rc_init_cplx complexity
285 initial complexity for 1-pass encoding
286 @item -b_qfactor factor
287 qp factor between p and b frames
288 @item -i_qfactor factor
289 qp factor between p and i frames
290 @item -b_qoffset offset
291 qp offset between p and b frames
292 @item -i_qoffset offset
293 qp offset between p and i frames
294 @item -rc_eq equation
295 set rate control equation (@pxref{FFmpeg formula
296 evaluator}). Default is @code{tex^qComp}.
297 @item -rc_override override
298 rate control override for specific intervals
299 @item -me method
300 set motion estimation method to @var{method}. Available methods are
301 (from lower to best quality):
302 @table @samp
303 @item zero
304 Try just the (0, 0) vector.
305 @item phods
306 @item log
307 @item x1
308 @item epzs
309 (default method)
310 @item full
311 exhaustive search (slow and marginally better than epzs)
312 @end table
314 @item -dct_algo algo
315 set dct algorithm to @var{algo}. Available values are:
316 @table @samp
317 @item 0
318 FF_DCT_AUTO (default)
319 @item 1
321 @item 2
323 @item 3
325 @item 4
327 @item 5
329 @end table
331 @item -idct_algo algo
332 set idct algorithm to @var{algo}. Available values are:
333 @table @samp
334 @item 0
335 FF_IDCT_AUTO (default)
336 @item 1
338 @item 2
340 @item 3
342 @item 4
344 @item 5
346 @item 6
348 @item 7
350 @item 8
352 @item 9
354 @item 10
356 @end table
358 @item -er n
359 set error resilience to @var{n}.
360 @table @samp
361 @item 1
362 FF_ER_CAREFULL (default)
363 @item 2
365 @item 3
367 @item 4
369 @end table
371 @item -ec bit_mask
372 set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
373 the following values:
374 @table @samp
375 @item 1
376 FF_EC_GUESS_MVS (default=enabled)
377 @item 2
378 FF_EC_DEBLOCK (default=enabled)
379 @end table
381 @item -bf frames
382 use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)
383 @item -mbd mode
384 macroblock decision
385 @table @samp
386 @item 0
387 FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in ffmpeg)
388 @item 1
389 FF_MB_DECISION_BITS: chooses the one which needs the fewest bits
390 @item 2
391 FF_MB_DECISION_RD: rate distoration
392 @end table
394 @item -4mv
395 use four motion vector by macroblock (only MPEG-4)
396 @item -part
397 use data partitioning (only MPEG-4)
398 @item -bug param
399 workaround not auto detected encoder bugs
400 @item -strict strictness
401 how strictly to follow the standarts
402 @item -aic
403 enable Advanced intra coding (h263+)
404 @item -umv
405 enable Unlimited Motion Vector (h263+)
407 @item -deinterlace
408 deinterlace pictures
409 @item -interlace
410 force interlacing support in encoder (only MPEG-2 and MPEG-4). Use this option
411 if your input file is interlaced and if you want to keep the interlaced
412 format for minimum losses. The alternative is to deinterlace the input
413 stream with @option{-deinterlace}, but deinterlacing introduces more
414 losses.
415 @item -psnr
416 calculate PSNR of compressed frames
417 @item -vstats
418 dump video coding statistics to @file{vstats_HHMMSS.log}.
419 @item -vhook module
420 insert video processing @var{module}. @var{module} contains the module
421 name and its parameters separated by spaces.
422 @end table
424 @section Audio Options
426 @table @option
427 @item -ab bitrate
428 set audio bitrate (in kbit/s)
429 @item -ar freq
430 set the audio sampling freq (default = 44100 Hz)
431 @item -ab bitrate
432 set the audio bitrate in kbit/s (default = 64)
433 @item -ac channels
434 set the number of audio channels (default = 1)
435 @item -an
436 disable audio recording
437 @item -acodec codec
438 force audio codec to @var{codec}. Use the @code{copy} special value to
439 tell that the raw codec data must be copied as is.
440 @end table
442 @section Audio/Video grab options
444 @table @option
445 @item -vd device
446 set video grab device (e.g. @file{/dev/video0})
447 @item -vc channel
448 set video grab channel (DV1394 only)
449 @item -tvstd standard
450 set television standard (NTSC, PAL (SECAM))
451 @item -dv1394
452 set DV1394 grab
453 @item -ad device
454 set audio device (e.g. @file{/dev/dsp})
455 @end table
457 @section Advanced options
459 @table @option
460 @item -map file:stream
461 set input stream mapping
462 @item -debug
463 print specific debug info
464 @item -benchmark
465 add timings for benchmarking
466 @item -hex
467 dump each input packet
468 @item -bitexact
469 only use bit exact algorithms (for codec testing)
470 @item -ps size
471 set packet size in bits
472 @item -re
473 read input at native frame rate. Mainly used to simulate a grab device.
474 @item -loop
475 loop over the input stream. Currently it works only for image
476 streams. This option is used for ffserver automatic testing.
477 @end table
479 @node FFmpeg formula evaluator
480 @section FFmpeg formula evaluator
482 When evaluating a rate control string, FFmpeg uses an internal formula
483 evaluator.
485 The following binary operators are available: @code{+}, @code{-},
486 @code{*}, @code{/}, @code{^}.
488 The following unary operators are available: @code{+}, @code{-},
489 @code{(...)}.
491 The following functions are available:
492 @table @var
493 @item sinh(x)
494 @item cosh(x)
495 @item tanh(x)
496 @item sin(x)
497 @item cos(x)
498 @item tan(x)
499 @item exp(x)
500 @item log(x)
501 @item squish(x)
502 @item gauss(x)
503 @item abs(x)
504 @item max(x, y)
505 @item min(x, y)
506 @item gt(x, y)
507 @item lt(x, y)
508 @item eq(x, y)
509 @item bits2qp(bits)
510 @item qp2bits(qp)
511 @end table
513 The following constants are available:
514 @table @var
515 @item PI
516 @item E
517 @item iTex
518 @item pTex
519 @item tex
520 @item mv
521 @item fCode
522 @item iCount
523 @item mcVar
524 @item var
525 @item isI
526 @item isP
527 @item isB
528 @item avgQP
529 @item qComp
530 @item avgIITex
531 @item avgPITex
532 @item avgPPTex
533 @item avgBPTex
534 @item avgTex
535 @end table
537 @c man end
539 @ignore
541 @setfilename ffmpeg
542 @settitle FFmpeg video converter
544 @c man begin SEEALSO
545 ffserver(1), ffplay(1) and the html documentation of @file{ffmpeg}.
546 @c man end
548 @c man begin AUTHOR
549 Fabrice Bellard
550 @c man end
552 @end ignore
554 @section Protocols
556 The filename can be @file{-} to read from the standard input or to write
557 to the standard output.
559 ffmpeg handles also many protocols specified with the URL syntax.
561 Use 'ffmpeg -formats' to have a list of the supported protocols.
563 The protocol @code{http:} is currently used only to communicate with
564 ffserver (see the ffserver documentation). When ffmpeg will be a
565 video player it will also be used for streaming :-)
567 @chapter Tips
569 @itemize
570 @item For streaming at very low bit rate application, use a low frame rate
571 and a small gop size. This is especially true for real video where
572 the Linux player does not seem to be very fast, so it can miss
573 frames. An example is:
575 @example
576 ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
577 @end example
579 @item The parameter 'q' which is displayed while encoding is the current
580 quantizer. The value of 1 indicates that a very good quality could
581 be achieved. The value of 31 indicates the worst quality. If q=31
582 too often, it means that the encoder cannot compress enough to meet
583 your bit rate. You must either increase the bit rate, decrease the
584 frame rate or decrease the frame size.
586 @item If your computer is not fast enough, you can speed up the
587 compression at the expense of the compression ratio. You can use
588 '-me zero' to speed up motion estimation, and '-intra' to disable
589 completely motion estimation (you have only I frames, which means it
590 is about as good as JPEG compression).
592 @item To have very low bitrates in audio, reduce the sampling frequency
593 (down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
595 @item To have a constant quality (but a variable bitrate), use the option
596 '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
597 quality).
599 @item When converting video files, you can use the '-sameq' option which
600 uses in the encoder the same quality factor than in the decoder. It
601 allows to be almost lossless in encoding.
603 @end itemize
605 @chapter Supported File Formats and Codecs
607 You can use the @code{-formats} option to have an exhaustive list.
609 @section File Formats
611 FFmpeg supports the following file formats through the @code{libavformat}
612 library:
614 @multitable @columnfractions .4 .1 .1
615 @item Supported File Format @tab Encoding @tab Decoding @tab Comments
616 @item MPEG audio @tab X @tab X
617 @item MPEG1 systems @tab X @tab X
618 @tab muxed audio and video
619 @item MPEG2 PS @tab X @tab X
620 @tab also known as @code{VOB} file
621 @item MPEG2 TS @tab @tab X
622 @tab also known as DVB Transport Stream
623 @item ASF@tab X @tab X
624 @item AVI@tab X @tab X
625 @item WAV@tab X @tab X
626 @item Macromedia Flash@tab X @tab X
627 @tab Only embedded audio is decoded
628 @item FLV @tab X @tab X
629 @tab Macromedia Flash video files
630 @item Real Audio and Video @tab X @tab X
631 @item Raw AC3 @tab X @tab X
632 @item Raw MJPEG @tab X @tab X
633 @item Raw MPEG video @tab X @tab X
634 @item Raw PCM8/16 bits, mulaw/Alaw@tab X @tab X
635 @item Raw CRI ADX audio @tab X @tab X
636 @item SUN AU format @tab X @tab X
637 @item NUT @tab X @tab X @tab NUT Open Container Format
638 @item Quicktime @tab X @tab X
639 @item MPEG4 @tab X @tab X
640 @tab MPEG4 is a variant of Quicktime
641 @item Raw MPEG4 video @tab X @tab X
642 @item DV @tab X @tab X
643 @item 4xm @tab @tab X
644 @tab 4X Technologies format, used in some games
645 @item Playstation STR @tab @tab X
646 @item Id RoQ @tab @tab X
647 @tab used in Quake III, Jedi Knight 2, other computer games
648 @item Interplay MVE @tab @tab X
649 @tab format used in various Interplay computer games
650 @item WC3 Movie @tab @tab X
651 @tab multimedia format used in Origin's Wing Commander III computer game
652 @item Sega FILM/CPK @tab @tab X
653 @tab used in many Sega Saturn console games
654 @item Westwood Studios VQA/AUD @tab @tab X
655 @tab Multimedia formats used in Westwood Studios games
656 @item Id Cinematic (.cin) @tab @tab X
657 @tab Used in Quake II
658 @item FLIC format @tab @tab X
659 @tab .fli/.flc files
660 @item Sierra VMD @tab @tab X
661 @tab used in Sierra CD-ROM games
662 @item Matroska @tab @tab X
663 @end multitable
665 @code{X} means that the encoding (resp. decoding) is supported.
667 @section Image Formats
669 FFmpeg can read and write images for each frame of a video sequence. The
670 following image formats are supported:
672 @multitable @columnfractions .4 .1 .1
673 @item Supported Image Format @tab Encoding @tab Decoding @tab Comments
674 @item PGM, PPM @tab X @tab X
675 @item PAM @tab X @tab X @tab PAM is a PNM extension with alpha support
676 @item PGMYUV @tab X @tab X @tab PGM with U and V components in YUV 4:2:0
677 @item JPEG @tab X @tab X @tab Progressive JPEG is not supported
678 @item .Y.U.V @tab X @tab X @tab One raw file per component
679 @item Animated GIF @tab X @tab X @tab Only uncompressed GIFs are generated
680 @item PNG @tab X @tab X @tab 2 bit and 4 bit/pixel not supported yet
681 @end multitable
683 @code{X} means that the encoding (resp. decoding) is supported.
685 @section Video Codecs
687 @multitable @columnfractions .4 .1 .1 .7
688 @item Supported Codec @tab Encoding @tab Decoding @tab Comments
689 @item MPEG1 video @tab X @tab X
690 @item MPEG2 video @tab X @tab X
691 @item MPEG4 @tab X @tab X @tab Also known as DIVX4/5
692 @item MSMPEG4 V1 @tab X @tab X
693 @item MSMPEG4 V2 @tab X @tab X
694 @item MSMPEG4 V3 @tab X @tab X @tab Also known as DIVX3
695 @item WMV7 @tab X @tab X
696 @item WMV8 @tab X @tab X @tab Not completely working
697 @item H263(+) @tab X @tab X @tab Also known as Real Video 1.0
698 @item MJPEG @tab X @tab X
699 @item Lossless MJPEG @tab X @tab X
700 @item Apple MJPEG-B @tab @tab X
701 @item Sunplus MJPEG @tab @tab X @tab fourcc: SP5X
702 @item DV @tab X @tab X
703 @item Huff YUV @tab X @tab X
704 @item FFmpeg Video 1 @tab X @tab X @tab Lossless codec (fourcc: FFV1)
705 @item Asus v1 @tab X @tab X @tab fourcc: ASV1
706 @item Asus v2 @tab X @tab X @tab fourcc: ASV2
707 @item Creative YUV @tab @tab X @tab fourcc: CYUV
708 @item H.264 @tab @tab X
709 @item Sorenson Video 1 @tab @tab X @tab fourcc: SVQ1
710 @item Sorenson Video 3 @tab @tab X @tab fourcc: SVQ3
711 @item On2 VP3 @tab @tab X @tab still experimental
712 @item Theora @tab @tab X @tab still experimental
713 @item Intel Indeo 3 @tab @tab X @tab only works on i386 right now
714 @item FLV @tab X @tab X @tab Flash H263 variant
715 @item ATI VCR1 @tab @tab X @tab fourcc: VCR1
716 @item ATI VCR2 @tab @tab X @tab fourcc: VCR2
717 @item Cirrus Logic AccuPak @tab @tab X @tab fourcc: CLJR
718 @item 4X Video @tab @tab X @tab used in certain computer games
719 @item Sony Playstation MDEC @tab @tab X
720 @item Id RoQ @tab @tab X @tab used in Quake III, Jedi Knight 2, other computer games
721 @item Xan/WC3 @tab @tab X @tab used in Wing Commander III .MVE files
722 @item Interplay Video @tab @tab X @tab used in Interplay .MVE files
723 @item Apple Animation @tab @tab X @tab fourcc: 'rle '
724 @item Apple Graphics @tab @tab X @tab fourcc: 'smc '
725 @item Apple Video @tab @tab X @tab fourcc: rpza
726 @item Cinepak @tab @tab X
727 @item Microsoft RLE @tab @tab X
728 @item Microsoft Video-1 @tab @tab X
729 @item Westwood VQA @tab @tab X
730 @item Id Cinematic Video @tab @tab X @tab used in Quake II
731 @item Planar RGB @tab @tab X @tab fourcc: 8BPS
732 @item FLIC video @tab @tab X
733 @item Duck TrueMotion v1 @tab @tab X @tab fourcc: DUCK
734 @item VMD Video @tab @tab X @tab used in Sierra VMD files
735 @item MSZH @tab @tab X @tab Part of LCL
736 @item ZLIB @tab X @tab X @tab Part of LCL, encoder experimental
737 @end multitable
739 @code{X} means that the encoding (resp. decoding) is supported.
741 Check at @url{http://www.mplayerhq.hu/~michael/codec-features.html} to
742 get a precise comparison of FFmpeg MPEG4 codec compared to the other
743 solutions.
745 @section Audio Codecs
747 @multitable @columnfractions .4 .1 .1 .1 .7
748 @item Supported Codec @tab Encoding @tab Decoding @tab Comments
749 @item MPEG audio layer 2 @tab IX @tab IX
750 @item MPEG audio layer 1/3 @tab IX @tab IX
751 @tab MP3 encoding is supported through the external library LAME
752 @item AC3 @tab IX @tab X
753 @tab liba52 is used internally for decoding
754 @item Vorbis @tab X @tab X
755 @tab supported through the external library libvorbis
756 @item WMA V1/V2 @tab @tab X
757 @item Microsoft ADPCM @tab X @tab X
758 @item MS IMA ADPCM @tab X @tab X
759 @item QT IMA ADPCM @tab @tab X
760 @item 4X IMA ADPCM @tab @tab X
761 @item G.726 ADPCM @tab X @tab X
762 @item Duck DK3 IMA ADPCM @tab @tab X
763 @tab used in some Sega Saturn console games
764 @item Duck DK4 IMA ADPCM @tab @tab X
765 @tab used in some Sega Saturn console games
766 @item Westwood Studios IMA ADPCM @tab @tab X
767 @tab used in Westwood Studios games like Command and Conquer
768 @item SMJPEG IMA ADPCM @tab @tab X
769 @tab used in certain Loki game ports
770 @item CD-ROM XA ADPCM @tab @tab X
771 @item CRI ADX ADPCM @tab X @tab X
772 @tab used in Sega Dreamcast games
773 @item Electronic Arts ADPCM @tab @tab X
774 @tab used in various EA titles
775 @item RA144 @tab @tab X
776 @tab Real 14400 bit/s codec
777 @item RA288 @tab @tab X
778 @tab Real 28800 bit/s codec
779 @item AMR-NB @tab X @tab X
780 @tab supported through an external library
781 @item AMR-WB @tab X @tab X
782 @tab supported through an external library
783 @item DV audio @tab @tab X
784 @item Id RoQ DPCM @tab @tab X
785 @tab used in Quake III, Jedi Knight 2, other computer games
786 @item Interplay MVE DPCM @tab @tab X
787 @tab used in various Interplay computer games
788 @item Xan DPCM @tab @tab X
789 @tab used in Origin's Wing Commander IV AVI files
790 @item Apple MACE 3 @tab @tab X
791 @item Apple MACE 6 @tab @tab X
792 @item FLAC @tab @tab X
793 @end multitable
795 @code{X} means that the encoding (resp. decoding) is supported.
797 @code{I} means that an integer only version is available too (ensures highest
798 performances on systems without hardware floating point support).
800 @chapter Platform Specific information
802 @section Linux
804 ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
805 preferred compiler now for ffmpeg. All future optimizations will depend on
806 features only found in GCC 3.2.
808 @section BSD
810 @section Windows
812 @subsection Native Windows compilation
814 @itemize
815 @item Install the current versions of MSYS and MinGW from
816 @url{http://www.mingw.org/}. You can find detailed installation
817 instructions in the download section and the FAQ.
819 @item If you want to test the FFmpeg Simple Media Player, also download
820 the MinGW development library of SDL 1.2.x
821 (@file{SDL-devel-1.2.x-mingw32.tar.gz}) from
822 @url{http://www.libsdl.org}. Unpack it in a temporary place, and
823 unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool
824 directory. Edit the @file{sdl-config} script so that it gives the
825 correct SDL directory when invoked.
827 @item Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
829 @item Start the MSYS shell (file @file{msys.bat}).
831 @item Change to the FFMPEG directory and follow
832 the instructions of how to compile ffmpeg (file
833 @file{INSTALL}). Usually, launching @file{./configure} and @file{make}
834 suffices. If you have problems using SDL, verify that
835 @file{sdl-config} can be launched from the MSYS command line.
837 @item You can install FFmpeg in @file{Program Files/FFmpeg} by typing @file{make install}. Don't forget to copy @file{SDL.dll} at the place you launch
838 @file{ffplay}.
840 @end itemize
842 Notes:
843 @itemize
845 @item The target @file{make wininstaller} can be used to create a
846 Nullsoft based Windows installer for FFmpeg and FFplay. @file{SDL.dll}
847 must be copied in the ffmpeg directory in order to build the
848 installer.
850 @item By using @code{./configure --enable-shared} when configuring ffmpeg,
851 you can build @file{avcodec.dll} and @file{avformat.dll}. With
852 @code{make install} you install the FFmpeg DLLs and the associated
853 headers in @file{Program Files/FFmpeg}.
855 @item Visual C++ compatibility: if you used @code{./configure --enable-shared}
856 when configuring FFmpeg, then FFmpeg tries to use the Microsoft Visual
857 C++ @code{lib} tool to build @code{avcodec.lib} and
858 @code{avformat.lib}. With these libraries, you can link your Visual C++
859 code directly with the FFmpeg DLLs.
861 @end itemize
863 @subsection Cross compilation for Windows with Linux
865 You must use the MinGW cross compilation tools available at
866 @url{http://www.mingw.org/}.
868 Then configure ffmpeg with the following options:
869 @example
870 ./configure --enable-mingw32 --cross-prefix=i386-mingw32msvc-
871 @end example
872 (you can change the cross-prefix according to the prefix choosen for the
873 MinGW tools).
875 Then you can easily test ffmpeg with wine
876 (@url{http://www.winehq.com/}).
878 @section MacOS X
880 @section BeOS
882 The configure script should guess the configuration itself.
883 Networking support is currently not finished.
884 errno issues fixed by Andrew Bachmann.
886 Old stuff:
888 Fran├žois Revol - revol at free dot fr - April 2002
890 The configure script should guess the configuration itself,
891 however I still didn't tested building on net_server version of BeOS.
893 ffserver is broken (needs poll() implementation).
895 There is still issues with errno codes, which are negative in BeOs, and
896 that ffmpeg negates when returning. This ends up turning errors into
897 valid results, then crashes.
898 (To be fixed)
900 @chapter Developers Guide
902 @section API
903 @itemize
904 @item libavcodec is the library containing the codecs (both encoding and
905 decoding). See @file{libavcodec/apiexample.c} to see how to use it.
907 @item libavformat is the library containing the file formats handling (mux and
908 demux code for several formats). See @file{ffplay.c} to use it in a
909 player. See @file{output_example.c} to use it to generate audio or video
910 streams.
912 @end itemize
914 @section Integrating libavcodec or libavformat in your program
916 You can integrate all the source code of the libraries to link them
917 statically to avoid any version problem. All you need is to provide a
918 'config.mak' and a 'config.h' in the parent directory. See the defines
919 generated by ./configure to understand what is needed.
921 You can use libavcodec or libavformat in your commercial program, but
922 @emph{any patch you make must be published}. The best way to proceed is
923 to send your patches to the ffmpeg mailing list.
925 @section Coding Rules
927 ffmpeg is programmed in ANSI C language. GCC extensions are
928 tolerated. Indent size is 4. The TAB character should not be used.
930 The presentation is the one specified by 'indent -i4 -kr'.
932 Main priority in ffmpeg is simplicity and small code size (=less
933 bugs).
935 Comments: for functions visible from other modules, use the JavaDoc
936 format (see examples in @file{libav/utils.c}) so that a documentation
937 can be generated automatically.
939 @section Submitting patches
941 When you submit your patch, try to send a unified diff (diff '-up'
942 option). I cannot read other diffs :-)
944 Run the regression tests before submitting a patch so that you can
945 verify that there are no big problems.
947 Patches should be posted as base64 encoded attachments (or any other
948 encoding which ensures that the patch wont be trashed during
949 transmission) to the ffmpeg-devel mailinglist, see
950 @url{http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel}
952 It also helps quite a bit if you tell us what the patch does (for example
953 'replaces lrint by lrintf') , and why (for example '*bsd isnt c99 compliant
954 and has no lrint()')
956 @section Regression tests
958 Before submitting a patch (or committing with CVS), you should at least
959 test that you did not break anything.
961 The regression test build a synthetic video stream and a synthetic
962 audio stream. Then these are encoded then decoded with all codecs or
963 formats. The CRC (or MD5) of each generated file is recorded in a
964 result file. Then a 'diff' is launched with the reference results and
965 the result file.
967 The regression test then goes on to test the ffserver code with a
968 limited set of streams. It is important that this step runs correctly
969 as well.
971 Run 'make test' to test all the codecs.
973 Run 'make fulltest' to test all the codecs, formats and ffserver.
975 [Of course, some patches may change the regression tests results. In
976 this case, the regression tests reference results shall be modified
977 accordingly].
979 @bye