~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/doc/ffmpeg-doc.html

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2004-08-29 10:53:42 UTC
  • Revision ID: james.westby@ubuntu.com-20040829105342-qgmnry37eadfkoxx
Tags: upstream-1.1.3
Import upstream version 1.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<HTML>
 
2
<HEAD>
 
3
<!-- Created by texi2html 1.56k from ffmpeg-doc.texi on 16 September 2003 -->
 
4
 
 
5
<TITLE>FFmpeg Documentation</TITLE>
 
6
</HEAD>
 
7
<BODY>
 
8
<H1>FFmpeg Documentation</H1>
 
9
<P>
 
10
<P><HR><P>
 
11
<H1>Table of Contents</H1>
 
12
<UL>
 
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>
 
15
<UL>
 
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>
 
18
</UL>
 
19
<LI><A NAME="TOC5" HREF="ffmpeg-doc.html#SEC5">3. Invocation</A>
 
20
<UL>
 
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>
 
30
</UL>
 
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>
 
33
<UL>
 
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>
 
38
</UL>
 
39
<LI><A NAME="TOC21" HREF="ffmpeg-doc.html#SEC21">6. Platform Specific information</A>
 
40
<UL>
 
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>
 
44
<UL>
 
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>
 
47
</UL>
 
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>
 
50
</UL>
 
51
<LI><A NAME="TOC29" HREF="ffmpeg-doc.html#SEC29">7. Developers Guide</A>
 
52
<UL>
 
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>
 
58
</UL>
 
59
</UL>
 
60
<P><HR><P>
 
61
 
 
62
<P>
 
63
FFmpeg Documentation
 
64
 
 
65
 
 
66
 
 
67
 
 
68
<H1><A NAME="SEC1" HREF="ffmpeg-doc.html#TOC1">1. Introduction</A></H1>
 
69
 
 
70
<P>
 
71
FFmpeg is a very fast video and audio converter. It can also grab from
 
72
a live audio/video source.
 
73
  
 
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.
 
77
 
 
78
 
 
79
<P>
 
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.
 
82
 
 
83
 
 
84
 
 
85
 
 
86
<H1><A NAME="SEC2" HREF="ffmpeg-doc.html#TOC2">2. Quick Start</A></H1>
 
87
 
 
88
 
 
89
 
 
90
<H2><A NAME="SEC3" HREF="ffmpeg-doc.html#TOC3">2.1 Video and Audio grabbing</A></H2>
 
91
 
 
92
<P>
 
93
FFmpeg can use a video4linux compatible video source and any Open Sound
 
94
System audio source:
 
95
 
 
96
 
 
97
 
 
98
<PRE>
 
99
ffmpeg /tmp/out.mpg 
 
100
</PRE>
 
101
 
 
102
<P>
 
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
 
107
standard mixer.
 
108
 
 
109
 
 
110
 
 
111
 
 
112
<H2><A NAME="SEC4" HREF="ffmpeg-doc.html#TOC4">2.2 Video and Audio file format conversion</A></H2>
 
113
 
 
114
<P>
 
115
* ffmpeg can use any supported file format and protocol as input: 
 
116
 
 
117
 
 
118
<P>
 
119
Examples:
 
120
 
 
121
 
 
122
<P>
 
123
* You can input from YUV files:
 
124
 
 
125
 
 
126
 
 
127
<PRE>
 
128
ffmpeg -i /tmp/test%d.Y /tmp/out.mpg 
 
129
</PRE>
 
130
 
 
131
<P>
 
132
It will use the files: 
 
133
 
 
134
<PRE>
 
135
/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
 
136
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
 
137
</PRE>
 
138
 
 
139
<P>
 
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.
 
144
 
 
145
 
 
146
<P>
 
147
* You can input from a RAW YUV420P file:
 
148
 
 
149
 
 
150
 
 
151
<PRE>
 
152
ffmpeg -i /tmp/test.yuv /tmp/out.avi
 
153
</PRE>
 
154
 
 
155
<P>
 
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.
 
159
 
 
160
 
 
161
<P>
 
162
* You can output to a RAW YUV420P file:
 
163
 
 
164
 
 
165
 
 
166
<PRE>
 
167
ffmpeg -i mydivx.avi -o hugefile.yuv
 
168
</PRE>
 
169
 
 
170
<P>
 
171
* You can set several input files and output files:
 
172
 
 
173
 
 
174
 
 
175
<PRE>
 
176
ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
 
177
</PRE>
 
178
 
 
179
<P>
 
180
Convert the audio file a.wav and the raw yuv video file a.yuv
 
181
to mpeg file a.mpg
 
182
 
 
183
 
 
184
<P>
 
185
* You can also do audio and video conversions at the same time:
 
186
 
 
187
 
 
188
 
 
189
<PRE>
 
190
ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
 
191
</PRE>
 
192
 
 
193
<P>
 
194
Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
 
195
 
 
196
 
 
197
<P>
 
198
* You can encode to several formats at the same time and define a
 
199
mapping from input stream to output streams:
 
200
 
 
201
 
 
202
 
 
203
<PRE>
 
204
ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
 
205
</PRE>
 
206
 
 
207
<P>
 
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.
 
211
 
 
212
 
 
213
<P>
 
214
* You can transcode decrypted VOBs
 
215
 
 
216
 
 
217
 
 
218
<PRE>
 
219
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
 
220
</PRE>
 
221
 
 
222
<P>
 
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.
 
231
 
 
232
 
 
233
<P>
 
234
NOTE: to see the supported input formats, use <CODE>ffmpeg -formats</CODE>.
 
235
 
 
236
 
 
237
 
 
238
 
 
239
<H1><A NAME="SEC5" HREF="ffmpeg-doc.html#TOC5">3. Invocation</A></H1>
 
240
 
 
241
 
 
242
 
 
243
<H2><A NAME="SEC6" HREF="ffmpeg-doc.html#TOC6">3.1 Syntax</A></H2>
 
244
 
 
245
<P>
 
246
The generic syntax is:
 
247
 
 
248
 
 
249
 
 
250
<PRE>
 
251
ffmpeg [[options][<SAMP>`-i'</SAMP> <VAR>input_file</VAR>]]... {[options] <VAR>output_file</VAR>}...
 
252
</PRE>
 
253
 
 
254
<P>
 
255
If no input file is given, audio/video grabbing is done.
 
256
 
 
257
 
 
258
<P>
 
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
 
262
files.
 
263
 
 
264
 
 
265
<P>
 
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.
 
269
 
 
270
 
 
271
 
 
272
 
 
273
<H2><A NAME="SEC7" HREF="ffmpeg-doc.html#TOC7">3.2 Main options</A></H2>
 
274
 
 
275
<DL COMPACT>
 
276
 
 
277
<DT><SAMP>`-L'</SAMP>
 
278
<DD>
 
279
show license
 
280
 
 
281
<DT><SAMP>`-h'</SAMP>
 
282
<DD>
 
283
show help
 
284
 
 
285
<DT><SAMP>`-formats'</SAMP>
 
286
<DD>
 
287
show available formats, codecs, protocols, ...
 
288
 
 
289
<DT><SAMP>`-f fmt'</SAMP>
 
290
<DD>
 
291
force format
 
292
 
 
293
<DT><SAMP>`-i filename'</SAMP>
 
294
<DD>
 
295
input file name
 
296
 
 
297
<DT><SAMP>`-y'</SAMP>
 
298
<DD>
 
299
overwrite output files
 
300
 
 
301
<DT><SAMP>`-t duration'</SAMP>
 
302
<DD>
 
303
set the recording time in seconds. <CODE>hh:mm:ss[.xxx]</CODE> syntax is also
 
304
supported.
 
305
 
 
306
<DT><SAMP>`-title string'</SAMP>
 
307
<DD>
 
308
set the title
 
309
 
 
310
<DT><SAMP>`-author string'</SAMP>
 
311
<DD>
 
312
set the author
 
313
 
 
314
<DT><SAMP>`-copyright string'</SAMP>
 
315
<DD>
 
316
set the copyright
 
317
 
 
318
<DT><SAMP>`-comment string'</SAMP>
 
319
<DD>
 
320
set the comment
 
321
 
 
322
<DT><SAMP>`-hq'</SAMP>
 
323
<DD>
 
324
activate high quality settings
 
325
 
 
326
</DL>
 
327
 
 
328
 
 
329
 
 
330
<H2><A NAME="SEC8" HREF="ffmpeg-doc.html#TOC8">3.3 Video Options</A></H2>
 
331
 
 
332
<DL COMPACT>
 
333
 
 
334
<DT><SAMP>`-b bitrate'</SAMP>
 
335
<DD>
 
336
set the video bitrate in kbit/s (default = 200 kb/s)
 
337
<DT><SAMP>`-r fps'</SAMP>
 
338
<DD>
 
339
set frame rate (default = 25)
 
340
<DT><SAMP>`-s size'</SAMP>
 
341
<DD>
 
342
set frame size. The format is <SAMP>`WxH'</SAMP> (default 160x128).  The
 
343
following abbreviations are recognized:
 
344
<DL COMPACT>
 
345
 
 
346
<DT><SAMP>`sqcif'</SAMP>
 
347
<DD>
 
348
128x96
 
349
<DT><SAMP>`qcif'</SAMP>
 
350
<DD>
 
351
176x144
 
352
<DT><SAMP>`cif'</SAMP>
 
353
<DD>
 
354
352x288
 
355
<DT><SAMP>`4cif'</SAMP>
 
356
<DD>
 
357
704x576
 
358
</DL>
 
359
 
 
360
<DT><SAMP>`-aspect aspect'</SAMP>
 
361
<DD>
 
362
set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
 
363
<DT><SAMP>`-croptop size'</SAMP>
 
364
<DD>
 
365
set top crop band size (in pixels)
 
366
<DT><SAMP>`-cropbottom size'</SAMP>
 
367
<DD>
 
368
set bottom crop band size (in pixels)
 
369
<DT><SAMP>`-cropleft size'</SAMP>
 
370
<DD>
 
371
set left crop band size (in pixels)
 
372
<DT><SAMP>`-cropright size'</SAMP>
 
373
<DD>
 
374
set right crop band size (in pixels)
 
375
<DT><SAMP>`-vn'</SAMP>
 
376
<DD>
 
377
disable video recording
 
378
<DT><SAMP>`-bt tolerance'</SAMP>
 
379
<DD>
 
380
set video bitrate tolerance (in kbit/s)
 
381
<DT><SAMP>`-maxrate bitrate'</SAMP>
 
382
<DD>
 
383
set max video bitrate tolerance (in kbit/s)
 
384
<DT><SAMP>`-minrate bitrate'</SAMP>
 
385
<DD>
 
386
set min video bitrate tolerance (in kbit/s)
 
387
<DT><SAMP>`-bufsize size'</SAMP>
 
388
<DD>
 
389
set ratecontrol buffere size (in kbit)
 
390
<DT><SAMP>`-vcodec codec'</SAMP>
 
391
<DD>
 
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>
 
395
<DD>
 
396
use same video quality as source (implies VBR)
 
397
 
 
398
<DT><SAMP>`-pass n'</SAMP>
 
399
<DD>
 
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
 
403
pass.
 
404
 
 
405
<DT><SAMP>`-passlogfile file'</SAMP>
 
406
<DD>
 
407
select two pass log file name to <VAR>file</VAR>.
 
408
 
 
409
</DL>
 
410
 
 
411
 
 
412
 
 
413
<H2><A NAME="SEC9" HREF="ffmpeg-doc.html#TOC9">3.4 Advanced Video Options</A></H2>
 
414
 
 
415
<DL COMPACT>
 
416
 
 
417
<DT><SAMP>`-g gop_size'</SAMP>
 
418
<DD>
 
419
set the group of picture size
 
420
<DT><SAMP>`-intra'</SAMP>
 
421
<DD>
 
422
use only intra frames
 
423
<DT><SAMP>`-qscale q'</SAMP>
 
424
<DD>
 
425
use fixed video quantiser scale (VBR)
 
426
<DT><SAMP>`-qmin q'</SAMP>
 
427
<DD>
 
428
min video quantiser scale (VBR)
 
429
<DT><SAMP>`-qmax q'</SAMP>
 
430
<DD>
 
431
max video quantiser scale (VBR)
 
432
<DT><SAMP>`-qdiff q'</SAMP>
 
433
<DD>
 
434
max difference between the quantiser scale (VBR)
 
435
<DT><SAMP>`-qblur blur'</SAMP>
 
436
<DD>
 
437
video quantiser scale blur (VBR)
 
438
<DT><SAMP>`-qcomp compression'</SAMP>
 
439
<DD>
 
440
video quantiser scale compression (VBR)
 
441
 
 
442
<DT><SAMP>`-rc_init_cplx complexity'</SAMP>
 
443
<DD>
 
444
initial complexity for 1-pass encoding
 
445
<DT><SAMP>`-b_qfactor factor'</SAMP>
 
446
<DD>
 
447
qp factor between p and b frames
 
448
<DT><SAMP>`-i_qfactor factor'</SAMP>
 
449
<DD>
 
450
qp factor between p and i frames
 
451
<DT><SAMP>`-b_qoffset offset'</SAMP>
 
452
<DD>
 
453
qp offset between p and b frames
 
454
<DT><SAMP>`-i_qoffset offset'</SAMP>
 
455
<DD>
 
456
qp offset between p and i frames
 
457
<DT><SAMP>`-rc_eq equation'</SAMP>
 
458
<DD>
 
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>
 
461
<DD>
 
462
rate control override for specific intervals
 
463
<DT><SAMP>`-me method'</SAMP>
 
464
<DD>
 
465
set motion estimation method to <VAR>method</VAR>. Available methods are
 
466
(from lower to best quality):
 
467
<DL COMPACT>
 
468
 
 
469
<DT><SAMP>`zero'</SAMP>
 
470
<DD>
 
471
Try just the (0, 0) vector.
 
472
<DT><SAMP>`phods'</SAMP>
 
473
<DD>
 
474
<DT><SAMP>`log'</SAMP>
 
475
<DD>
 
476
<DT><SAMP>`x1'</SAMP>
 
477
<DD>
 
478
<DT><SAMP>`epzs'</SAMP>
 
479
<DD>
 
480
(default method)
 
481
<DT><SAMP>`full'</SAMP>
 
482
<DD>
 
483
exhaustive search (slow and marginally better than epzs)
 
484
</DL>
 
485
 
 
486
<DT><SAMP>`-dct_algo algo'</SAMP>
 
487
<DD>
 
488
set dct algorithm to <VAR>algo</VAR>. Available values are:
 
489
<DL COMPACT>
 
490
 
 
491
<DT><SAMP>`0'</SAMP>
 
492
<DD>
 
493
FF_DCT_AUTO (default)
 
494
<DT><SAMP>`1'</SAMP>
 
495
<DD>
 
496
FF_DCT_FASTINT
 
497
<DT><SAMP>`2'</SAMP>
 
498
<DD>
 
499
FF_DCT_INT
 
500
<DT><SAMP>`3'</SAMP>
 
501
<DD>
 
502
FF_DCT_MMX
 
503
<DT><SAMP>`4'</SAMP>
 
504
<DD>
 
505
FF_DCT_MLIB
 
506
<DT><SAMP>`5'</SAMP>
 
507
<DD>
 
508
FF_DCT_ALTIVEC
 
509
</DL>
 
510
 
 
511
<DT><SAMP>`-idct_algo algo'</SAMP>
 
512
<DD>
 
513
set idct algorithm to <VAR>algo</VAR>. Available values are:
 
514
<DL COMPACT>
 
515
 
 
516
<DT><SAMP>`0'</SAMP>
 
517
<DD>
 
518
FF_IDCT_AUTO (default)
 
519
<DT><SAMP>`1'</SAMP>
 
520
<DD>
 
521
FF_IDCT_INT          
 
522
<DT><SAMP>`2'</SAMP>
 
523
<DD>
 
524
FF_IDCT_SIMPLE       
 
525
<DT><SAMP>`3'</SAMP>
 
526
<DD>
 
527
FF_IDCT_SIMPLEMMX    
 
528
<DT><SAMP>`4'</SAMP>
 
529
<DD>
 
530
FF_IDCT_LIBMPEG2MMX  
 
531
<DT><SAMP>`5'</SAMP>
 
532
<DD>
 
533
FF_IDCT_PS2          
 
534
<DT><SAMP>`6'</SAMP>
 
535
<DD>
 
536
FF_IDCT_MLIB         
 
537
<DT><SAMP>`7'</SAMP>
 
538
<DD>
 
539
FF_IDCT_ARM          
 
540
<DT><SAMP>`8'</SAMP>
 
541
<DD>
 
542
FF_IDCT_ALTIVEC      
 
543
<DT><SAMP>`9'</SAMP>
 
544
<DD>
 
545
FF_IDCT_SH4          
 
546
<DT><SAMP>`10'</SAMP>
 
547
<DD>
 
548
FF_IDCT_SIMPLEARM    
 
549
</DL>
 
550
 
 
551
<DT><SAMP>`-er n'</SAMP>
 
552
<DD>
 
553
set error resilience to <VAR>n</VAR>.
 
554
<DL COMPACT>
 
555
 
 
556
<DT><SAMP>`1'</SAMP>
 
557
<DD>
 
558
FF_ER_CAREFULL (default)
 
559
<DT><SAMP>`2'</SAMP>
 
560
<DD>
 
561
FF_ER_COMPLIANT
 
562
<DT><SAMP>`3'</SAMP>
 
563
<DD>
 
564
FF_ER_AGGRESSIVE
 
565
<DT><SAMP>`4'</SAMP>
 
566
<DD>
 
567
FF_ER_VERY_AGGRESSIVE
 
568
</DL>
 
569
 
 
570
<DT><SAMP>`-ec bit_mask'</SAMP>
 
571
<DD>
 
572
set error concealment to <VAR>bit_mask</VAR>. <VAR>bit_mask</VAR> is a bit mask of
 
573
the following values:
 
574
<DL COMPACT>
 
575
 
 
576
<DT><SAMP>`1'</SAMP>
 
577
<DD>
 
578
FF_EC_GUESS_MVS (default=enabled)
 
579
<DT><SAMP>`2'</SAMP>
 
580
<DD>
 
581
FF_EC_DEBLOCK (default=enabled)
 
582
</DL>
 
583
 
 
584
<DT><SAMP>`-bf frames'</SAMP>
 
585
<DD>
 
586
use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)
 
587
<DT><SAMP>`-mbd mode'</SAMP>
 
588
<DD>
 
589
macroblock decision
 
590
<DL COMPACT>
 
591
 
 
592
<DT><SAMP>`0'</SAMP>
 
593
<DD>
 
594
FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in ffmpeg)
 
595
<DT><SAMP>`1'</SAMP>
 
596
<DD>
 
597
FF_MB_DECISION_BITS: chooses the one which needs the fewest bits
 
598
<DT><SAMP>`2'</SAMP>
 
599
<DD>
 
600
FF_MB_DECISION_RD: rate distoration
 
601
</DL>
 
602
 
 
603
<DT><SAMP>`-4mv'</SAMP>
 
604
<DD>
 
605
use four motion vector by macroblock (only MPEG-4)
 
606
<DT><SAMP>`-part'</SAMP>
 
607
<DD>
 
608
use data partitioning (only MPEG-4)
 
609
<DT><SAMP>`-bug param'</SAMP>
 
610
<DD>
 
611
workaround not auto detected encoder bugs
 
612
<DT><SAMP>`-strict strictness'</SAMP>
 
613
<DD>
 
614
how strictly to follow the standarts
 
615
<DT><SAMP>`-aic'</SAMP>
 
616
<DD>
 
617
enable Advanced intra coding (h263+)
 
618
<DT><SAMP>`-umv'</SAMP>
 
619
<DD>
 
620
enable Unlimited Motion Vector (h263+)
 
621
 
 
622
<DT><SAMP>`-deinterlace'</SAMP>
 
623
<DD>
 
624
deinterlace pictures
 
625
<DT><SAMP>`-psnr'</SAMP>
 
626
<DD>
 
627
calculate PSNR of compressed frames
 
628
<DT><SAMP>`-vstats'</SAMP>
 
629
<DD>
 
630
dump video coding statistics to <TT>`vstats_HHMMSS.log'</TT>.
 
631
<DT><SAMP>`-vhook module'</SAMP>
 
632
<DD>
 
633
insert video processing <VAR>module</VAR>. <VAR>module</VAR> contains the module
 
634
name and its parameters separated by spaces.
 
635
</DL>
 
636
 
 
637
 
 
638
 
 
639
<H2><A NAME="SEC10" HREF="ffmpeg-doc.html#TOC10">3.5 Audio Options</A></H2>
 
640
 
 
641
<DL COMPACT>
 
642
 
 
643
<DT><SAMP>`-ab bitrate'</SAMP>
 
644
<DD>
 
645
set audio bitrate (in kbit/s)
 
646
<DT><SAMP>`-ar freq'</SAMP>
 
647
<DD>
 
648
set the audio sampling freq (default = 44100 Hz)
 
649
<DT><SAMP>`-ab bitrate'</SAMP>
 
650
<DD>
 
651
set the audio bitrate in kbit/s (default = 64)
 
652
<DT><SAMP>`-ac channels'</SAMP>
 
653
<DD>
 
654
set the number of audio channels (default = 1)
 
655
<DT><SAMP>`-an'</SAMP>
 
656
<DD>
 
657
disable audio recording
 
658
<DT><SAMP>`-acodec codec'</SAMP>
 
659
<DD>
 
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.
 
662
</DL>
 
663
 
 
664
 
 
665
 
 
666
<H2><A NAME="SEC11" HREF="ffmpeg-doc.html#TOC11">3.6 Audio/Video grab options</A></H2>
 
667
 
 
668
<DL COMPACT>
 
669
 
 
670
<DT><SAMP>`-vd device'</SAMP>
 
671
<DD>
 
672
set video grab device (e.g. <TT>`/dev/video0'</TT>)
 
673
<DT><SAMP>`-vc channel'</SAMP>
 
674
<DD>
 
675
set video grab channel (DV1394 only)
 
676
<DT><SAMP>`-tvstd standard'</SAMP>
 
677
<DD>
 
678
set television standard (NTSC, PAL (SECAM))
 
679
<DT><SAMP>`-dv1394'</SAMP>
 
680
<DD>
 
681
set DV1394 grab
 
682
<DT><SAMP>`-ad device'</SAMP>
 
683
<DD>
 
684
set audio device (e.g. <TT>`/dev/dsp'</TT>)
 
685
</DL>
 
686
 
 
687
 
 
688
 
 
689
<H2><A NAME="SEC12" HREF="ffmpeg-doc.html#TOC12">3.7 Advanced options</A></H2>
 
690
 
 
691
<DL COMPACT>
 
692
 
 
693
<DT><SAMP>`-map file:stream'</SAMP>
 
694
<DD>
 
695
set input stream mapping
 
696
<DT><SAMP>`-debug'</SAMP>
 
697
<DD>
 
698
print specific debug info
 
699
<DT><SAMP>`-benchmark'</SAMP>
 
700
<DD>
 
701
add timings for benchmarking
 
702
<DT><SAMP>`-hex'</SAMP>
 
703
<DD>
 
704
dump each input packet
 
705
<DT><SAMP>`-bitexact'</SAMP>
 
706
<DD>
 
707
only use bit exact algorithms (for codec testing)
 
708
<DT><SAMP>`-ps size'</SAMP>
 
709
<DD>
 
710
set packet size in bits
 
711
<DT><SAMP>`-re'</SAMP>
 
712
<DD>
 
713
read input at native frame rate. Mainly used to simulate a grab device.
 
714
<DT><SAMP>`-loop'</SAMP>
 
715
<DD>
 
716
loop over the input stream. Currently it works only for image
 
717
streams. This option is used for ffserver automatic testing.
 
718
</DL>
 
719
 
 
720
 
 
721
 
 
722
<H2><A NAME="SEC13" HREF="ffmpeg-doc.html#TOC13">3.8 FFmpeg formula evaluator</A></H2>
 
723
 
 
724
<P>
 
725
When evaluating a rate control string, FFmpeg uses an internal formula
 
726
evaluator. 
 
727
 
 
728
 
 
729
<P>
 
730
The following binary operators are available: <CODE>+</CODE>, <CODE>-</CODE>,
 
731
<CODE>*</CODE>, <CODE>/</CODE>, <CODE>^</CODE>.
 
732
 
 
733
 
 
734
<P>
 
735
The following unary operators are available: <CODE>+</CODE>, <CODE>-</CODE>,
 
736
<CODE>(...)</CODE>.
 
737
 
 
738
 
 
739
<P>
 
740
The following functions are available:
 
741
<DL COMPACT>
 
742
 
 
743
<DT><VAR>sinh(x)</VAR>
 
744
<DD>
 
745
<DT><VAR>cosh(x)</VAR>
 
746
<DD>
 
747
<DT><VAR>tanh(x)</VAR>
 
748
<DD>
 
749
<DT><VAR>sin(x)</VAR>
 
750
<DD>
 
751
<DT><VAR>cos(x)</VAR>
 
752
<DD>
 
753
<DT><VAR>tan(x)</VAR>
 
754
<DD>
 
755
<DT><VAR>exp(x)</VAR>
 
756
<DD>
 
757
<DT><VAR>log(x)</VAR>
 
758
<DD>
 
759
<DT><VAR>squish(x)</VAR>
 
760
<DD>
 
761
<DT><VAR>gauss(x)</VAR>
 
762
<DD>
 
763
<DT><VAR>abs(x)</VAR>
 
764
<DD>
 
765
<DT><VAR>max(x, y)</VAR>
 
766
<DD>
 
767
<DT><VAR>min(x, y)</VAR>
 
768
<DD>
 
769
<DT><VAR>gt(x, y)</VAR>
 
770
<DD>
 
771
<DT><VAR>lt(x, y)</VAR>
 
772
<DD>
 
773
<DT><VAR>eq(x, y)</VAR>
 
774
<DD>
 
775
<DT><VAR>bits2qp(bits)</VAR>
 
776
<DD>
 
777
<DT><VAR>qp2bits(qp)</VAR>
 
778
<DD>
 
779
</DL>
 
780
 
 
781
<P>
 
782
The following constants are available:
 
783
<DL COMPACT>
 
784
 
 
785
<DT><VAR>PI</VAR>
 
786
<DD>
 
787
<DT><VAR>E</VAR>
 
788
<DD>
 
789
<DT><VAR>iTex</VAR>
 
790
<DD>
 
791
<DT><VAR>pTex</VAR>
 
792
<DD>
 
793
<DT><VAR>tex</VAR>
 
794
<DD>
 
795
<DT><VAR>mv</VAR>
 
796
<DD>
 
797
<DT><VAR>fCode</VAR>
 
798
<DD>
 
799
<DT><VAR>iCount</VAR>
 
800
<DD>
 
801
<DT><VAR>mcVar</VAR>
 
802
<DD>
 
803
<DT><VAR>var</VAR>
 
804
<DD>
 
805
<DT><VAR>isI</VAR>
 
806
<DD>
 
807
<DT><VAR>isP</VAR>
 
808
<DD>
 
809
<DT><VAR>isB</VAR>
 
810
<DD>
 
811
<DT><VAR>avgQP</VAR>
 
812
<DD>
 
813
<DT><VAR>qComp</VAR>
 
814
<DD>
 
815
<DT><VAR>avgIITex</VAR>
 
816
<DD>
 
817
<DT><VAR>avgPITex</VAR>
 
818
<DD>
 
819
<DT><VAR>avgPPTex</VAR>
 
820
<DD>
 
821
<DT><VAR>avgBPTex</VAR>
 
822
<DD>
 
823
<DT><VAR>avgTex</VAR>
 
824
<DD>
 
825
</DL>
 
826
 
 
827
 
 
828
 
 
829
<H2><A NAME="SEC14" HREF="ffmpeg-doc.html#TOC14">3.9 Protocols</A></H2>
 
830
 
 
831
<P>
 
832
The filename can be <TT>`-'</TT> to read from the standard input or to write
 
833
to the standard output.
 
834
 
 
835
 
 
836
<P>
 
837
ffmpeg handles also many protocols specified with the URL syntax.
 
838
 
 
839
 
 
840
<P>
 
841
Use 'ffmpeg -formats' to have a list of the supported protocols.
 
842
 
 
843
 
 
844
<P>
 
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 :-)
 
848
 
 
849
 
 
850
 
 
851
 
 
852
<H1><A NAME="SEC15" HREF="ffmpeg-doc.html#TOC15">4. Tips</A></H1>
 
853
 
 
854
 
 
855
<UL>
 
856
<LI>For streaming at very low bit rate application, use a low frame rate
 
857
 
 
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:
 
861
 
 
862
 
 
863
<PRE>
 
864
ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
 
865
</PRE>
 
866
 
 
867
<LI>The parameter 'q' which is displayed while encoding is the current
 
868
 
 
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.
 
874
 
 
875
<LI>If your computer is not fast enough, you can speed up the
 
876
 
 
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).
 
881
 
 
882
<LI>To have very low bitrates in audio, reduce the sampling frequency
 
883
 
 
884
(down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
 
885
 
 
886
<LI>To have a constant quality (but a variable bitrate), use the option
 
887
 
 
888
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
 
889
quality).
 
890
 
 
891
<LI>When converting video files, you can use the '-sameq' option which
 
892
 
 
893
uses in the encoder the same quality factor than in the decoder. It
 
894
allows to be almost lossless in encoding.
 
895
 
 
896
</UL>
 
897
 
 
898
 
 
899
 
 
900
<H1><A NAME="SEC16" HREF="ffmpeg-doc.html#TOC16">5. Supported File Formats and Codecs</A></H1>
 
901
 
 
902
<P>
 
903
You can use the <CODE>-formats</CODE> option to have an exhaustive list.
 
904
 
 
905
 
 
906
 
 
907
 
 
908
<H2><A NAME="SEC17" HREF="ffmpeg-doc.html#TOC17">5.1 File Formats</A></H2>
 
909
 
 
910
<P>
 
911
FFmpeg supports the following file formats through the <CODE>libavformat</CODE>
 
912
library:
 
913
 
 
914
 
 
915
<TABLE BORDER>
 
916
 
 
917
<TR><TD>Supported File Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
 
918
 
 
919
</TR>
 
920
<TR><TD>MPEG audio </TD><TD> X </TD><TD> X</TD>
 
921
 
 
922
</TR>
 
923
<TR><TD>MPEG1 systems </TD><TD> X  </TD><TD>  X</TD>
 
924
 
 
925
</TD><TD> muxed audio and video
 
926
</TR>
 
927
<TR><TD>MPEG2 PS </TD><TD> X  </TD><TD>  X</TD>
 
928
 
 
929
</TD><TD> also known as <CODE>VOB</CODE> file
 
930
</TR>
 
931
<TR><TD>MPEG2 TS </TD><TD>    </TD><TD>  X</TD>
 
932
 
 
933
</TD><TD> also known as DVB Transport Stream
 
934
</TR>
 
935
<TR><TD>ASF</TD><TD> X </TD><TD> X</TD>
 
936
 
 
937
</TR>
 
938
<TR><TD>AVI</TD><TD> X </TD><TD> X</TD>
 
939
 
 
940
</TR>
 
941
<TR><TD>WAV</TD><TD> X </TD><TD> X</TD>
 
942
 
 
943
</TR>
 
944
<TR><TD>Macromedia Flash</TD><TD> X </TD><TD> X</TD>
 
945
 
 
946
</TD><TD> Only embedded audio is decoded
 
947
</TR>
 
948
<TR><TD>FLV              </TD><TD>  X </TD><TD> X</TD>
 
949
 
 
950
</TD><TD> Macromedia Flash video files
 
951
</TR>
 
952
<TR><TD>Real Audio and Video </TD><TD> X </TD><TD> X</TD>
 
953
 
 
954
</TR>
 
955
<TR><TD>Raw AC3 </TD><TD> X  </TD><TD>  X</TD>
 
956
 
 
957
</TR>
 
958
<TR><TD>Raw MJPEG </TD><TD> X  </TD><TD>  X</TD>
 
959
 
 
960
</TR>
 
961
<TR><TD>Raw MPEG video </TD><TD> X  </TD><TD>  X</TD>
 
962
 
 
963
</TR>
 
964
<TR><TD>Raw PCM8/16 bits, mulaw/Alaw</TD><TD> X  </TD><TD>  X</TD>
 
965
 
 
966
</TR>
 
967
<TR><TD>SUN AU format </TD><TD> X  </TD><TD>  X</TD>
 
968
 
 
969
</TR>
 
970
<TR><TD>Quicktime        </TD><TD> X </TD><TD>  X</TD>
 
971
 
 
972
</TR>
 
973
<TR><TD>MPEG4            </TD><TD> X </TD><TD>  X</TD>
 
974
 
 
975
</TD><TD> MPEG4 is a variant of Quicktime
 
976
</TR>
 
977
<TR><TD>Raw MPEG4 video  </TD><TD>  X </TD><TD>  X</TD>
 
978
 
 
979
</TR>
 
980
<TR><TD>DV               </TD><TD>  </TD><TD> X</TD>
 
981
 
 
982
</TR>
 
983
<TR><TD>4xm              </TD><TD>    </TD><TD> X</TD>
 
984
 
 
985
</TD><TD> 4X Technologies format, used in some games
 
986
</TR>
 
987
<TR><TD>Playstation STR  </TD><TD>    </TD><TD> X</TD>
 
988
 
 
989
</TR>
 
990
<TR><TD>Id RoQ           </TD><TD>    </TD><TD> X</TD>
 
991
 
 
992
</TD><TD> used in Quake III, Jedi Knight 2, other computer games
 
993
</TR>
 
994
<TR><TD>Interplay MVE    </TD><TD>    </TD><TD> X</TD>
 
995
 
 
996
</TD><TD> format used in various Interplay computer games
 
997
</TR>
 
998
<TR><TD>WC3 Movie        </TD><TD>    </TD><TD> X</TD>
 
999
 
 
1000
</TD><TD> multimedia format used in Origin's Wing Commander III computer game
 
1001
</TR></TABLE>
 
1002
 
 
1003
<P>
 
1004
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
 
1005
 
 
1006
 
 
1007
 
 
1008
 
 
1009
<H2><A NAME="SEC18" HREF="ffmpeg-doc.html#TOC18">5.2 Image Formats</A></H2>
 
1010
 
 
1011
<P>
 
1012
FFmpeg can read and write images for each frame of a video sequence. The
 
1013
following image formats are supported:
 
1014
 
 
1015
 
 
1016
<TABLE BORDER>
 
1017
 
 
1018
<TR><TD>Supported Image Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
 
1019
 
 
1020
</TR>
 
1021
<TR><TD>PGM, PPM     </TD><TD> X </TD><TD> X</TD>
 
1022
 
 
1023
</TR>
 
1024
<TR><TD>PAM          </TD><TD> X </TD><TD> X </TD><TD> PAM is a PNM extension with alpha support</TD>
 
1025
 
 
1026
</TR>
 
1027
<TR><TD>PGMYUV       </TD><TD> X </TD><TD> X </TD><TD> PGM with U and V components in YUV 4:2:0</TD>
 
1028
 
 
1029
</TR>
 
1030
<TR><TD>JPEG         </TD><TD> X </TD><TD> X </TD><TD> Progressive JPEG is not supported</TD>
 
1031
 
 
1032
</TR>
 
1033
<TR><TD>.Y.U.V       </TD><TD> X </TD><TD> X </TD><TD> One raw file per component</TD>
 
1034
 
 
1035
</TR>
 
1036
<TR><TD>Animated GIF </TD><TD> X </TD><TD> X </TD><TD> Only uncompressed GIFs are generated</TD>
 
1037
 
 
1038
</TR>
 
1039
<TR><TD>PNG          </TD><TD> X </TD><TD> X </TD><TD> 2 bit and 4 bit/pixel not supported yet</TD>
 
1040
 
 
1041
</TR></TABLE>
 
1042
 
 
1043
<P>
 
1044
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
 
1045
 
 
1046
 
 
1047
 
 
1048
 
 
1049
<H2><A NAME="SEC19" HREF="ffmpeg-doc.html#TOC19">5.3 Video Codecs</A></H2>
 
1050
 
 
1051
<TABLE BORDER>
 
1052
 
 
1053
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
 
1054
 
 
1055
</TR>
 
1056
<TR><TD>MPEG1 video            </TD><TD>  X  </TD><TD>  X</TD>
 
1057
 
 
1058
</TR>
 
1059
<TR><TD>MPEG2 video            </TD><TD>  X  </TD><TD>  X</TD>
 
1060
 
 
1061
</TR>
 
1062
<TR><TD>MPEG4                  </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as DIVX4/5</TD>
 
1063
 
 
1064
</TR>
 
1065
<TR><TD>MSMPEG4 V1             </TD><TD>  X  </TD><TD>  X</TD>
 
1066
 
 
1067
</TR>
 
1068
<TR><TD>MSMPEG4 V2             </TD><TD>  X  </TD><TD>  X</TD>
 
1069
 
 
1070
</TR>
 
1071
<TR><TD>MSMPEG4 V3             </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as DIVX3</TD>
 
1072
 
 
1073
</TR>
 
1074
<TR><TD>WMV7                   </TD><TD>  X  </TD><TD>  X</TD>
 
1075
 
 
1076
</TR>
 
1077
<TR><TD>WMV8                   </TD><TD>  X  </TD><TD>  X </TD><TD> Not completely working</TD>
 
1078
 
 
1079
</TR>
 
1080
<TR><TD>H263(+)                </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as Real Video 1.0</TD>
 
1081
 
 
1082
</TR>
 
1083
<TR><TD>MJPEG                  </TD><TD>  X  </TD><TD>  X</TD>
 
1084
 
 
1085
</TR>
 
1086
<TR><TD>DV                     </TD><TD>     </TD><TD>  X</TD>
 
1087
 
 
1088
</TR>
 
1089
<TR><TD>Huff YUV               </TD><TD>  X  </TD><TD>  X</TD>
 
1090
 
 
1091
</TR>
 
1092
<TR><TD>Asus v1                </TD><TD>  X  </TD><TD>  X </TD><TD> fourcc: ASV1</TD>
 
1093
 
 
1094
</TR>
 
1095
<TR><TD>Asus v2                </TD><TD>  X  </TD><TD>  X </TD><TD> fourcc: ASV2</TD>
 
1096
 
 
1097
</TR>
 
1098
<TR><TD>Creative YUV           </TD><TD>     </TD><TD>  X </TD><TD> fourcc: CYUV</TD>
 
1099
 
 
1100
</TR>
 
1101
<TR><TD>H.264                  </TD><TD>     </TD><TD>  X</TD>
 
1102
 
 
1103
</TR>
 
1104
<TR><TD>Sorenson Video 1       </TD><TD>     </TD><TD>  X </TD><TD> fourcc: SVQ1</TD>
 
1105
 
 
1106
</TR>
 
1107
<TR><TD>Sorenson Video 3       </TD><TD>     </TD><TD>  X </TD><TD> fourcc: SVQ3</TD>
 
1108
 
 
1109
</TR>
 
1110
<TR><TD>On2 VP3                </TD><TD>     </TD><TD>  X </TD><TD> still experimental</TD>
 
1111
 
 
1112
</TR>
 
1113
<TR><TD>Intel Indeo 3          </TD><TD>     </TD><TD>  X </TD><TD> only works on i386 right now</TD>
 
1114
 
 
1115
</TR>
 
1116
<TR><TD>FLV                    </TD><TD>  X  </TD><TD>  X </TD><TD> Flash H263 variant</TD>
 
1117
 
 
1118
</TR>
 
1119
<TR><TD>ATI VCR1               </TD><TD>     </TD><TD>  X </TD><TD> fourcc: VCR1</TD>
 
1120
 
 
1121
</TR>
 
1122
<TR><TD>Cirrus Logic AccuPak   </TD><TD>     </TD><TD>  X </TD><TD> fourcc: CLJR</TD>
 
1123
 
 
1124
</TR>
 
1125
<TR><TD>4X Video               </TD><TD>     </TD><TD>  X </TD><TD> used in certain computer games</TD>
 
1126
 
 
1127
</TR>
 
1128
<TR><TD>Sony Playstation MDEC  </TD><TD>     </TD><TD>  X</TD>
 
1129
 
 
1130
</TR>
 
1131
<TR><TD>Id RoQ                 </TD><TD>     </TD><TD>  X </TD><TD> used in Quake III, Jedi Knight 2, other computer games</TD>
 
1132
 
 
1133
</TR>
 
1134
<TR><TD>Xan/WC3                </TD><TD>     </TD><TD>  X </TD><TD> used in Wing Commander III .MVE files</TD>
 
1135
 
 
1136
</TR>
 
1137
<TR><TD>Interplay Video        </TD><TD>     </TD><TD>  X </TD><TD> used in Interplay .MVE files</TD>
 
1138
 
 
1139
</TR></TABLE>
 
1140
 
 
1141
<P>
 
1142
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
 
1143
 
 
1144
 
 
1145
<P>
 
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
 
1148
solutions.
 
1149
 
 
1150
 
 
1151
 
 
1152
 
 
1153
<H2><A NAME="SEC20" HREF="ffmpeg-doc.html#TOC20">5.4 Audio Codecs</A></H2>
 
1154
 
 
1155
<TABLE BORDER>
 
1156
 
 
1157
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
 
1158
 
 
1159
</TR>
 
1160
<TR><TD>MPEG audio layer 2     </TD><TD>  IX  </TD><TD>  IX</TD>
 
1161
 
 
1162
</TR>
 
1163
<TR><TD>MPEG audio layer 1/3   </TD><TD> IX   </TD><TD>  IX</TD>
 
1164
 
 
1165
</TD><TD> MP3 encoding is supported through the external library LAME
 
1166
</TR>
 
1167
<TR><TD>AC3                    </TD><TD>  IX  </TD><TD>  X</TD>
 
1168
 
 
1169
</TD><TD> liba52 is used internally for decoding
 
1170
</TR>
 
1171
<TR><TD>Vorbis                 </TD><TD>  X   </TD><TD>  X</TD>
 
1172
 
 
1173
</TD><TD> supported through the external library libvorbis
 
1174
</TR>
 
1175
<TR><TD>WMA V1/V2              </TD><TD>      </TD><TD> X</TD>
 
1176
 
 
1177
</TR>
 
1178
<TR><TD>Microsoft ADPCM        </TD><TD> X    </TD><TD> X</TD>
 
1179
 
 
1180
</TR>
 
1181
<TR><TD>MS IMA ADPCM           </TD><TD> X    </TD><TD> X</TD>
 
1182
 
 
1183
</TR>
 
1184
<TR><TD>QT IMA ADPCM           </TD><TD>      </TD><TD> X</TD>
 
1185
 
 
1186
</TR>
 
1187
<TR><TD>4X IMA ADPCM           </TD><TD>      </TD><TD> X</TD>
 
1188
 
 
1189
</TR>
 
1190
<TR><TD>Duck DK3 IMA ADPCM     </TD><TD>      </TD><TD> X</TD>
 
1191
 
 
1192
</TD><TD> used in some Sega Saturn console games
 
1193
</TR>
 
1194
<TR><TD>Duck DK4 IMA ADPCM     </TD><TD>      </TD><TD> X</TD>
 
1195
 
 
1196
</TD><TD> used in some Sega Saturn console games
 
1197
</TR>
 
1198
<TR><TD>RA144                  </TD><TD>      </TD><TD> X</TD>
 
1199
 
 
1200
</TD><TD> Real 14400 bit/s codec
 
1201
</TR>
 
1202
<TR><TD>RA288                  </TD><TD>      </TD><TD> X</TD>
 
1203
 
 
1204
</TD><TD> Real 28800 bit/s codec
 
1205
</TR>
 
1206
<TR><TD>AMR-NB                 </TD><TD> X    </TD><TD> X</TD>
 
1207
 
 
1208
</TD><TD> supported through an external library
 
1209
</TR>
 
1210
<TR><TD>DV audio               </TD><TD>      </TD><TD> X</TD>
 
1211
 
 
1212
</TR>
 
1213
<TR><TD>Id RoQ DPCM            </TD><TD>      </TD><TD> X</TD>
 
1214
 
 
1215
</TD><TD> used in Quake III, Jedi Knight 2, other computer games
 
1216
</TR>
 
1217
<TR><TD>Interplay MVE DPCM     </TD><TD>      </TD><TD> X</TD>
 
1218
 
 
1219
</TD><TD> used in various Interplay computer games
 
1220
</TR>
 
1221
<TR><TD>Xan DPCM               </TD><TD>      </TD><TD> X</TD>
 
1222
 
 
1223
</TD><TD> used in Origin's Wing Commander IV AVI files
 
1224
</TR></TABLE>
 
1225
 
 
1226
<P>
 
1227
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
 
1228
 
 
1229
 
 
1230
<P>
 
1231
<CODE>I</CODE> means that an integer only version is available too (ensures highest
 
1232
performances on systems without hardware floating point support).
 
1233
 
 
1234
 
 
1235
 
 
1236
 
 
1237
<H1><A NAME="SEC21" HREF="ffmpeg-doc.html#TOC21">6. Platform Specific information</A></H1>
 
1238
 
 
1239
 
 
1240
 
 
1241
<H2><A NAME="SEC22" HREF="ffmpeg-doc.html#TOC22">6.1 Linux</A></H2>
 
1242
 
 
1243
<P>
 
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.
 
1247
 
 
1248
 
 
1249
 
 
1250
 
 
1251
<H2><A NAME="SEC23" HREF="ffmpeg-doc.html#TOC23">6.2 BSD</A></H2>
 
1252
 
 
1253
 
 
1254
 
 
1255
<H2><A NAME="SEC24" HREF="ffmpeg-doc.html#TOC24">6.3 Windows</A></H2>
 
1256
 
 
1257
 
 
1258
 
 
1259
<H3><A NAME="SEC25" HREF="ffmpeg-doc.html#TOC25">6.3.1 Native Windows compilation</A></H3>
 
1260
 
 
1261
 
 
1262
<UL>
 
1263
<LI>Install the current versions of MSYS and MinGW from
 
1264
 
 
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.
 
1267
 
 
1268
<LI>If you want to test the FFmpeg Simple Media Player, also download
 
1269
 
 
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.
 
1276
 
 
1277
<LI>Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
 
1278
 
 
1279
 
 
1280
<LI>Start the MSYS shell (file <TT>`msys.bat'</TT>).
 
1281
 
 
1282
<LI>Change to the FFMPEG directory and follow
 
1283
 
 
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.
 
1288
 
 
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
 
1290
 
 
1291
<TT>`ffplay'</TT>.
 
1292
 
 
1293
</UL>
 
1294
 
 
1295
<P>
 
1296
Notes: 
 
1297
 
 
1298
<UL>
 
1299
 
 
1300
<LI>The target <TT>`make wininstaller'</TT> can be used to create a
 
1301
 
 
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
 
1304
installer.
 
1305
 
 
1306
<LI>By using <CODE>./configure --enable-shared</CODE> when configuring ffmpeg,
 
1307
 
 
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>. 
 
1311
 
 
1312
<LI>Visual C++ compatibility: if you used <CODE>./configure --enable-shared</CODE>
 
1313
 
 
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.
 
1318
 
 
1319
</UL>
 
1320
 
 
1321
 
 
1322
 
 
1323
<H3><A NAME="SEC26" HREF="ffmpeg-doc.html#TOC26">6.3.2 Cross compilation for Windows with Linux</A></H3>
 
1324
 
 
1325
<P>
 
1326
You must use the MinGW cross compilation tools available at
 
1327
<A HREF="http://www.mingw.org/">http://www.mingw.org/</A>.
 
1328
 
 
1329
 
 
1330
<P>
 
1331
Then configure ffmpeg with the following options:
 
1332
 
 
1333
<PRE>
 
1334
./configure --enable-mingw32 --cross-prefix=i386-mingw32msvc-
 
1335
</PRE>
 
1336
 
 
1337
<P>
 
1338
(you can change the cross-prefix according to the prefix choosen for the
 
1339
MinGW tools).
 
1340
 
 
1341
 
 
1342
<P>
 
1343
Then you can easily test ffmpeg with wine
 
1344
(<A HREF="http://www.winehq.com/">http://www.winehq.com/</A>).
 
1345
 
 
1346
 
 
1347
 
 
1348
 
 
1349
<H2><A NAME="SEC27" HREF="ffmpeg-doc.html#TOC27">6.4 MacOS X</A></H2>
 
1350
 
 
1351
 
 
1352
 
 
1353
<H2><A NAME="SEC28" HREF="ffmpeg-doc.html#TOC28">6.5 BeOS</A></H2>
 
1354
 
 
1355
<P>
 
1356
The configure script should guess the configuration itself.
 
1357
Networking support is currently not finished.
 
1358
errno issues fixed by Andrew Bachmann.
 
1359
 
 
1360
 
 
1361
<P>
 
1362
Old stuff:
 
1363
 
 
1364
 
 
1365
<P>
 
1366
Fran�ois Revol - revol at free dot fr - April 2002
 
1367
 
 
1368
 
 
1369
<P>
 
1370
The configure script should guess the configuration itself, 
 
1371
however I still didn't tested building on net_server version of BeOS.
 
1372
 
 
1373
 
 
1374
<P>
 
1375
ffserver is broken (needs poll() implementation).
 
1376
 
 
1377
 
 
1378
<P>
 
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.
 
1382
(To be fixed)
 
1383
 
 
1384
 
 
1385
 
 
1386
 
 
1387
<H1><A NAME="SEC29" HREF="ffmpeg-doc.html#TOC29">7. Developers Guide</A></H1>
 
1388
 
 
1389
 
 
1390
 
 
1391
<H2><A NAME="SEC30" HREF="ffmpeg-doc.html#TOC30">7.1 API</A></H2>
 
1392
 
 
1393
<UL>
 
1394
<LI>libavcodec is the library containing the codecs (both encoding and
 
1395
 
 
1396
  decoding). See <TT>`libavcodec/apiexample.c'</TT> to see how to use it.
 
1397
 
 
1398
<LI>libavformat is the library containing the file formats handling (mux and
 
1399
 
 
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
 
1402
streams.
 
1403
 
 
1404
</UL>
 
1405
 
 
1406
 
 
1407
 
 
1408
<H2><A NAME="SEC31" HREF="ffmpeg-doc.html#TOC31">7.2 Integrating libavcodec or libavformat in your program</A></H2>
 
1409
 
 
1410
<P>
 
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.
 
1415
 
 
1416
 
 
1417
<P>
 
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.
 
1421
 
 
1422
 
 
1423
 
 
1424
 
 
1425
<H2><A NAME="SEC32" HREF="ffmpeg-doc.html#TOC32">7.3 Coding Rules</A></H2>
 
1426
 
 
1427
<P>
 
1428
ffmpeg is programmed in ANSI C language. GCC extensions are
 
1429
tolerated. Indent size is 4. The TAB character should not be used.
 
1430
 
 
1431
 
 
1432
<P>
 
1433
The presentation is the one specified by 'indent -i4 -kr'.
 
1434
 
 
1435
 
 
1436
<P>
 
1437
Main priority in ffmpeg is simplicity and small code size (=less
 
1438
bugs).
 
1439
 
 
1440
 
 
1441
<P>
 
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.
 
1445
 
 
1446
 
 
1447
 
 
1448
 
 
1449
<H2><A NAME="SEC33" HREF="ffmpeg-doc.html#TOC33">7.4 Submitting patches</A></H2>
 
1450
 
 
1451
<P>
 
1452
When you submit your patch, try to send a unified diff (diff '-u'
 
1453
option). I cannot read other diffs :-)
 
1454
 
 
1455
 
 
1456
<P>
 
1457
Run the regression tests before submitting a patch so that you can
 
1458
verify that there are no big problems.
 
1459
 
 
1460
 
 
1461
<P>
 
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>
 
1466
 
 
1467
 
 
1468
 
 
1469
 
 
1470
<H2><A NAME="SEC34" HREF="ffmpeg-doc.html#TOC34">7.5 Regression tests</A></H2>
 
1471
 
 
1472
<P>
 
1473
Before submitting a patch (or committing with CVS), you should at least
 
1474
test that you did not break anything.
 
1475
 
 
1476
 
 
1477
<P>
 
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
 
1482
the result file.
 
1483
 
 
1484
 
 
1485
<P>
 
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
 
1488
as well.
 
1489
 
 
1490
 
 
1491
<P>
 
1492
Run 'make test' to test all the codecs.
 
1493
 
 
1494
 
 
1495
<P>
 
1496
Run 'make fulltest' to test all the codecs, formats and ffserver.
 
1497
 
 
1498
 
 
1499
<P>
 
1500
[Of course, some patches may change the regression tests results. In
 
1501
this case, the regression tests reference results shall be modified
 
1502
accordingly].
 
1503
 
 
1504
 
 
1505
<P><HR><P>
 
1506
This document was generated on 16 September 2003 using
 
1507
<A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A>&nbsp;1.56k.
 
1508
</BODY>
 
1509
</HTML>