1
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
4
.\" ========================================================================
5
.de Sh \" Subsection heading
13
.de Sp \" Vertical space (when we can't use .PP)
17
.de Vb \" Begin verbatim text
22
.de Ve \" End verbatim text
26
.\" Set up some character translations and predefined strings. \*(-- will
27
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28
.\" double quote, and \*(R" will give a right double quote. | will give a
29
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31
.\" expand to `' in nroff, nothing in troff, for use with C<>.
33
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51
.\" If the F register is turned on, we'll generate index entries on stderr for
52
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53
.\" entries marked with X<> in POD. Of course, you'll have to process the
54
.\" output yourself in some meaningful fashion.
57
. tm Index:\\$1\t\\n%\t"\\$2"
63
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64
.\" way too many mistakes in technical documents.
68
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69
.\" Fear. Run. Save yourself. No user-serviceable parts.
70
. \" fudge factors for nroff and troff
79
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85
. \" simple accents for nroff and troff
95
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102
. \" troff and (daisy-wheel) nroff accents
103
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110
.ds ae a\h'-(\w'a'u*4/10)'e
111
.ds Ae A\h'-(\w'A'u*4/10)'E
112
. \" corrections for vroff
113
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115
. \" for low resolution devices (crt and lpr)
116
.if \n(.H>23 .if \n(.V>19 \
129
.\" ========================================================================
132
.TH FFMPEG 1 "2003-09-16" " " " "
134
ffmpeg \- FFmpeg video converter
136
.IX Header "SYNOPSIS"
137
ffmpeg [[options][\fB\-i\fR \fIinput_file\fR]]... {[options] \fIoutput_file\fR}...
139
.IX Header "DESCRIPTION"
140
If no input file is given, audio/video grabbing is done.
142
As a general rule, options are applied to the next specified
143
file. For example, if you give the \fB\-b 64\fR option, it sets the video
144
bitrate of the next file. Format option may be needed for raw input
147
By default, ffmpeg tries to convert as losslessly as possible: it
148
uses the same audio and video parameter for the outputs as the one
149
specified for the inputs.
153
.IX Subsection "Main options"
160
.IP "\fB\-formats\fR" 4
162
show available formats, codecs, protocols, ...
163
.IP "\fB\-f fmt\fR" 4
166
.IP "\fB\-i filename\fR" 4
167
.IX Item "-i filename"
171
overwrite output files
172
.IP "\fB\-t duration\fR" 4
173
.IX Item "-t duration"
174
set the recording time in seconds. \f(CW\*(C`hh:mm:ss[.xxx]\*(C'\fR syntax is also
176
.IP "\fB\-title string\fR" 4
177
.IX Item "-title string"
179
.IP "\fB\-author string\fR" 4
180
.IX Item "-author string"
182
.IP "\fB\-copyright string\fR" 4
183
.IX Item "-copyright string"
185
.IP "\fB\-comment string\fR" 4
186
.IX Item "-comment string"
190
activate high quality settings
192
.IX Subsection "Video Options"
193
.IP "\fB\-b bitrate\fR" 4
194
.IX Item "-b bitrate"
195
set the video bitrate in kbit/s (default = 200 kb/s)
196
.IP "\fB\-r fps\fR" 4
198
set frame rate (default = 25)
199
.IP "\fB\-s size\fR" 4
201
set frame size. The format is \fBWxH\fR (default 160x128). The
202
following abbreviations are recognized:
219
.IP "\fB\-aspect aspect\fR" 4
220
.IX Item "-aspect aspect"
221
set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
222
.IP "\fB\-croptop size\fR" 4
223
.IX Item "-croptop size"
224
set top crop band size (in pixels)
225
.IP "\fB\-cropbottom size\fR" 4
226
.IX Item "-cropbottom size"
227
set bottom crop band size (in pixels)
228
.IP "\fB\-cropleft size\fR" 4
229
.IX Item "-cropleft size"
230
set left crop band size (in pixels)
231
.IP "\fB\-cropright size\fR" 4
232
.IX Item "-cropright size"
233
set right crop band size (in pixels)
236
disable video recording
237
.IP "\fB\-bt tolerance\fR" 4
238
.IX Item "-bt tolerance"
239
set video bitrate tolerance (in kbit/s)
240
.IP "\fB\-maxrate bitrate\fR" 4
241
.IX Item "-maxrate bitrate"
242
set max video bitrate tolerance (in kbit/s)
243
.IP "\fB\-minrate bitrate\fR" 4
244
.IX Item "-minrate bitrate"
245
set min video bitrate tolerance (in kbit/s)
246
.IP "\fB\-bufsize size\fR" 4
247
.IX Item "-bufsize size"
248
set ratecontrol buffere size (in kbit)
249
.IP "\fB\-vcodec codec\fR" 4
250
.IX Item "-vcodec codec"
251
force video codec to \fIcodec\fR. Use the \f(CW\*(C`copy\*(C'\fR special value to
252
tell that the raw codec data must be copied as is.
253
.IP "\fB\-sameq\fR" 4
255
use same video quality as source (implies \s-1VBR\s0)
256
.IP "\fB\-pass n\fR" 4
258
select the pass number (1 or 2). It is useful to do two pass
259
encoding. The statistics of the video are recorded in the first pass and
260
the video at the exact requested bit rate is generated in the second
262
.IP "\fB\-passlogfile file\fR" 4
263
.IX Item "-passlogfile file"
264
select two pass log file name to \fIfile\fR.
265
.Sh "Advanced Video Options"
266
.IX Subsection "Advanced Video Options"
267
.IP "\fB\-g gop_size\fR" 4
268
.IX Item "-g gop_size"
269
set the group of picture size
270
.IP "\fB\-intra\fR" 4
272
use only intra frames
273
.IP "\fB\-qscale q\fR" 4
275
use fixed video quantiser scale (\s-1VBR\s0)
276
.IP "\fB\-qmin q\fR" 4
278
min video quantiser scale (\s-1VBR\s0)
279
.IP "\fB\-qmax q\fR" 4
281
max video quantiser scale (\s-1VBR\s0)
282
.IP "\fB\-qdiff q\fR" 4
284
max difference between the quantiser scale (\s-1VBR\s0)
285
.IP "\fB\-qblur blur\fR" 4
286
.IX Item "-qblur blur"
287
video quantiser scale blur (\s-1VBR\s0)
288
.IP "\fB\-qcomp compression\fR" 4
289
.IX Item "-qcomp compression"
290
video quantiser scale compression (\s-1VBR\s0)
291
.IP "\fB\-rc_init_cplx complexity\fR" 4
292
.IX Item "-rc_init_cplx complexity"
293
initial complexity for 1\-pass encoding
294
.IP "\fB\-b_qfactor factor\fR" 4
295
.IX Item "-b_qfactor factor"
296
qp factor between p and b frames
297
.IP "\fB\-i_qfactor factor\fR" 4
298
.IX Item "-i_qfactor factor"
299
qp factor between p and i frames
300
.IP "\fB\-b_qoffset offset\fR" 4
301
.IX Item "-b_qoffset offset"
302
qp offset between p and b frames
303
.IP "\fB\-i_qoffset offset\fR" 4
304
.IX Item "-i_qoffset offset"
305
qp offset between p and i frames
306
.IP "\fB\-rc_eq equation\fR" 4
307
.IX Item "-rc_eq equation"
308
set rate control equation. Default is \f(CW\*(C`tex^qComp\*(C'\fR.
309
.IP "\fB\-rc_override override\fR" 4
310
.IX Item "-rc_override override"
311
rate control override for specific intervals
312
.IP "\fB\-me method\fR" 4
313
.IX Item "-me method"
314
set motion estimation method to \fImethod\fR. Available methods are
315
(from lower to best quality):
319
Try just the (0, 0) vector.
333
exhaustive search (slow and marginally better than epzs)
337
.IP "\fB\-dct_algo algo\fR" 4
338
.IX Item "-dct_algo algo"
339
set dct algorithm to \fIalgo\fR. Available values are:
343
\&\s-1FF_DCT_AUTO\s0 (default)
346
\&\s-1FF_DCT_FASTINT\s0
358
\&\s-1FF_DCT_ALTIVEC\s0
362
.IP "\fB\-idct_algo algo\fR" 4
363
.IX Item "-idct_algo algo"
364
set idct algorithm to \fIalgo\fR. Available values are:
368
\&\s-1FF_IDCT_AUTO\s0 (default)
374
\&\s-1FF_IDCT_SIMPLE\s0
377
\&\s-1FF_IDCT_SIMPLEMMX\s0
380
\&\s-1FF_IDCT_LIBMPEG2MMX\s0
386
\&\s-1FF_IDCT_MLIB\s0
392
\&\s-1FF_IDCT_ALTIVEC\s0
398
\&\s-1FF_IDCT_SIMPLEARM\s0
404
set error resilience to \fIn\fR.
408
\&\s-1FF_ER_CAREFULL\s0 (default)
411
\&\s-1FF_ER_COMPLIANT\s0
414
\&\s-1FF_ER_AGGRESSIVE\s0
417
\&\s-1FF_ER_VERY_AGGRESSIVE\s0
421
.IP "\fB\-ec bit_mask\fR" 4
422
.IX Item "-ec bit_mask"
423
set error concealment to \fIbit_mask\fR. \fIbit_mask\fR is a bit mask of
424
the following values:
428
\&\s-1FF_EC_GUESS_MVS\s0 (default=enabled)
431
\&\s-1FF_EC_DEBLOCK\s0 (default=enabled)
435
.IP "\fB\-bf frames\fR" 4
436
.IX Item "-bf frames"
437
use 'frames' B frames (supported for \s-1MPEG\-1\s0, \s-1MPEG\-2\s0 and \s-1MPEG\-4\s0)
438
.IP "\fB\-mbd mode\fR" 4
444
\&\s-1FF_MB_DECISION_SIMPLE:\s0 use mb_cmp (cannot change it yet in ffmpeg)
447
\&\s-1FF_MB_DECISION_BITS:\s0 chooses the one which needs the fewest bits
450
\&\s-1FF_MB_DECISION_RD:\s0 rate distoration
456
use four motion vector by macroblock (only \s-1MPEG\-4\s0)
459
use data partitioning (only \s-1MPEG\-4\s0)
460
.IP "\fB\-bug param\fR" 4
461
.IX Item "-bug param"
462
workaround not auto detected encoder bugs
463
.IP "\fB\-strict strictness\fR" 4
464
.IX Item "-strict strictness"
465
how strictly to follow the standarts
468
enable Advanced intra coding (h263+)
471
enable Unlimited Motion Vector (h263+)
472
.IP "\fB\-deinterlace\fR" 4
473
.IX Item "-deinterlace"
477
calculate \s-1PSNR\s0 of compressed frames
478
.IP "\fB\-vstats\fR" 4
480
dump video coding statistics to \fIvstats_HHMMSS.log\fR.
481
.IP "\fB\-vhook module\fR" 4
482
.IX Item "-vhook module"
483
insert video processing \fImodule\fR. \fImodule\fR contains the module
484
name and its parameters separated by spaces.
486
.IX Subsection "Audio Options"
487
.IP "\fB\-ab bitrate\fR" 4
488
.IX Item "-ab bitrate"
489
set audio bitrate (in kbit/s)
490
.IP "\fB\-ar freq\fR" 4
492
set the audio sampling freq (default = 44100 Hz)
493
.IP "\fB\-ab bitrate\fR" 4
494
.IX Item "-ab bitrate"
495
set the audio bitrate in kbit/s (default = 64)
496
.IP "\fB\-ac channels\fR" 4
497
.IX Item "-ac channels"
498
set the number of audio channels (default = 1)
501
disable audio recording
502
.IP "\fB\-acodec codec\fR" 4
503
.IX Item "-acodec codec"
504
force audio codec to \fIcodec\fR. Use the \f(CW\*(C`copy\*(C'\fR special value to
505
tell that the raw codec data must be copied as is.
506
.Sh "Audio/Video grab options"
507
.IX Subsection "Audio/Video grab options"
508
.IP "\fB\-vd device\fR" 4
509
.IX Item "-vd device"
510
set video grab device (e.g. \fI/dev/video0\fR)
511
.IP "\fB\-vc channel\fR" 4
512
.IX Item "-vc channel"
513
set video grab channel (\s-1DV1394\s0 only)
514
.IP "\fB\-tvstd standard\fR" 4
515
.IX Item "-tvstd standard"
516
set television standard (\s-1NTSC\s0, \s-1PAL\s0 (\s-1SECAM\s0))
517
.IP "\fB\-dv1394\fR" 4
519
set \s-1DV1394\s0 grab
520
.IP "\fB\-ad device\fR" 4
521
.IX Item "-ad device"
522
set audio device (e.g. \fI/dev/dsp\fR)
523
.Sh "Advanced options"
524
.IX Subsection "Advanced options"
525
.IP "\fB\-map file:stream\fR" 4
526
.IX Item "-map file:stream"
527
set input stream mapping
528
.IP "\fB\-debug\fR" 4
530
print specific debug info
531
.IP "\fB\-benchmark\fR" 4
532
.IX Item "-benchmark"
533
add timings for benchmarking
536
dump each input packet
537
.IP "\fB\-bitexact\fR" 4
539
only use bit exact algorithms (for codec testing)
540
.IP "\fB\-ps size\fR" 4
542
set packet size in bits
545
read input at native frame rate. Mainly used to simulate a grab device.
548
loop over the input stream. Currently it works only for image
549
streams. This option is used for ffserver automatic testing.
550
.Sh "FFmpeg formula evaluator"
551
.IX Subsection "FFmpeg formula evaluator"
552
When evaluating a rate control string, FFmpeg uses an internal formula
555
The following binary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR,
556
\&\f(CW\*(C`*\*(C'\fR, \f(CW\*(C`/\*(C'\fR, \f(CW\*(C`^\*(C'\fR.
558
The following unary operators are available: \f(CW\*(C`+\*(C'\fR, \f(CW\*(C`\-\*(C'\fR,
559
\&\f(CW\*(C`(...)\*(C'\fR.
561
The following functions are available:
562
.IP "\fIsinh(x)\fR" 4
565
.IP "\fIcosh(x)\fR" 4
567
.IP "\fItanh(x)\fR" 4
579
.IP "\fIsquish(x)\fR" 4
581
.IP "\fIgauss(x)\fR" 4
585
.IP "\fImax(x, y)\fR" 4
587
.IP "\fImin(x, y)\fR" 4
589
.IP "\fIgt(x, y)\fR" 4
591
.IP "\fIlt(x, y)\fR" 4
593
.IP "\fIeq(x, y)\fR" 4
595
.IP "\fIbits2qp(bits)\fR" 4
596
.IX Item "bits2qp(bits)"
597
.IP "\fIqp2bits(qp)\fR" 4
598
.IX Item "qp2bits(qp)"
601
The following constants are available:
602
.IP "\fI\s-1PI\s0\fR" 4
633
.IP "\fIavgIITex\fR" 4
635
.IP "\fIavgPITex\fR" 4
637
.IP "\fIavgPPTex\fR" 4
639
.IP "\fIavgBPTex\fR" 4
645
.IX Header "EXAMPLES"
646
.Sh "Video and Audio grabbing"
647
.IX Subsection "Video and Audio grabbing"
648
FFmpeg can use a video4linux compatible video source and any Open Sound
652
\& ffmpeg /tmp/out.mpg
655
Note that you must activate the right video source and channel before
656
launching ffmpeg. You can use any \s-1TV\s0 viewer such as xawtv
657
(<\fBhttp://bytesex.org/xawtv/\fR>) by Gerd Knorr which I find very
658
good. You must also set correctly the audio recording levels with a
660
.Sh "Video and Audio file format conversion"
661
.IX Subsection "Video and Audio file format conversion"
662
* ffmpeg can use any supported file format and protocol as input:
666
* You can input from \s-1YUV\s0 files:
669
\& ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
672
It will use the files:
675
\& /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
676
\& /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
679
The Y files use twice the resolution of the U and V files. They are
680
raw files, without header. They can be generated by all decent video
681
decoders. You must specify the size of the image with the \fB\-s\fR option
682
if ffmpeg cannot guess it.
684
* You can input from a \s-1RAW\s0 \s-1YUV420P\s0 file:
687
\& ffmpeg -i /tmp/test.yuv /tmp/out.avi
690
The \s-1RAW\s0 \s-1YUV420P\s0 is a file containing \s-1RAW\s0 \s-1YUV\s0 planar, for each frame first
691
come the Y plane followed by U and V planes, which are half vertical and
692
horizontal resolution.
694
* You can output to a \s-1RAW\s0 \s-1YUV420P\s0 file:
697
\& ffmpeg -i mydivx.avi -o hugefile.yuv
700
* You can set several input files and output files:
703
\& ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
706
Convert the audio file a.wav and the raw yuv video file a.yuv
709
* You can also do audio and video conversions at the same time:
712
\& ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
715
Convert the sample rate of a.wav to 22050 Hz and encode it to \s-1MPEG\s0 audio.
717
* You can encode to several formats at the same time and define a
718
mapping from input stream to output streams:
721
\& ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
724
Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '\-map
725
file:index' specify which input stream is used for each output
726
stream, in the order of the definition of output streams.
728
* You can transcode decrypted VOBs
731
\& ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
734
This is a typical \s-1DVD\s0 ripper example, input from a \s-1VOB\s0 file, output
735
to an \s-1AVI\s0 file with \s-1MPEG\-4\s0 video and \s-1MP3\s0 audio, note that in this
736
command we use B frames so the \s-1MPEG\-4\s0 stream is DivX5 compatible, \s-1GOP\s0
737
size is 300 that means an \s-1INTRA\s0 frame every 10 seconds for 29.97 fps
738
input video. Also the audio stream is \s-1MP3\s0 encoded so you need \s-1LAME\s0
739
support which is enabled using \f(CW\*(C`\-\-enable\-mp3lame\*(C'\fR when
740
configuring. The mapping is particularly useful for \s-1DVD\s0 transcoding
741
to get the desired audio language.
743
\&\s-1NOTE:\s0 to see the supported input formats, use \f(CW\*(C`ffmpeg \-formats\*(C'\fR.
745
.IX Header "SEE ALSO"
746
\&\fIffserver\fR\|(1), \fIffplay\fR\|(1) and the html documentation of \fIffmpeg\fR.