Statistics
| Branch: | Revision:

ffmpeg / doc / ffmpeg-doc.texi @ 4fa1c4fa

History | View | Annotate | Download (26.8 KB)

1
\input texinfo @c -*- texinfo -*-
2

    
3
@settitle FFmpeg Documentation
4
@titlepage
5
@sp 7
6
@center @titlefont{FFmpeg Documentation}
7
@sp 3
8
@end titlepage
9

    
10

    
11
@chapter Introduction
12

    
13
FFmpeg is a very fast video and audio converter. It can also grab from
14
a live audio/video source.
15
  
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.
19

    
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.
22

    
23
@chapter Quick Start
24

    
25
@c man begin EXAMPLES
26
@section Video and Audio grabbing
27

    
28
FFmpeg can use a video4linux compatible video source and any Open Sound
29
System audio source:
30

    
31
@example
32
ffmpeg /tmp/out.mpg 
33
@end example
34

    
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.
40

    
41
@section Video and Audio file format conversion
42

    
43
* ffmpeg can use any supported file format and protocol as input: 
44

    
45
Examples:
46

    
47
* You can input from YUV files:
48

    
49
@example
50
ffmpeg -i /tmp/test%d.Y /tmp/out.mpg 
51
@end example
52

    
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
58

    
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.
63

    
64
* You can input from a RAW YUV420P file:
65

    
66
@example
67
ffmpeg -i /tmp/test.yuv /tmp/out.avi
68
@end example
69

    
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.
73

    
74
* You can output to a RAW YUV420P file:
75

    
76
@example
77
ffmpeg -i mydivx.avi -o hugefile.yuv
78
@end example
79

    
80
* You can set several input files and output files:
81

    
82
@example
83
ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
84
@end example
85

    
86
Convert the audio file a.wav and the raw yuv video file a.yuv
87
to mpeg file a.mpg
88

    
89
* You can also do audio and video conversions at the same time:
90

    
91
@example
92
ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
93
@end example
94

    
95
Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
96

    
97
* You can encode to several formats at the same time and define a
98
mapping from input stream to output streams:
99

    
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
103

    
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.
107

    
108
* You can transcode decrypted VOBs
109

    
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
113

    
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.
122

    
123
NOTE: to see the supported input formats, use @code{ffmpeg -formats}.
124
@c man end
125

    
126
@chapter Invocation
127

    
128
@section Syntax
129

    
130
The generic syntax is:
131

    
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.
139

    
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.
144

    
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
149

    
150
@c man begin OPTIONS
151
@section Main options
152

    
153
@table @option
154
@item -L
155
show license
156

    
157
@item -h
158
show help
159

    
160
@item -formats
161
show available formats, codecs, protocols, ...
162

    
163
@item -f fmt              
164
force format
165

    
166
@item -i filename         
167
input file name
168

    
169
@item -y                  
170
overwrite output files
171

    
172
@item -t duration         
173
set the recording time in seconds. @code{hh:mm:ss[.xxx]} syntax is also
174
supported.
175

    
176
@item -title string       
177
set the title
178

    
179
@item -author string      
180
set the author
181

    
182
@item -copyright string   
183
set the copyright
184

    
185
@item -comment string     
186
set the comment
187

    
188
@item -hq                 
189
activate high quality settings
190

    
191
@end table
192

    
193
@section Video Options
194

    
195
@table @option
196
@item -b bitrate
197
set the video bitrate in kbit/s (default = 200 kb/s)
198
@item -r fps           
199
set frame rate (default = 25)
200
@item -s size             
201
set frame size. The format is @samp{WxH} (default 160x128).  The
202
following abbreviations are recognized:
203
@table @samp
204
@item sqcif
205
128x96
206
@item qcif
207
176x144
208
@item cif
209
352x288
210
@item 4cif
211
704x576
212
@end table
213

    
214
@item -aspect aspect
215
set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
216
@item -croptop size
217
set top crop band size (in pixels)
218
@item -cropbottom size
219
set bottom crop band size (in pixels)
220
@item -cropleft size
221
set left crop band size (in pixels)
222
@item -cropright size
223
set right crop band size (in pixels)
224
@item -vn
225
disable video recording
226
@item -bt tolerance       
227
set video bitrate tolerance (in kbit/s)
228
@item -maxrate bitrate
229
set max video bitrate tolerance (in kbit/s)
230
@item -minrate bitrate
231
set min video bitrate tolerance (in kbit/s)
232
@item -bufsize size
233
set ratecontrol buffere size (in kbit)
234
@item -vcodec codec       
235
force video codec to @var{codec}. Use the @code{copy} special value to
236
tell that the raw codec data must be copied as is.
237
@item -sameq
238
use same video quality as source (implies VBR)
239

    
240
@item -pass n  
241
select the pass number (1 or 2). It is useful to do two pass
242
encoding. The statistics of the video are recorded in the first pass and
243
the video at the exact requested bit rate is generated in the second
244
pass.
245

    
246
@item -passlogfile file   
247
select two pass log file name to @var{file}.
248

    
249
@end table
250

    
251
@section Advanced Video Options
252

    
253
@table @option
254
@item -g gop_size         
255
set the group of picture size
256
@item -intra              
257
use only intra frames
258
@item -qscale q           
259
use fixed video quantiser scale (VBR)
260
@item -qmin q             
261
min video quantiser scale (VBR)
262
@item -qmax q             
263
max video quantiser scale (VBR)
264
@item -qdiff q            
265
max difference between the quantiser scale (VBR)
266
@item -qblur blur         
267
video quantiser scale blur (VBR)
268
@item -qcomp compression  
269
video quantiser scale compression (VBR)
270

    
271
@item -rc_init_cplx complexity
272
initial complexity for 1-pass encoding
273
@item -b_qfactor factor
274
qp factor between p and b frames
275
@item -i_qfactor factor
276
qp factor between p and i frames
277
@item -b_qoffset offset
278
qp offset between p and b frames
279
@item -i_qoffset offset
280
qp offset between p and i frames
281
@item -rc_eq equation
282
set rate control equation (@pxref{FFmpeg formula
283
evaluator}). Default is @code{tex^qComp}.
284
@item -rc_override override
285
rate control override for specific intervals
286
@item -me method
287
set motion estimation method to @var{method}. Available methods are
288
(from lower to best quality):
289
@table @samp
290
@item zero
291
Try just the (0, 0) vector.
292
@item phods
293
@item log
294
@item x1
295
@item epzs
296
(default method)
297
@item full
298
exhaustive search (slow and marginally better than epzs)
299
@end table
300

    
301
@item -dct_algo algo
302
set dct algorithm to @var{algo}. Available values are:
303
@table @samp
304
@item 0
305
FF_DCT_AUTO (default)
306
@item 1
307
FF_DCT_FASTINT
308
@item 2
309
FF_DCT_INT
310
@item 3
311
FF_DCT_MMX
312
@item 4
313
FF_DCT_MLIB
314
@item 5
315
FF_DCT_ALTIVEC
316
@end table
317

    
318
@item -idct_algo algo
319
set idct algorithm to @var{algo}. Available values are:
320
@table @samp
321
@item 0
322
FF_IDCT_AUTO (default)
323
@item 1
324
FF_IDCT_INT          
325
@item 2
326
FF_IDCT_SIMPLE       
327
@item 3
328
FF_IDCT_SIMPLEMMX    
329
@item 4
330
FF_IDCT_LIBMPEG2MMX  
331
@item 5
332
FF_IDCT_PS2          
333
@item 6
334
FF_IDCT_MLIB         
335
@item 7
336
FF_IDCT_ARM          
337
@item 8
338
FF_IDCT_ALTIVEC      
339
@item 9
340
FF_IDCT_SH4          
341
@item 10
342
FF_IDCT_SIMPLEARM    
343
@end table
344

    
345
@item -er n
346
set error resilience to @var{n}.
347
@table @samp
348
@item 1 
349
FF_ER_CAREFULL (default)
350
@item 2
351
FF_ER_COMPLIANT
352
@item 3
353
FF_ER_AGGRESSIVE
354
@item 4
355
FF_ER_VERY_AGGRESSIVE
356
@end table
357

    
358
@item -ec bit_mask
359
set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
360
the following values:
361
@table @samp
362
@item 1
363
FF_EC_GUESS_MVS (default=enabled)
364
@item 2
365
FF_EC_DEBLOCK (default=enabled)
366
@end table
367

    
368
@item -bf frames
369
use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)
370
@item -mbd mode
371
macroblock decision
372
@table @samp
373
@item 0
374
FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in ffmpeg)
375
@item 1
376
FF_MB_DECISION_BITS: chooses the one which needs the fewest bits
377
@item 2
378
FF_MB_DECISION_RD: rate distoration
379
@end table
380

    
381
@item -4mv
382
use four motion vector by macroblock (only MPEG-4)
383
@item -part
384
use data partitioning (only MPEG-4)
385
@item -bug param
386
workaround not auto detected encoder bugs
387
@item -strict strictness
388
how strictly to follow the standarts
389
@item -aic
390
enable Advanced intra coding (h263+)
391
@item -umv
392
enable Unlimited Motion Vector (h263+)
393

    
394
@item -deinterlace
395
deinterlace pictures
396
@item -psnr
397
calculate PSNR of compressed frames
398
@item -vstats
399
dump video coding statistics to @file{vstats_HHMMSS.log}.
400
@item -vhook module
401
insert video processing @var{module}. @var{module} contains the module
402
name and its parameters separated by spaces.
403
@end table
404

    
405
@section Audio Options
406

    
407
@table @option
408
@item -ab bitrate         
409
set audio bitrate (in kbit/s)
410
@item -ar freq    
411
set the audio sampling freq (default = 44100 Hz)
412
@item -ab bitrate 
413
set the audio bitrate in kbit/s (default = 64)
414
@item -ac channels
415
set the number of audio channels (default = 1)
416
@item -an
417
disable audio recording
418
@item -acodec codec
419
force audio codec to @var{codec}. Use the @code{copy} special value to
420
tell that the raw codec data must be copied as is.
421
@end table
422

    
423
@section Audio/Video grab options
424

    
425
@table @option
426
@item -vd device
427
set video grab device (e.g. @file{/dev/video0})
428
@item -vc channel
429
set video grab channel (DV1394 only)
430
@item -tvstd standard
431
set television standard (NTSC, PAL (SECAM))
432
@item -dv1394
433
set DV1394 grab
434
@item -ad device
435
set audio device (e.g. @file{/dev/dsp})
436
@end table
437

    
438
@section Advanced options
439

    
440
@table @option
441
@item -map file:stream    
442
set input stream mapping
443
@item -debug
444
print specific debug info
445
@item -benchmark          
446
add timings for benchmarking
447
@item -hex                
448
dump each input packet
449
@item -bitexact
450
only use bit exact algorithms (for codec testing)
451
@item -ps size
452
set packet size in bits
453
@item -re
454
read input at native frame rate. Mainly used to simulate a grab device.
455
@item -loop
456
loop over the input stream. Currently it works only for image
457
streams. This option is used for ffserver automatic testing.
458
@end table
459

    
460
@node FFmpeg formula evaluator
461
@section FFmpeg formula evaluator
462

    
463
When evaluating a rate control string, FFmpeg uses an internal formula
464
evaluator. 
465

    
466
The following binary operators are available: @code{+}, @code{-},
467
@code{*}, @code{/}, @code{^}.
468

    
469
The following unary operators are available: @code{+}, @code{-},
470
@code{(...)}.
471

    
472
The following functions are available:
473
@table @var
474
@item sinh(x)
475
@item cosh(x)
476
@item tanh(x)
477
@item sin(x)
478
@item cos(x)
479
@item tan(x)
480
@item exp(x)
481
@item log(x)
482
@item squish(x)
483
@item gauss(x)
484
@item abs(x)
485
@item max(x, y)
486
@item min(x, y)
487
@item gt(x, y)
488
@item lt(x, y)
489
@item eq(x, y)
490
@item bits2qp(bits)
491
@item qp2bits(qp)
492
@end table
493

    
494
The following constants are available:
495
@table @var
496
@item PI
497
@item E
498
@item iTex
499
@item pTex
500
@item tex
501
@item mv
502
@item fCode
503
@item iCount
504
@item mcVar
505
@item var
506
@item isI
507
@item isP
508
@item isB
509
@item avgQP
510
@item qComp
511
@item avgIITex
512
@item avgPITex
513
@item avgPPTex
514
@item avgBPTex
515
@item avgTex
516
@end table
517

    
518
@c man end
519

    
520
@ignore
521

    
522
@setfilename ffmpeg
523
@settitle FFmpeg video converter
524

    
525
@c man begin SEEALSO
526
ffserver(1), ffplay(1) and the html documentation of @file{ffmpeg}.
527
@c man end
528

    
529
@c man begin AUTHOR
530
Fabrice Bellard
531
@c man end
532

    
533
@end ignore
534

    
535
@section Protocols
536

    
537
The filename can be @file{-} to read from the standard input or to write
538
to the standard output.
539

    
540
ffmpeg handles also many protocols specified with the URL syntax.
541

    
542
Use 'ffmpeg -formats' to have a list of the supported protocols.
543

    
544
The protocol @code{http:} is currently used only to communicate with
545
ffserver (see the ffserver documentation). When ffmpeg will be a
546
video player it will also be used for streaming :-)
547

    
548
@chapter Tips
549

    
550
@itemize
551
@item For streaming at very low bit rate application, use a low frame rate
552
and a small gop size. This is especially true for real video where
553
the Linux player does not seem to be very fast, so it can miss
554
frames. An example is:
555

    
556
@example
557
ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
558
@end example
559

    
560
@item  The parameter 'q' which is displayed while encoding is the current
561
quantizer. The value of 1 indicates that a very good quality could
562
be achieved. The value of 31 indicates the worst quality. If q=31
563
too often, it means that the encoder cannot compress enough to meet
564
your bit rate. You must either increase the bit rate, decrease the
565
frame rate or decrease the frame size.
566

    
567
@item If your computer is not fast enough, you can speed up the
568
compression at the expense of the compression ratio. You can use
569
'-me zero' to speed up motion estimation, and '-intra' to disable
570
completely motion estimation (you have only I frames, which means it
571
is about as good as JPEG compression).
572

    
573
@item To have very low bitrates in audio, reduce the sampling frequency
574
(down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
575

    
576
@item To have a constant quality (but a variable bitrate), use the option
577
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
578
quality).
579

    
580
@item When converting video files, you can use the '-sameq' option which
581
uses in the encoder the same quality factor than in the decoder. It
582
allows to be almost lossless in encoding.
583

    
584
@end itemize
585

    
586
@chapter Supported File Formats and Codecs
587

    
588
You can use the @code{-formats} option to have an exhaustive list.
589

    
590
@section File Formats
591

    
592
FFmpeg supports the following file formats through the @code{libavformat}
593
library:
594

    
595
@multitable @columnfractions .4 .1 .1
596
@item Supported File Format @tab Encoding @tab Decoding @tab Comments
597
@item MPEG audio @tab X @tab X
598
@item MPEG1 systems @tab X  @tab  X 
599
@tab muxed audio and video
600
@item MPEG2 PS @tab X  @tab  X 
601
@tab also known as @code{VOB} file
602
@item MPEG2 TS @tab    @tab  X 
603
@tab also known as DVB Transport Stream
604
@item ASF@tab X @tab X 
605
@item AVI@tab X @tab X 
606
@item WAV@tab X @tab X 
607
@item Macromedia Flash@tab X @tab X
608
@tab Only embedded audio is decoded
609
@item FLV              @tab  X @tab X
610
@tab Macromedia Flash video files
611
@item Real Audio and Video @tab X @tab X 
612
@item Raw AC3 @tab X  @tab  X 
613
@item Raw MJPEG @tab X  @tab  X 
614
@item Raw MPEG video @tab X  @tab  X 
615
@item Raw PCM8/16 bits, mulaw/Alaw@tab X  @tab  X 
616
@item SUN AU format @tab X  @tab  X 
617
@item Quicktime        @tab X @tab  X 
618
@item MPEG4            @tab X @tab  X 
619
@tab MPEG4 is a variant of Quicktime
620
@item Raw MPEG4 video  @tab  X @tab  X 
621
@item DV               @tab  X @tab  X
622
@item 4xm              @tab    @tab X
623
@tab 4X Technologies format, used in some games
624
@item Playstation STR  @tab    @tab X
625
@item Id RoQ           @tab    @tab X
626
@tab used in Quake III, Jedi Knight 2, other computer games
627
@item Interplay MVE    @tab    @tab X
628
@tab format used in various Interplay computer games
629
@item WC3 Movie        @tab    @tab X
630
@tab multimedia format used in Origin's Wing Commander III computer game
631
@item Sega FILM/CPK    @tab    @tab X
632
@tab used in many Sega Saturn console games
633
@item Westwood Studios VQA/AUD  @tab    @tab X
634
@tab Multimedia formats used in Westwood Studios games
635
@end multitable
636

    
637
@code{X} means that the encoding (resp. decoding) is supported.
638

    
639
@section Image Formats
640

    
641
FFmpeg can read and write images for each frame of a video sequence. The
642
following image formats are supported:
643

    
644
@multitable @columnfractions .4 .1 .1
645
@item Supported Image Format @tab Encoding @tab Decoding @tab Comments
646
@item PGM, PPM     @tab X @tab X 
647
@item PAM          @tab X @tab X @tab PAM is a PNM extension with alpha support
648
@item PGMYUV       @tab X @tab X @tab PGM with U and V components in YUV 4:2:0
649
@item JPEG         @tab X @tab X @tab Progressive JPEG is not supported
650
@item .Y.U.V       @tab X @tab X @tab One raw file per component
651
@item Animated GIF @tab X @tab X @tab Only uncompressed GIFs are generated
652
@item PNG          @tab X @tab X @tab 2 bit and 4 bit/pixel not supported yet
653
@end multitable
654

    
655
@code{X} means that the encoding (resp. decoding) is supported.
656

    
657
@section Video Codecs
658

    
659
@multitable @columnfractions .4 .1 .1 .7
660
@item Supported Codec @tab Encoding @tab Decoding @tab Comments
661
@item MPEG1 video            @tab  X  @tab  X
662
@item MPEG2 video            @tab  X  @tab  X 
663
@item MPEG4                  @tab  X  @tab  X @tab Also known as DIVX4/5
664
@item MSMPEG4 V1             @tab  X  @tab  X
665
@item MSMPEG4 V2             @tab  X  @tab  X
666
@item MSMPEG4 V3             @tab  X  @tab  X @tab Also known as DIVX3
667
@item WMV7                   @tab  X  @tab  X
668
@item WMV8                   @tab  X  @tab  X @tab Not completely working
669
@item H263(+)                @tab  X  @tab  X @tab Also known as Real Video 1.0
670
@item MJPEG                  @tab  X  @tab  X 
671
@item DV                     @tab  X  @tab  X 
672
@item Huff YUV               @tab  X  @tab  X
673
@item Asus v1                @tab  X  @tab  X @tab fourcc: ASV1
674
@item Asus v2                @tab  X  @tab  X @tab fourcc: ASV2
675
@item Creative YUV           @tab     @tab  X @tab fourcc: CYUV
676
@item H.264                  @tab     @tab  X
677
@item Sorenson Video 1       @tab     @tab  X @tab fourcc: SVQ1
678
@item Sorenson Video 3       @tab     @tab  X @tab fourcc: SVQ3
679
@item On2 VP3                @tab     @tab  X @tab still experimental
680
@item Intel Indeo 3          @tab     @tab  X @tab only works on i386 right now
681
@item FLV                    @tab  X  @tab  X @tab Flash H263 variant
682
@item ATI VCR1               @tab     @tab  X @tab fourcc: VCR1
683
@item Cirrus Logic AccuPak   @tab     @tab  X @tab fourcc: CLJR
684
@item 4X Video               @tab     @tab  X @tab used in certain computer games
685
@item Sony Playstation MDEC  @tab     @tab  X 
686
@item Id RoQ                 @tab     @tab  X @tab used in Quake III, Jedi Knight 2, other computer games
687
@item Xan/WC3                @tab     @tab  X @tab used in Wing Commander III .MVE files
688
@item Interplay Video        @tab     @tab  X @tab used in Interplay .MVE files
689
@item Apple Video            @tab     @tab  X @tab fourcc: rpza
690
@item Cinepak                @tab     @tab  X
691
@item Microsoft RLE          @tab     @tab  X
692
@item Microsoft Video-1      @tab     @tab  X
693
@end multitable
694

    
695
@code{X} means that the encoding (resp. decoding) is supported.
696

    
697
Check at @url{http://www.mplayerhq.hu/~michael/codec-features.html} to
698
get a precise comparison of FFmpeg MPEG4 codec compared to the other
699
solutions.
700

    
701
@section Audio Codecs
702

    
703
@multitable @columnfractions .4 .1 .1 .1 .7
704
@item Supported Codec @tab Encoding @tab Decoding @tab Comments
705
@item MPEG audio layer 2     @tab  IX  @tab  IX 
706
@item MPEG audio layer 1/3   @tab IX   @tab  IX
707
@tab MP3 encoding is supported through the external library LAME
708
@item AC3                    @tab  IX  @tab  X
709
@tab liba52 is used internally for decoding
710
@item Vorbis                 @tab  X   @tab  X
711
@tab supported through the external library libvorbis
712
@item WMA V1/V2              @tab      @tab X
713
@item Microsoft ADPCM        @tab X    @tab X
714
@item MS IMA ADPCM           @tab X    @tab X
715
@item QT IMA ADPCM           @tab      @tab X
716
@item 4X IMA ADPCM           @tab      @tab X
717
@item Duck DK3 IMA ADPCM     @tab      @tab X
718
@tab used in some Sega Saturn console games
719
@item Duck DK4 IMA ADPCM     @tab      @tab X
720
@tab used in some Sega Saturn console games
721
@item Westwood Studios IMA ADPCM @tab      @tab X
722
@tab used in Westwood Studios games likes Command and Conquer
723
@item RA144                  @tab      @tab X
724
@tab Real 14400 bit/s codec
725
@item RA288                  @tab      @tab X
726
@tab Real 28800 bit/s codec
727
@item AMR-NB                 @tab X    @tab X
728
@tab supported through an external library
729
@item AMR-WB                 @tab X    @tab X
730
@tab supported through an external library
731
@item DV audio               @tab      @tab X
732
@item Id RoQ DPCM            @tab      @tab X
733
@tab used in Quake III, Jedi Knight 2, other computer games
734
@item Interplay MVE DPCM     @tab      @tab X
735
@tab used in various Interplay computer games
736
@item Xan DPCM               @tab      @tab X
737
@tab used in Origin's Wing Commander IV AVI files
738
@end multitable
739

    
740
@code{X} means that the encoding (resp. decoding) is supported.
741

    
742
@code{I} means that an integer only version is available too (ensures highest
743
performances on systems without hardware floating point support).
744

    
745
@chapter Platform Specific information
746

    
747
@section Linux
748

    
749
ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
750
preferred compiler now for ffmpeg. All future optimizations will depend on
751
features only found in GCC 3.2.
752

    
753
@section BSD
754

    
755
@section Windows
756

    
757
@subsection Native Windows compilation
758

    
759
@itemize
760
@item Install the current versions of MSYS and MinGW from
761
@url{http://www.mingw.org/}. You can find detailed installation
762
instructions in the download section and the FAQ.
763

    
764
@item If you want to test the FFmpeg Simple Media Player, also download 
765
the MinGW development library of SDL 1.2.x
766
(@file{SDL-devel-1.2.x-mingw32.tar.gz}) from
767
@url{http://www.libsdl.org}. Unpack it in a temporary place, and
768
unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool
769
directory. Edit the @file{sdl-config} script so that it gives the
770
correct SDL directory when invoked.
771

    
772
@item Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
773
 
774
@item Start the MSYS shell (file @file{msys.bat}).
775

    
776
@item Change to the FFMPEG directory and follow
777
 the instructions of how to compile ffmpeg (file
778
@file{INSTALL}). Usually, launching @file{./configure} and @file{make}
779
suffices. If you have problems using SDL, verify that
780
@file{sdl-config} can be launched from the MSYS command line.
781

    
782
@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 
783
@file{ffplay}.
784

    
785
@end itemize
786

    
787
Notes: 
788
@itemize
789

    
790
@item The target @file{make wininstaller} can be used to create a
791
Nullsoft based Windows installer for FFmpeg and FFplay. @file{SDL.dll}
792
must be copied in the ffmpeg directory in order to build the
793
installer.
794

    
795
@item By using @code{./configure --enable-shared} when configuring ffmpeg, 
796
you can build @file{avcodec.dll} and @file{avformat.dll}. With
797
@code{make install} you install the FFmpeg DLLs and the associated
798
headers in @file{Program Files/FFmpeg}. 
799

    
800
@item Visual C++ compatibility: if you used @code{./configure --enable-shared} 
801
when configuring FFmpeg, then FFmpeg tries to use the Microsoft Visual
802
C++ @code{lib} tool to build @code{avcodec.lib} and
803
@code{avformat.lib}. With these libraries, you can link your Visual C++
804
code directly with the FFmpeg DLLs.
805

    
806
@end itemize
807

    
808
@subsection Cross compilation for Windows with Linux
809

    
810
You must use the MinGW cross compilation tools available at
811
@url{http://www.mingw.org/}.
812

    
813
Then configure ffmpeg with the following options:
814
@example
815
./configure --enable-mingw32 --cross-prefix=i386-mingw32msvc-
816
@end example
817
(you can change the cross-prefix according to the prefix choosen for the
818
MinGW tools).
819

    
820
Then you can easily test ffmpeg with wine
821
(@url{http://www.winehq.com/}).
822

    
823
@section MacOS X
824

    
825
@section BeOS
826

    
827
The configure script should guess the configuration itself.
828
Networking support is currently not finished.
829
errno issues fixed by Andrew Bachmann.
830

    
831
Old stuff:
832

    
833
Fran?ois Revol - revol at free dot fr - April 2002
834

    
835
The configure script should guess the configuration itself, 
836
however I still didn't tested building on net_server version of BeOS.
837

    
838
ffserver is broken (needs poll() implementation).
839

    
840
There is still issues with errno codes, which are negative in BeOs, and
841
that ffmpeg negates when returning. This ends up turning errors into 
842
valid results, then crashes.
843
(To be fixed)
844

    
845
@chapter Developers Guide
846

    
847
@section API
848
@itemize
849
@item libavcodec is the library containing the codecs (both encoding and
850
  decoding). See @file{libavcodec/apiexample.c} to see how to use it.
851

    
852
@item libavformat is the library containing the file formats handling (mux and
853
  demux code for several formats). See @file{ffplay.c} to use it in a
854
player. See @file{output_example.c} to use it to generate audio or video
855
streams.
856

    
857
@end itemize
858

    
859
@section Integrating libavcodec or libavformat in your program
860

    
861
You can integrate all the source code of the libraries to link them
862
statically to avoid any version problem. All you need is to provide a
863
'config.mak' and a 'config.h' in the parent directory. See the defines
864
generated by ./configure to understand what is needed.
865

    
866
You can use libavcodec or libavformat in your commercial program, but
867
@emph{any patch you make must be published}. The best way to proceed is
868
to send your patches to the ffmpeg mailing list.
869

    
870
@section Coding Rules
871

    
872
ffmpeg is programmed in ANSI C language. GCC extensions are
873
tolerated. Indent size is 4. The TAB character should not be used.
874

    
875
The presentation is the one specified by 'indent -i4 -kr'.
876

    
877
Main priority in ffmpeg is simplicity and small code size (=less
878
bugs).
879

    
880
Comments: for functions visible from other modules, use the JavaDoc
881
format (see examples in @file{libav/utils.c}) so that a documentation
882
can be generated automatically.
883

    
884
@section Submitting patches
885

    
886
When you submit your patch, try to send a unified diff (diff '-u'
887
option). I cannot read other diffs :-)
888

    
889
Run the regression tests before submitting a patch so that you can
890
verify that there are no big problems.
891

    
892
Patches should be posted as base64 encoded attachments (or any other
893
encoding which ensures that the patch wont be trashed during 
894
transmission) to the ffmpeg-devel mailinglist, see 
895
@url{http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel}
896

    
897
@section Regression tests
898

    
899
Before submitting a patch (or committing with CVS), you should at least
900
test that you did not break anything.
901

    
902
The regression test build a synthetic video stream and a synthetic
903
audio stream. Then these are encoded then decoded with all codecs or
904
formats. The CRC (or MD5) of each generated file is recorded in a
905
result file. Then a 'diff' is launched with the reference results and
906
the result file.
907

    
908
The regression test then goes on to test the ffserver code with a 
909
limited set of streams. It is important that this step runs correctly
910
as well.
911

    
912
Run 'make test' to test all the codecs.
913

    
914
Run 'make fulltest' to test all the codecs, formats and ffserver.
915

    
916
[Of course, some patches may change the regression tests results. In
917
this case, the regression tests reference results shall be modified
918
accordingly].
919

    
920
@bye