Statistics
| Branch: | Revision:

ffmpeg / doc / ffmpeg-doc.html @ 47d944d2

History | View | Annotate | Download (20.9 KB)

1
<HTML>
2
<HEAD>
3
<!-- Created by texi2html 1.56k from ffmpeg-doc.texi on 19 November 2002 -->
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 convertion</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 Audio Options</A>
25
<LI><A NAME="TOC10" HREF="ffmpeg-doc.html#SEC10">3.5 Advanced options</A>
26
<LI><A NAME="TOC11" HREF="ffmpeg-doc.html#SEC11">3.6 Protocols</A>
27
</UL>
28
<LI><A NAME="TOC12" HREF="ffmpeg-doc.html#SEC12">4. Tips</A>
29
<LI><A NAME="TOC13" HREF="ffmpeg-doc.html#SEC13">5. Supported File Formats and Codecs</A>
30
<UL>
31
<LI><A NAME="TOC14" HREF="ffmpeg-doc.html#SEC14">5.1 File Formats</A>
32
<LI><A NAME="TOC15" HREF="ffmpeg-doc.html#SEC15">5.2 Video Codecs</A>
33
<LI><A NAME="TOC16" HREF="ffmpeg-doc.html#SEC16">5.3 Audio Codecs</A>
34
</UL>
35
<LI><A NAME="TOC17" HREF="ffmpeg-doc.html#SEC17">6. Platform Specific information</A>
36
<UL>
37
<LI><A NAME="TOC18" HREF="ffmpeg-doc.html#SEC18">6.1 Linux</A>
38
<LI><A NAME="TOC19" HREF="ffmpeg-doc.html#SEC19">6.2 BSD</A>
39
<LI><A NAME="TOC20" HREF="ffmpeg-doc.html#SEC20">6.3 Windows</A>
40
<LI><A NAME="TOC21" HREF="ffmpeg-doc.html#SEC21">6.4 MacOS X</A>
41
<LI><A NAME="TOC22" HREF="ffmpeg-doc.html#SEC22">6.5 BeOS</A>
42
</UL>
43
<LI><A NAME="TOC23" HREF="ffmpeg-doc.html#SEC23">7. Developpers Guide</A>
44
<UL>
45
<LI><A NAME="TOC24" HREF="ffmpeg-doc.html#SEC24">7.1 API</A>
46
<LI><A NAME="TOC25" HREF="ffmpeg-doc.html#SEC25">7.2 Integrating libavcodec or libavformat in your program</A>
47
<LI><A NAME="TOC26" HREF="ffmpeg-doc.html#SEC26">7.3 Coding Rules</A>
48
<LI><A NAME="TOC27" HREF="ffmpeg-doc.html#SEC27">7.4 Submitting patches</A>
49
<LI><A NAME="TOC28" HREF="ffmpeg-doc.html#SEC28">7.5 Regression tests</A>
50
</UL>
51
</UL>
52
<P><HR><P>
53

    
54
<P>
55
FFmpeg Documentation
56

    
57

    
58

    
59

    
60
<H1><A NAME="SEC1" HREF="ffmpeg-doc.html#TOC1">1. Introduction</A></H1>
61

    
62
<P>
63
FFmpeg is a very fast video and audio converter. It can also grab from
64
a live audio/video source.
65
  
66
The command line interface is designed to be intuitive, in the sense
67
that ffmpeg tries to figure out all the parameters, when
68
possible. You have usually to give only the target bitrate you want.
69

    
70

    
71
<P>
72
FFmpeg can also convert from any sample rate to any other, and resize
73
video on the fly with a high quality polyphase filter.
74

    
75

    
76

    
77

    
78
<H1><A NAME="SEC2" HREF="ffmpeg-doc.html#TOC2">2. Quick Start</A></H1>
79

    
80

    
81

    
82
<H2><A NAME="SEC3" HREF="ffmpeg-doc.html#TOC3">2.1 Video and Audio grabbing</A></H2>
83

    
84
<P>
85
 FFmpeg can use a video4linux compatible video source and any Open Sound
86
  System audio source:
87

    
88
<PRE>
89
  ffmpeg /tmp/out.mpg 
90
</PRE>
91

    
92
<P>
93
  Note that you must activate the right video source and channel
94
  before launching ffmpeg. You can use any TV viewer such as xawtv by
95
  Gerd Knorr which I find very good. You must also set correctly the
96
  audio recording levels with a standard mixer.
97

    
98

    
99

    
100

    
101
<H2><A NAME="SEC4" HREF="ffmpeg-doc.html#TOC4">2.2 Video and Audio file format convertion</A></H2>
102

    
103
<P>
104
* ffmpeg can use any supported file format and protocol as input: 
105

    
106

    
107
<P>
108
Examples:
109

    
110

    
111
<P>
112
* You can input from YUV files:
113

    
114

    
115

    
116
<PRE>
117
  ffmpeg -i /tmp/test%d.Y /tmp/out.mpg 
118
</PRE>
119

    
120
<P>
121
  It will use the files: 
122

    
123
<PRE>
124
       /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
125
       /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
126
</PRE>
127

    
128
<P>
129
  The Y files use twice the resolution of the U and V files. They are
130
  raw files, without header. They can be generated by all decent video
131
  decoders. You must specify the size of the image with the '-s' option
132
  if ffmpeg cannot guess it.
133

    
134

    
135
<P>
136
* You can input from a RAW YUV420P file:
137

    
138

    
139

    
140
<PRE>
141
  ffmpeg -i /tmp/test.yuv /tmp/out.avi
142
</PRE>
143

    
144
<P>
145
  The RAW YUV420P is a file containing RAW YUV planar, for each frame first
146
  come the Y plane followed by U and V planes, which are half vertical and
147
  horizontal resolution.
148

    
149

    
150
<P>
151
* You can output to a RAW YUV420P file:
152

    
153

    
154

    
155
<PRE>
156
  ffmpeg -i mydivx.avi -o hugefile.yuv
157
</PRE>
158

    
159
<P>
160
* You can set several input files and output files:
161

    
162

    
163

    
164
<PRE>
165
  ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
166
</PRE>
167

    
168
<P>
169
  Convert the audio file a.wav and the raw yuv video file a.yuv
170
  to mpeg file a.mpg
171

    
172

    
173
<P>
174
* You can also do audio and video convertions at the same time:
175

    
176

    
177

    
178
<PRE>
179
  ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
180
</PRE>
181

    
182
<P>
183
  Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
184

    
185

    
186
<P>
187
* You can encode to several formats at the same time and define a
188
  mapping from input stream to output streams:
189

    
190

    
191

    
192
<PRE>
193
  ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
194
</PRE>
195

    
196
<P>
197
  Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
198
  file:index' specify which input stream is used for each output
199
  stream, in the order of the definition of output streams.
200

    
201

    
202
<P>
203
* You can transcode decrypted VOBs
204

    
205

    
206

    
207
<PRE>
208
  ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
209
</PRE>
210

    
211
<P>
212
  This is a typicall DVD ripper example, input from a VOB file, output
213
  to an AVI file with MPEG-4 video and MP3 audio, note that in this
214
  command we use B frames so the MPEG-4 stream is DivX5 compatible, GOP
215
  size is 300 that means an INTRA frame every 10 seconds for 29.97 fps
216
  input video.  Also the audio stream is MP3 encoded so you need LAME
217
  support which is enabled using <CODE>--enable-mp3lame</CODE> when
218
  configuring.  The mapping is particullary usefull for DVD transcoding
219
  to get the desired audio language.
220

    
221

    
222
<P>
223
  NOTE: to see the supported input formats, use <CODE>ffmpeg -formats</CODE>.
224

    
225

    
226

    
227

    
228
<H1><A NAME="SEC5" HREF="ffmpeg-doc.html#TOC5">3. Invocation</A></H1>
229

    
230

    
231

    
232
<H2><A NAME="SEC6" HREF="ffmpeg-doc.html#TOC6">3.1 Syntax</A></H2>
233

    
234
<P>
235
 The generic syntax is:
236

    
237

    
238

    
239
<PRE>
240
  ffmpeg [[options][-i input_file]]... {[options] output_file}...
241
</PRE>
242

    
243
<P>
244
  If no input file is given, audio/video grabbing is done.
245

    
246

    
247
<P>
248
  As a general rule, options are applied to the next specified
249
  file. For example, if you give the '-b 64' option, it sets the video
250
  bitrate of the next file. Format option may be needed for raw input
251
  files.
252

    
253

    
254
<P>
255
  By default, ffmpeg tries to convert as losslessly as possible: it
256
  uses the same audio and video parameter fors the outputs as the one
257
  specified for the inputs.
258

    
259

    
260

    
261

    
262
<H2><A NAME="SEC7" HREF="ffmpeg-doc.html#TOC7">3.2 Main options</A></H2>
263

    
264
<DL COMPACT>
265

    
266
<DT><SAMP>`-L'</SAMP>
267
<DD>
268
show license
269
<DT><SAMP>`-h'</SAMP>
270
<DD>
271
                  show help
272
<DT><SAMP>`-formats'</SAMP>
273
<DD>
274
show available formats, codecs, protocols, ...
275
<DT><SAMP>`-f fmt'</SAMP>
276
<DD>
277
force format
278
<DT><SAMP>`-i filename'</SAMP>
279
<DD>
280
input file name
281

    
282
<DT><SAMP>`-y'</SAMP>
283
<DD>
284
overwrite output files
285

    
286
<DT><SAMP>`-t duration'</SAMP>
287
<DD>
288
set the recording time in seconds. <CODE>hh:mm:ss[.xxx]</CODE> syntax is also
289
supported.
290

    
291
<DT><SAMP>`-title string'</SAMP>
292
<DD>
293
set the title
294

    
295
<DT><SAMP>`-author string'</SAMP>
296
<DD>
297
set the author
298

    
299
<DT><SAMP>`-copyright string'</SAMP>
300
<DD>
301
set the copyright
302

    
303
<DT><SAMP>`-comment string'</SAMP>
304
<DD>
305
set the comment
306

    
307
<DT><SAMP>`-b bitrate'</SAMP>
308
<DD>
309
set video bitrate (in kbit/s)
310
</DL>
311

    
312

    
313

    
314
<H2><A NAME="SEC8" HREF="ffmpeg-doc.html#TOC8">3.3 Video Options</A></H2>
315

    
316
<DL COMPACT>
317

    
318
<DT><SAMP>`-s size'</SAMP>
319
<DD>
320
set frame size                       [160x128]
321
<DT><SAMP>`-r fps'</SAMP>
322
<DD>
323
set frame rate                       [25]
324
<DT><SAMP>`-b bitrate'</SAMP>
325
<DD>
326
set the video bitrate in kbit/s      [200]
327
<DT><SAMP>`-vn'</SAMP>
328
<DD>
329
disable video recording              [no]
330
<DT><SAMP>`-bt tolerance'</SAMP>
331
<DD>
332
set video bitrate tolerance (in kbit/s)
333
<DT><SAMP>`-sameq'</SAMP>
334
<DD>
335
use same video quality as source (implies VBR)
336

    
337
<DT><SAMP>`-pass n'</SAMP>
338
<DD>
339
select the pass number (1 or 2). It is useful to do two pass encoding. The statistics of the video are recorded in the first pass and the video at the exact requested bit rate is generated in the second pass.
340

    
341
<DT><SAMP>`-passlogfile file'</SAMP>
342
<DD>
343
select two pass log file name
344

    
345
</DL>
346

    
347

    
348

    
349
<H2><A NAME="SEC9" HREF="ffmpeg-doc.html#TOC9">3.4 Audio Options</A></H2>
350

    
351
<DL COMPACT>
352

    
353
<DT><SAMP>`-ab bitrate'</SAMP>
354
<DD>
355
set audio bitrate (in kbit/s)
356
<DT><SAMP>`-ar freq'</SAMP>
357
<DD>
358
 set the audio sampling freq          [44100]
359
<DT><SAMP>`-ab bitrate'</SAMP>
360
<DD>
361
 set the audio bitrate in kbit/s      [64]
362
<DT><SAMP>`-ac channels'</SAMP>
363
<DD>
364
 set the number of audio channels     [1]
365
<DT><SAMP>`-an'</SAMP>
366
<DD>
367
 disable audio recording              [no]
368
</DL>
369

    
370

    
371

    
372
<H2><A NAME="SEC10" HREF="ffmpeg-doc.html#TOC10">3.5 Advanced options</A></H2>
373

    
374
<DL COMPACT>
375

    
376
<DT><SAMP>`-map file:stream'</SAMP>
377
<DD>
378
set input stream mapping
379
<DT><SAMP>`-g gop_size'</SAMP>
380
<DD>
381
set the group of picture size
382
<DT><SAMP>`-intra'</SAMP>
383
<DD>
384
use only intra frames
385
<DT><SAMP>`-qscale q'</SAMP>
386
<DD>
387
use fixed video quantiser scale (VBR)
388
<DT><SAMP>`-qmin q'</SAMP>
389
<DD>
390
min video quantiser scale (VBR)
391
<DT><SAMP>`-qmax q'</SAMP>
392
<DD>
393
max video quantiser scale (VBR)
394
<DT><SAMP>`-qdiff q'</SAMP>
395
<DD>
396
max difference between the quantiser scale (VBR)
397
<DT><SAMP>`-qblur blur'</SAMP>
398
<DD>
399
video quantiser scale blur (VBR)
400
<DT><SAMP>`-qcomp compression'</SAMP>
401
<DD>
402
video quantiser scale compression (VBR)
403
<DT><SAMP>`-vd device'</SAMP>
404
<DD>
405
set video device
406
<DT><SAMP>`-vcodec codec'</SAMP>
407
<DD>
408
force video codec
409
<DT><SAMP>`-me method'</SAMP>
410
<DD>
411
set motion estimation method
412
<DT><SAMP>`-bf frames'</SAMP>
413
<DD>
414
use 'frames' B frames (only MPEG-4)
415
<DT><SAMP>`-hq'</SAMP>
416
<DD>
417
activate high quality settings
418
<DT><SAMP>`-4mv'</SAMP>
419
<DD>
420
use four motion vector by macroblock (only MPEG-4)
421
<DT><SAMP>`-ad device'</SAMP>
422
<DD>
423
set audio device
424
<DT><SAMP>`-acodec codec'</SAMP>
425
<DD>
426
force audio codec
427
<DT><SAMP>`-deinterlace'</SAMP>
428
<DD>
429
deinterlace pictures
430
<DT><SAMP>`-benchmark'</SAMP>
431
<DD>
432
add timings for benchmarking
433
<DT><SAMP>`-hex'</SAMP>
434
<DD>
435
dump each input packet
436
<DT><SAMP>`-psnr'</SAMP>
437
<DD>
438
calculate PSNR of compressed frames
439
<DT><SAMP>`-vstats'</SAMP>
440
<DD>
441
dump video coding statistics to file
442
</DL>
443

    
444

    
445

    
446
<H2><A NAME="SEC11" HREF="ffmpeg-doc.html#TOC11">3.6 Protocols</A></H2>
447

    
448
<P>
449
The filename can be <TT>`-'</TT> to read from the standard input or to write
450
to the standard output.
451

    
452

    
453
<P>
454
ffmpeg handles also many protocols specified with the URL syntax.
455

    
456

    
457
<P>
458
 Use 'ffmpeg -formats' to have a list of the supported protocols.
459

    
460

    
461
<P>
462
 The protocol <CODE>http:</CODE> is currently used only to communicate with
463
 ffserver (see the ffserver documentation). When ffmpeg will be a
464
 video player it will also be used for streaming :-)
465

    
466

    
467

    
468

    
469
<H1><A NAME="SEC12" HREF="ffmpeg-doc.html#TOC12">4. Tips</A></H1>
470

    
471

    
472
<UL>
473
<LI>For streaming at very low bit rate application, use a low frame rate
474

    
475
  and a small gop size. This is especially true for real video where
476
  the Linux player does not seem to be very fast, so it can miss
477
  frames. An example is:
478

    
479

    
480
<PRE>
481
  ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
482
</PRE>
483

    
484
<LI>The parameter 'q' which is displayed while encoding is the current
485

    
486
  quantizer. The value of 1 indicates that a very good quality could
487
  be achieved. The value of 31 indicates the worst quality. If q=31
488
  too often, it means that the encoder cannot compress enough to meet
489
  your bit rate. You must either increase the bit rate, decrease the
490
  frame rate or decrease the frame size.
491

    
492
<LI>If your computer is not fast enough, you can speed up the
493

    
494
  compression at the expense of the compression ratio. You can use
495
  '-me zero' to speed up motion estimation, and '-intra' to disable
496
  completly motion estimation (you have only I frames, which means it
497
  is about as good as JPEG compression).
498

    
499
<LI>To have very low bitrates in audio, reduce the sampling frequency
500

    
501
  (down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
502

    
503
<LI>To have a constant quality (but a variable bitrate), use the option
504

    
505
  '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
506
  quality).
507

    
508
<LI>When converting video files, you can use the '-sameq' option which
509

    
510
  uses in the encoder the same quality factor than in the decoder. It
511
  allows to be almost lossless in encoding.
512

    
513
</UL>
514

    
515

    
516

    
517
<H1><A NAME="SEC13" HREF="ffmpeg-doc.html#TOC13">5. Supported File Formats and Codecs</A></H1>
518

    
519
<P>
520
You can use the <CODE>-formats</CODE> option to have an exhaustive list.
521

    
522

    
523

    
524

    
525
<H2><A NAME="SEC14" HREF="ffmpeg-doc.html#TOC14">5.1 File Formats</A></H2>
526

    
527
<P>
528
FFmpeg supports the following file formats thru the <CODE>libavformat</CODE>
529
library.
530

    
531

    
532
<TABLE BORDER>
533

    
534
<TR><TD>Supported File Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
535

    
536
</TR>
537
<TR><TD>MPEG audio </TD><TD> X </TD><TD> X</TD>
538

    
539
</TR>
540
<TR><TD>MPEG1 systems </TD><TD> X  </TD><TD>  X</TD>
541

    
542
</TD><TD> muxed audio and video
543
</TR>
544
<TR><TD>MPEG2 PS </TD><TD> X  </TD><TD>  X</TD>
545

    
546
</TD><TD> also known as <CODE>VOB</CODE> file
547
</TR>
548
<TR><TD>MPEG2 TS </TD><TD>    </TD><TD>  X</TD>
549

    
550
</TD><TD> also known as DVB Transport Stream
551
</TR>
552
<TR><TD>ASF</TD><TD> X </TD><TD> X</TD>
553

    
554
</TR>
555
<TR><TD>AVI</TD><TD> X </TD><TD> X</TD>
556

    
557
</TR>
558
<TR><TD>WAV</TD><TD> X </TD><TD> X</TD>
559

    
560
</TR>
561
<TR><TD>Macromedia Flash</TD><TD> X </TD><TD> X</TD>
562

    
563
</TD><TD> Only embedded audio is decoded
564
</TR>
565
<TR><TD>Real Audio and Video </TD><TD> X </TD><TD> X</TD>
566

    
567
</TR>
568
<TR><TD>PGM, YUV, PPM, JPEG images </TD><TD> X </TD><TD> X</TD>
569

    
570
</TR>
571
<TR><TD>Animated GIF </TD><TD> X </TD><TD></TD>
572

    
573
</TD><TD> Only uncompressed GIFs are generated
574
</TR>
575
<TR><TD>Raw AC3 </TD><TD> X  </TD><TD>  X</TD>
576

    
577
</TR>
578
<TR><TD>Raw MJPEG </TD><TD> X  </TD><TD>  X</TD>
579

    
580
</TR>
581
<TR><TD>Raw MPEG video </TD><TD> X  </TD><TD>  X</TD>
582

    
583
</TR>
584
<TR><TD>Raw PCM8/16 bits, mulaw/Alaw</TD><TD> X  </TD><TD>  X</TD>
585

    
586
</TR>
587
<TR><TD>SUN AU format </TD><TD> X  </TD><TD>  X</TD>
588

    
589
</TR>
590
<TR><TD>Quicktime        </TD><TD>   </TD><TD>  X</TD>
591

    
592
</TR>
593
<TR><TD>MPEG4            </TD><TD>  </TD><TD>  X</TD>
594

    
595
</TD><TD> MPEG4 is a variant of Quicktime
596
</TR>
597
<TR><TD>Raw MPEG4 video  </TD><TD>  </TD><TD>  X</TD>
598

    
599
</TD><TD> Only small files are supported.
600
</TR>
601
<TR><TD>DV               </TD><TD>  </TD><TD> X</TD>
602

    
603
</TD><TD> Only the video track is decoded.
604
</TR></TABLE>
605

    
606
<P>
607
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
608

    
609

    
610

    
611

    
612
<H2><A NAME="SEC15" HREF="ffmpeg-doc.html#TOC15">5.2 Video Codecs</A></H2>
613

    
614
<TABLE BORDER>
615

    
616
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
617

    
618
</TR>
619
<TR><TD>MPEG1 video            </TD><TD>  X  </TD><TD>  X</TD>
620

    
621
</TR>
622
<TR><TD>MPEG2 video            </TD><TD>     </TD><TD>  X</TD>
623

    
624
</TR>
625
<TR><TD>MPEG4                  </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as DIVX4/5</TD>
626

    
627
</TR>
628
<TR><TD>MSMPEG4 V1             </TD><TD>  X  </TD><TD>  X</TD>
629

    
630
</TR>
631
<TR><TD>MSMPEG4 V2             </TD><TD>  X  </TD><TD>  X</TD>
632

    
633
</TR>
634
<TR><TD>MSMPEG4 V3             </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as DIVX3</TD>
635

    
636
</TR>
637
<TR><TD>WMV7                   </TD><TD>  X  </TD><TD>  X</TD>
638

    
639
</TR>
640
<TR><TD>H263(+)                </TD><TD>  X  </TD><TD>  X </TD><TD> Also known as Real Video 1.0</TD>
641

    
642
</TR>
643
<TR><TD>MJPEG                  </TD><TD>  X  </TD><TD>  X</TD>
644

    
645
</TR>
646
<TR><TD>DV                     </TD><TD>     </TD><TD>  X</TD>
647

    
648
</TR></TABLE>
649

    
650
<P>
651
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
652

    
653

    
654
<P>
655
Check at <A HREF="http://www.mplayerhq.hu/~michael/codec-features.html">http://www.mplayerhq.hu/~michael/codec-features.html</A> to
656
get a precise comparison of FFmpeg MPEG4 codec compared to the other
657
solutions.
658

    
659

    
660

    
661

    
662
<H2><A NAME="SEC16" HREF="ffmpeg-doc.html#TOC16">5.3 Audio Codecs</A></H2>
663

    
664
<TABLE BORDER>
665

    
666
<TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
667

    
668
</TR>
669
<TR><TD>MPEG audio layer 2     </TD><TD>  IX  </TD><TD>  IX</TD>
670

    
671
</TR>
672
<TR><TD>MPEG audio layer 1/3   </TD><TD> IX   </TD><TD>  IX</TD>
673

    
674
</TD><TD> MP3 encoding is supported thru the external library LAME
675
</TR>
676
<TR><TD>AC3                    </TD><TD>  IX  </TD><TD>  X</TD>
677

    
678
</TD><TD> liba52 is used internally for decoding.
679
</TR>
680
<TR><TD>Vorbis                 </TD><TD>  X   </TD><TD></TD>
681

    
682
</TD><TD> encoding is supported thru the external library libvorbis.
683
</TR></TABLE>
684

    
685
<P>
686
<CODE>X</CODE> means that the encoding (resp. decoding) is supported.
687

    
688

    
689
<P>
690
<CODE>I</CODE> means that an integer only version is available too (ensures highest
691
performances on systems without hardware floating point support).
692

    
693

    
694

    
695

    
696
<H1><A NAME="SEC17" HREF="ffmpeg-doc.html#TOC17">6. Platform Specific information</A></H1>
697

    
698

    
699

    
700
<H2><A NAME="SEC18" HREF="ffmpeg-doc.html#TOC18">6.1 Linux</A></H2>
701

    
702
<P>
703
ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
704
prefered compiler now for ffmpeg. All futur optimizations will depend on
705
features only found in GCC 3.2.
706

    
707

    
708

    
709

    
710
<H2><A NAME="SEC19" HREF="ffmpeg-doc.html#TOC19">6.2 BSD</A></H2>
711

    
712

    
713

    
714
<H2><A NAME="SEC20" HREF="ffmpeg-doc.html#TOC20">6.3 Windows</A></H2>
715

    
716

    
717

    
718
<H2><A NAME="SEC21" HREF="ffmpeg-doc.html#TOC21">6.4 MacOS X</A></H2>
719

    
720

    
721

    
722
<H2><A NAME="SEC22" HREF="ffmpeg-doc.html#TOC22">6.5 BeOS</A></H2>
723

    
724
<P>
725
The configure script should guess the configuration itself.
726
Networking support is currently not finished.
727
errno issues fixed by Andrew Bachmann.
728

    
729

    
730
<P>
731
Old stuff:
732

    
733

    
734
<P>
735
Fran?ois Revol - revol at free dot fr - April 2002
736

    
737

    
738
<P>
739
The configure script should guess the configuration itself, 
740
however I still didn't tested building on net_server version of BeOS.
741

    
742

    
743
<P>
744
ffserver is broken (needs poll() implementation).
745

    
746

    
747
<P>
748
There is still issues with errno codes, which are negative in BeOs, and
749
that ffmpeg negates when returning. This ends up turning errors into 
750
valid results, then crashes.
751
(To be fixed)
752

    
753

    
754

    
755

    
756
<H1><A NAME="SEC23" HREF="ffmpeg-doc.html#TOC23">7. Developpers Guide</A></H1>
757

    
758

    
759

    
760
<H2><A NAME="SEC24" HREF="ffmpeg-doc.html#TOC24">7.1 API</A></H2>
761

    
762
<UL>
763
<LI>libavcodec is the library containing the codecs (both encoding and
764

    
765
  decoding). See <TT>`libavcodec/apiexample.c'</TT> to see how to use it.
766

    
767
<LI>libavformat is the library containing the file formats handling (mux and
768

    
769
  demux code for several formats). (no example yet, the API is likely to
770
  evolve).
771
</UL>
772

    
773

    
774

    
775
<H2><A NAME="SEC25" HREF="ffmpeg-doc.html#TOC25">7.2 Integrating libavcodec or libavformat in your program</A></H2>
776

    
777
<P>
778
You can integrate all the source code of the libraries to link them
779
statically to avoid any version problem. All you need is to provide a
780
'config.mak' and a 'config.h' in the parent directory. See the defines
781
generated by ./configure to understand what is needed.
782

    
783

    
784
<P>
785
You can use libavcodec or libavformat in your commercial program, but
786
<EM>any patch you make must be published</EM>. The best way to proceed is
787
to send your patches to the ffmpeg mailing list.
788

    
789

    
790

    
791

    
792
<H2><A NAME="SEC26" HREF="ffmpeg-doc.html#TOC26">7.3 Coding Rules</A></H2>
793

    
794
<P>
795
ffmpeg is programmed in ANSI C language. GCC extensions are
796
tolerated. Indent size is 4. The TAB character should not be used.
797

    
798

    
799
<P>
800
The presentation is the one specified by 'indent -i4 -kr'.
801

    
802

    
803
<P>
804
Main priority in ffmpeg is simplicity and small code size (=less
805
bugs).
806

    
807

    
808
<P>
809
Comments: for functions visible from other modules, use the JavaDoc
810
format (see examples in <TT>`libav/utils.c'</TT>) so that a documentation
811
can be generated automatically.
812

    
813

    
814

    
815

    
816
<H2><A NAME="SEC27" HREF="ffmpeg-doc.html#TOC27">7.4 Submitting patches</A></H2>
817

    
818
<P>
819
When you submit your patch, try to send a unified diff (diff '-u'
820
option). I cannot read other diffs :-)
821

    
822

    
823
<P>
824
Run the regression tests before submitting a patch so that you can
825
verify that there is no big problems.
826

    
827

    
828
<P>
829
Except if your patch is really big and adds an important feature, by
830
submitting it to me, you accept implicitely to put it under my
831
copyright. I prefer to do this to avoid potential problems if
832
licensing of ffmpeg changes.
833

    
834

    
835
<P>
836
Patches should be posted as base64 encoded attachments (or any other
837
encoding which ensures that the patch wont be trashed during 
838
transmission) to the ffmpeg-devel mailinglist, see 
839
<A HREF="http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel">http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel</A>
840

    
841

    
842

    
843

    
844
<H2><A NAME="SEC28" HREF="ffmpeg-doc.html#TOC28">7.5 Regression tests</A></H2>
845

    
846
<P>
847
Before submitting a patch (or commiting with CVS), you should at least
848
test that you did not break anything.
849

    
850

    
851
<P>
852
The regression test build a synthetic video stream and a synthetic
853
audio stream. Then there are encoded then decoded with all codecs or
854
formats. The CRC (or MD5) of each generated file is recorded in a
855
result file. Then a 'diff' is launched with the reference results and
856
the result file.
857

    
858

    
859
<P>
860
Run 'make test' to test all the codecs.
861

    
862

    
863
<P>
864
Run 'make libavtest' to test all the codecs.
865

    
866

    
867
<P>
868
[Of course, some patches may change the regression tests results. In
869
this case, the regression tests reference results shall be modified
870
accordingly].
871

    
872

    
873
<P><HR><P>
874
This document was generated on 19 November 2002 using
875
<A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A>&nbsp;1.56k.
876
</BODY>
877
</HTML>