ffmpeg.texi 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  1. \input texinfo @c -*- texinfo -*-
  2. @settitle ffmpeg Documentation
  3. @titlepage
  4. @center @titlefont{ffmpeg Documentation}
  5. @end titlepage
  6. @top
  7. @contents
  8. @chapter Synopsis
  9. The generic syntax is:
  10. @example
  11. @c man begin SYNOPSIS
  12. ffmpeg [global options] [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
  13. @c man end
  14. @end example
  15. @chapter Description
  16. @c man begin DESCRIPTION
  17. ffmpeg is a very fast video and audio converter that can also grab from
  18. a live audio/video source. It can also convert between arbitrary sample
  19. rates and resize video on the fly with a high quality polyphase filter.
  20. ffmpeg reads from an arbitrary number of input "files" (which can be regular
  21. files, pipes, network streams, grabbing devices, etc.), specified by the
  22. @code{-i} option, and writes to an arbitrary number of output "files", which are
  23. specified by a plain output filename. Anything found on the commandline which
  24. cannot be interpreted as an option is considered to be an output filename.
  25. Each input or output file can in principle contain any number of streams of
  26. different types (video/audio/subtitle/attachment/data). Allowed number and/or
  27. types of streams can be limited by the container format. Selecting, which
  28. streams from which inputs go into output, is done either automatically or with
  29. the @code{-map} option (see the Stream selection chapter).
  30. To refer to input files in options, you must use their indices (0-based). E.g.
  31. the first input file is @code{0}, the second is @code{1} etc. Similarly, streams
  32. within a file are referred to by their indices. E.g. @code{2:3} refers to the
  33. fourth stream in the third input file. See also the Stream specifiers chapter.
  34. As a general rule, options are applied to the next specified
  35. file. Therefore, order is important, and you can have the same
  36. option on the command line multiple times. Each occurrence is
  37. then applied to the next input or output file.
  38. Exceptions from this rule are the global options (e.g. verbosity level),
  39. which should be specified first.
  40. Do not mix input and output files -- first specify all input files, then all
  41. output files. Also do not mix options which belong to different files. All
  42. options apply ONLY to the next input or output file and are reset between files.
  43. @itemize
  44. @item
  45. To set the video bitrate of the output file to 64kbit/s:
  46. @example
  47. ffmpeg -i input.avi -b:v 64k output.avi
  48. @end example
  49. @item
  50. To force the frame rate of the output file to 24 fps:
  51. @example
  52. ffmpeg -i input.avi -r 24 output.avi
  53. @end example
  54. @item
  55. To force the frame rate of the input file (valid for raw formats only)
  56. to 1 fps and the frame rate of the output file to 24 fps:
  57. @example
  58. ffmpeg -r 1 -i input.m2v -r 24 output.avi
  59. @end example
  60. @end itemize
  61. The format option may be needed for raw input files.
  62. @c man end DESCRIPTION
  63. @chapter Stream selection
  64. @c man begin STREAM SELECTION
  65. By default ffmpeg includes only one stream of each type (video, audio, subtitle)
  66. present in the input files and adds them to each output file. It picks the
  67. "best" of each based upon the following criteria; for video it is the stream
  68. with the highest resolution, for audio the stream with the most channels, for
  69. subtitle it's the first subtitle stream. In the case where several streams of
  70. the same type rate equally, the lowest numbered stream is chosen.
  71. You can disable some of those defaults by using @code{-vn/-an/-sn} options. For
  72. full manual control, use the @code{-map} option, which disables the defaults just
  73. described.
  74. @c man end STREAM SELECTION
  75. @chapter Options
  76. @c man begin OPTIONS
  77. @include avtools-common-opts.texi
  78. @section Main options
  79. @table @option
  80. @item -f @var{fmt} (@emph{input/output})
  81. Force input or output file format. The format is normally auto detected for input
  82. files and guessed from file extension for output files, so this option is not
  83. needed in most cases.
  84. @item -i @var{filename} (@emph{input})
  85. input file name
  86. @item -y (@emph{global})
  87. Overwrite output files without asking.
  88. @item -n (@emph{global})
  89. Do not overwrite output files but exit if file exists.
  90. @item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
  91. @itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
  92. Select an encoder (when used before an output file) or a decoder (when used
  93. before an input file) for one or more streams. @var{codec} is the name of a
  94. decoder/encoder or a special value @code{copy} (output only) to indicate that
  95. the stream is not to be re-encoded.
  96. For example
  97. @example
  98. ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  99. @end example
  100. encodes all video streams with libx264 and copies all audio streams.
  101. For each stream, the last matching @code{c} option is applied, so
  102. @example
  103. ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  104. @end example
  105. will copy all the streams except the second video, which will be encoded with
  106. libx264, and the 138th audio, which will be encoded with libvorbis.
  107. @item -t @var{duration} (@emph{output})
  108. Stop writing the output after its duration reaches @var{duration}.
  109. @var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
  110. @item -fs @var{limit_size} (@emph{output})
  111. Set the file size limit.
  112. @item -ss @var{position} (@emph{input/output})
  113. When used as an input option (before @code{-i}), seeks in this input file to
  114. @var{position}. When used as an output option (before an output filename),
  115. decodes but discards input until the timestamps reach @var{position}. This is
  116. slower, but more accurate.
  117. @var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
  118. @item -itsoffset @var{offset} (@emph{input})
  119. Set the input time offset in seconds.
  120. @code{[-]hh:mm:ss[.xxx]} syntax is also supported.
  121. The offset is added to the timestamps of the input files.
  122. Specifying a positive offset means that the corresponding
  123. streams are delayed by @var{offset} seconds.
  124. @item -timestamp @var{time} (@emph{output})
  125. Set the recording timestamp in the container.
  126. The syntax for @var{time} is:
  127. @example
  128. now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
  129. @end example
  130. If the value is "now" it takes the current time.
  131. Time is local time unless 'Z' or 'z' is appended, in which case it is
  132. interpreted as UTC.
  133. If the year-month-day part is not specified it takes the current
  134. year-month-day.
  135. @item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
  136. Set a metadata key/value pair.
  137. An optional @var{metadata_specifier} may be given to set metadata
  138. on streams or chapters. See @code{-map_metadata} documentation for
  139. details.
  140. This option overrides metadata set with @code{-map_metadata}. It is
  141. also possible to delete metadata by using an empty value.
  142. For example, for setting the title in the output file:
  143. @example
  144. ffmpeg -i in.avi -metadata title="my title" out.flv
  145. @end example
  146. To set the language of the second stream:
  147. @example
  148. ffmpeg -i INPUT -metadata:s:1 language=eng OUTPUT
  149. @end example
  150. @item -target @var{type} (@emph{output})
  151. Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
  152. @code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
  153. @code{film-} to use the corresponding standard. All the format options
  154. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  155. @example
  156. ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  157. @end example
  158. Nevertheless you can specify additional options as long as you know
  159. they do not conflict with the standard, as in:
  160. @example
  161. ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  162. @end example
  163. @item -dframes @var{number} (@emph{output})
  164. Set the number of data frames to record. This is an alias for @code{-frames:d}.
  165. @item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
  166. Stop writing to the stream after @var{framecount} frames.
  167. @item -q[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
  168. @itemx -qscale[:@var{stream_specifier}] @var{q} (@emph{output,per-stream})
  169. Use fixed quality scale (VBR). The meaning of @var{q} is
  170. codec-dependent.
  171. @item -filter[:@var{stream_specifier}] @var{filter_graph} (@emph{output,per-stream})
  172. @var{filter_graph} is a description of the filter graph to apply to
  173. the stream. Use @code{-filters} to show all the available filters
  174. (including also sources and sinks).
  175. @item -pre[:@var{stream_specifier}] @var{preset_name} (@emph{output,per-stream})
  176. Specify the preset for matching stream(s).
  177. @item -stats (@emph{global})
  178. Print encoding progress/statistics. On by default.
  179. @item -attach @var{filename} (@emph{output})
  180. Add an attachment to the output file. This is supported by a few formats
  181. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  182. are implemented as a specific type of stream, so this option will add
  183. a new stream to the file. It is then possible to use per-stream options
  184. on this stream in the usual way. Attachment streams created with this
  185. option will be created after all the other streams (i.e. those created
  186. with @code{-map} or automatic mappings).
  187. Note that for Matroska you also have to set the mimetype metadata tag:
  188. @example
  189. ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  190. @end example
  191. (assuming that the attachment stream will be third in the output file).
  192. @item -dump_attachment[:@var{stream_specifier}] @var{filename} (@emph{input,per-stream})
  193. Extract the matching attachment stream into a file named @var{filename}. If
  194. @var{filename} is empty, then the value of the @code{filename} metadata tag
  195. will be used.
  196. E.g. to extract the first attachment to a file named 'out.ttf':
  197. @example
  198. ffmpeg -dump_attachment:t:0 out.ttf INPUT
  199. @end example
  200. To extract all attachments to files determined by the @code{filename} tag:
  201. @example
  202. ffmpeg -dump_attachment:t "" INPUT
  203. @end example
  204. Technical note -- attachments are implemented as codec extradata, so this
  205. option can actually be used to extract extradata from any stream, not just
  206. attachments.
  207. @end table
  208. @section Video Options
  209. @table @option
  210. @item -vframes @var{number} (@emph{output})
  211. Set the number of video frames to record. This is an alias for @code{-frames:v}.
  212. @item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
  213. Set frame rate (Hz value, fraction or abbreviation), (default = 25).
  214. @item -s[:@var{stream_specifier}] @var{size} (@emph{input/output,per-stream})
  215. Set frame size. The format is @samp{wxh} (default - same as source).
  216. The following abbreviations are recognized:
  217. @table @samp
  218. @item sqcif
  219. 128x96
  220. @item qcif
  221. 176x144
  222. @item cif
  223. 352x288
  224. @item 4cif
  225. 704x576
  226. @item 16cif
  227. 1408x1152
  228. @item qqvga
  229. 160x120
  230. @item qvga
  231. 320x240
  232. @item vga
  233. 640x480
  234. @item svga
  235. 800x600
  236. @item xga
  237. 1024x768
  238. @item uxga
  239. 1600x1200
  240. @item qxga
  241. 2048x1536
  242. @item sxga
  243. 1280x1024
  244. @item qsxga
  245. 2560x2048
  246. @item hsxga
  247. 5120x4096
  248. @item wvga
  249. 852x480
  250. @item wxga
  251. 1366x768
  252. @item wsxga
  253. 1600x1024
  254. @item wuxga
  255. 1920x1200
  256. @item woxga
  257. 2560x1600
  258. @item wqsxga
  259. 3200x2048
  260. @item wquxga
  261. 3840x2400
  262. @item whsxga
  263. 6400x4096
  264. @item whuxga
  265. 7680x4800
  266. @item cga
  267. 320x200
  268. @item ega
  269. 640x350
  270. @item hd480
  271. 852x480
  272. @item hd720
  273. 1280x720
  274. @item hd1080
  275. 1920x1080
  276. @end table
  277. @item -aspect[:@var{stream_specifier}] @var{aspect} (@emph{output,per-stream})
  278. Set the video display aspect ratio specified by @var{aspect}.
  279. @var{aspect} can be a floating point number string, or a string of the
  280. form @var{num}:@var{den}, where @var{num} and @var{den} are the
  281. numerator and denominator of the aspect ratio. For example "4:3",
  282. "16:9", "1.3333", and "1.7777" are valid argument values.
  283. @item -croptop @var{size}
  284. @item -cropbottom @var{size}
  285. @item -cropleft @var{size}
  286. @item -cropright @var{size}
  287. All the crop options have been removed. Use -vf
  288. crop=width:height:x:y instead.
  289. @item -padtop @var{size}
  290. @item -padbottom @var{size}
  291. @item -padleft @var{size}
  292. @item -padright @var{size}
  293. @item -padcolor @var{hex_color}
  294. All the pad options have been removed. Use -vf
  295. pad=width:height:x:y:color instead.
  296. @item -vn (@emph{output})
  297. Disable video recording.
  298. @item -bt @var{tolerance}
  299. Set video bitrate tolerance (in bits, default 4000k).
  300. Has a minimum value of: (target_bitrate/target_framerate).
  301. In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
  302. willing to deviate from the target average bitrate value. This is
  303. not related to min/max bitrate. Lowering tolerance too much has
  304. an adverse effect on quality.
  305. @item -maxrate @var{bitrate}
  306. Set max video bitrate (in bit/s).
  307. Requires -bufsize to be set.
  308. @item -minrate @var{bitrate}
  309. Set min video bitrate (in bit/s).
  310. Most useful in setting up a CBR encode:
  311. @example
  312. ffmpeg -i myfile.avi -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  313. @end example
  314. It is of little use elsewise.
  315. @item -bufsize @var{size}
  316. Set video buffer verifier buffer size (in bits).
  317. @item -vcodec @var{codec} (@emph{output})
  318. Set the video codec. This is an alias for @code{-codec:v}.
  319. @item -same_quant
  320. Use same quantizer as source (implies VBR).
  321. Note that this is NOT SAME QUALITY. Do not use this option unless you know you
  322. need it.
  323. @item -pass @var{n}
  324. Select the pass number (1 or 2). It is used to do two-pass
  325. video encoding. The statistics of the video are recorded in the first
  326. pass into a log file (see also the option -passlogfile),
  327. and in the second pass that log file is used to generate the video
  328. at the exact requested bitrate.
  329. On pass 1, you may just deactivate audio and set output to null,
  330. examples for Windows and Unix:
  331. @example
  332. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  333. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  334. @end example
  335. @item -passlogfile @var{prefix} (@emph{global})
  336. Set two-pass log file name prefix to @var{prefix}, the default file name
  337. prefix is ``ffmpeg2pass''. The complete file name will be
  338. @file{PREFIX-N.log}, where N is a number specific to the output
  339. stream
  340. Note that this option is overwritten by a local option of the same name
  341. when using @code{-vcodec libx264}. That option maps to the x264 option stats
  342. which has a different syntax.
  343. @item -vlang @var{code}
  344. Set the ISO 639 language code (3 letters) of the current video stream.
  345. @item -vf @var{filter_graph} (@emph{output})
  346. @var{filter_graph} is a description of the filter graph to apply to
  347. the input video.
  348. Use the option "-filters" to show all the available filters (including
  349. also sources and sinks). This is an alias for @code{-filter:v}.
  350. @end table
  351. @section Advanced Video Options
  352. @table @option
  353. @item -pix_fmt[:@var{stream_specifier}] @var{format} (@emph{input/output,per-stream})
  354. Set pixel format. Use @code{-pix_fmts} to show all the supported
  355. pixel formats.
  356. @item -sws_flags @var{flags} (@emph{input/output})
  357. Set SwScaler flags.
  358. @item -g @var{gop_size}
  359. Set the group of pictures size.
  360. @item -intra
  361. deprecated, use -g 1
  362. @item -vdt @var{n}
  363. Discard threshold.
  364. @item -qmin @var{q}
  365. minimum video quantizer scale (VBR)
  366. @item -qmax @var{q}
  367. maximum video quantizer scale (VBR)
  368. @item -qdiff @var{q}
  369. maximum difference between the quantizer scales (VBR)
  370. @item -qblur @var{blur}
  371. video quantizer scale blur (VBR) (range 0.0 - 1.0)
  372. @item -qcomp @var{compression}
  373. video quantizer scale compression (VBR) (default 0.5).
  374. Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
  375. @item -lmin @var{lambda}
  376. minimum video lagrange factor (VBR)
  377. @item -lmax @var{lambda}
  378. max video lagrange factor (VBR)
  379. @item -mblmin @var{lambda}
  380. minimum macroblock quantizer scale (VBR)
  381. @item -mblmax @var{lambda}
  382. maximum macroblock quantizer scale (VBR)
  383. These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
  384. but you may use the QP2LAMBDA constant to easily convert from 'q' units:
  385. @example
  386. ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  387. @end example
  388. @item -rc_init_cplx @var{complexity}
  389. initial complexity for single pass encoding
  390. @item -b_qfactor @var{factor}
  391. qp factor between P- and B-frames
  392. @item -i_qfactor @var{factor}
  393. qp factor between P- and I-frames
  394. @item -b_qoffset @var{offset}
  395. qp offset between P- and B-frames
  396. @item -i_qoffset @var{offset}
  397. qp offset between P- and I-frames
  398. @item -rc_eq @var{equation}
  399. Set rate control equation (see section "Expression Evaluation")
  400. (default = @code{tex^qComp}).
  401. When computing the rate control equation expression, besides the
  402. standard functions defined in the section "Expression Evaluation", the
  403. following functions are available:
  404. @table @var
  405. @item bits2qp(bits)
  406. @item qp2bits(qp)
  407. @end table
  408. and the following constants are available:
  409. @table @var
  410. @item iTex
  411. @item pTex
  412. @item tex
  413. @item mv
  414. @item fCode
  415. @item iCount
  416. @item mcVar
  417. @item var
  418. @item isI
  419. @item isP
  420. @item isB
  421. @item avgQP
  422. @item qComp
  423. @item avgIITex
  424. @item avgPITex
  425. @item avgPPTex
  426. @item avgBPTex
  427. @item avgTex
  428. @end table
  429. @item -rc_override[:@var{stream_specifier}] @var{override} (@emph{output,per-stream})
  430. Rate control override for specific intervals, formatted as "int,int,int"
  431. list separated with slashes. Two first values are the beginning and
  432. end frame numbers, last one is quantizer to use if positive, or quality
  433. factor if negative.
  434. @item -me_method @var{method}
  435. Set motion estimation method to @var{method}.
  436. Available methods are (from lowest to best quality):
  437. @table @samp
  438. @item zero
  439. Try just the (0, 0) vector.
  440. @item phods
  441. @item log
  442. @item x1
  443. @item hex
  444. @item umh
  445. @item epzs
  446. (default method)
  447. @item full
  448. exhaustive search (slow and marginally better than epzs)
  449. @end table
  450. @item -dct_algo @var{algo}
  451. Set DCT algorithm to @var{algo}. Available values are:
  452. @table @samp
  453. @item 0
  454. FF_DCT_AUTO (default)
  455. @item 1
  456. FF_DCT_FASTINT
  457. @item 2
  458. FF_DCT_INT
  459. @item 3
  460. FF_DCT_MMX
  461. @item 4
  462. FF_DCT_MLIB
  463. @item 5
  464. FF_DCT_ALTIVEC
  465. @end table
  466. @item -idct_algo @var{algo}
  467. Set IDCT algorithm to @var{algo}. Available values are:
  468. @table @samp
  469. @item 0
  470. FF_IDCT_AUTO (default)
  471. @item 1
  472. FF_IDCT_INT
  473. @item 2
  474. FF_IDCT_SIMPLE
  475. @item 3
  476. FF_IDCT_SIMPLEMMX
  477. @item 4
  478. FF_IDCT_LIBMPEG2MMX
  479. @item 5
  480. FF_IDCT_PS2
  481. @item 6
  482. FF_IDCT_MLIB
  483. @item 7
  484. FF_IDCT_ARM
  485. @item 8
  486. FF_IDCT_ALTIVEC
  487. @item 9
  488. FF_IDCT_SH4
  489. @item 10
  490. FF_IDCT_SIMPLEARM
  491. @end table
  492. @item -er @var{n}
  493. Set error resilience to @var{n}.
  494. @table @samp
  495. @item 1
  496. FF_ER_CAREFUL (default)
  497. @item 2
  498. FF_ER_COMPLIANT
  499. @item 3
  500. FF_ER_AGGRESSIVE
  501. @item 4
  502. FF_ER_VERY_AGGRESSIVE
  503. @end table
  504. @item -ec @var{bit_mask}
  505. Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
  506. the following values:
  507. @table @samp
  508. @item 1
  509. FF_EC_GUESS_MVS (default = enabled)
  510. @item 2
  511. FF_EC_DEBLOCK (default = enabled)
  512. @end table
  513. @item -bf @var{frames}
  514. Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
  515. @item -mbd @var{mode}
  516. macroblock decision
  517. @table @samp
  518. @item 0
  519. FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg).
  520. @item 1
  521. FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
  522. @item 2
  523. FF_MB_DECISION_RD: rate distortion
  524. @end table
  525. @item -4mv
  526. Use four motion vector by macroblock (MPEG-4 only).
  527. @item -part
  528. Use data partitioning (MPEG-4 only).
  529. @item -bug @var{param}
  530. Work around encoder bugs that are not auto-detected.
  531. @item -strict @var{strictness}
  532. How strictly to follow the standards.
  533. @item -aic
  534. Enable Advanced intra coding (h263+).
  535. @item -umv
  536. Enable Unlimited Motion Vector (h263+)
  537. @item -deinterlace
  538. Deinterlace pictures.
  539. @item -ilme
  540. Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
  541. Use this option if your input file is interlaced and you want
  542. to keep the interlaced format for minimum losses.
  543. The alternative is to deinterlace the input stream with
  544. @option{-deinterlace}, but deinterlacing introduces losses.
  545. @item -psnr
  546. Calculate PSNR of compressed frames.
  547. @item -vstats
  548. Dump video coding statistics to @file{vstats_HHMMSS.log}.
  549. @item -vstats_file @var{file}
  550. Dump video coding statistics to @var{file}.
  551. @item -top[:@var{stream_specifier}] @var{n} (@emph{output,per-stream})
  552. top=1/bottom=0/auto=-1 field first
  553. @item -dc @var{precision}
  554. Intra_dc_precision.
  555. @item -vtag @var{fourcc/tag} (@emph{output})
  556. Force video tag/fourcc. This is an alias for @code{-tag:v}.
  557. @item -qphist (@emph{global})
  558. Show QP histogram
  559. @item -vbsf @var{bitstream_filter}
  560. Deprecated see -bsf
  561. @item -force_key_frames[:@var{stream_specifier}] @var{time}[,@var{time}...] (@emph{output,per-stream})
  562. Force key frames at the specified timestamps, more precisely at the first
  563. frames after each specified time.
  564. This option can be useful to ensure that a seek point is present at a
  565. chapter mark or any other designated place in the output file.
  566. The timestamps must be specified in ascending order.
  567. @item -copyinkf[:@var{stream_specifier}] (@emph{output,per-stream})
  568. When doing stream copy, copy also non-key frames found at the
  569. beginning.
  570. @end table
  571. @section Audio Options
  572. @table @option
  573. @item -aframes @var{number} (@emph{output})
  574. Set the number of audio frames to record. This is an alias for @code{-frames:a}.
  575. @item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
  576. Set the audio sampling frequency. For output streams it is set by
  577. default to the frequency of the corresponding input stream. For input
  578. streams this option only makes sense for audio grabbing devices and raw
  579. demuxers and is mapped to the corresponding demuxer options.
  580. @item -aq @var{q} (@emph{output})
  581. Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  582. @item -ac[:@var{stream_specifier}] @var{channels} (@emph{input/output,per-stream})
  583. Set the number of audio channels. For output streams it is set by
  584. default to the number of input audio channels. For input streams
  585. this option only makes sense for audio grabbing devices and raw demuxers
  586. and is mapped to the corresponding demuxer options.
  587. @item -an (@emph{output})
  588. Disable audio recording.
  589. @item -acodec @var{codec} (@emph{input/output})
  590. Set the audio codec. This is an alias for @code{-codec:a}.
  591. @item -sample_fmt[:@var{stream_specifier}] @var{sample_fmt} (@emph{output,per-stream})
  592. Set the audio sample format. Use @code{-sample_fmts} to get a list
  593. of supported sample formats.
  594. @end table
  595. @section Advanced Audio options:
  596. @table @option
  597. @item -atag @var{fourcc/tag} (@emph{output})
  598. Force audio tag/fourcc. This is an alias for @code{-tag:a}.
  599. @item -audio_service_type @var{type}
  600. Set the type of service that the audio stream contains.
  601. @table @option
  602. @item ma
  603. Main Audio Service (default)
  604. @item ef
  605. Effects
  606. @item vi
  607. Visually Impaired
  608. @item hi
  609. Hearing Impaired
  610. @item di
  611. Dialogue
  612. @item co
  613. Commentary
  614. @item em
  615. Emergency
  616. @item vo
  617. Voice Over
  618. @item ka
  619. Karaoke
  620. @end table
  621. @item -absf @var{bitstream_filter}
  622. Deprecated, see -bsf
  623. @end table
  624. @section Subtitle options:
  625. @table @option
  626. @item -slang @var{code}
  627. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  628. @item -scodec @var{codec} (@emph{input/output})
  629. Set the subtitle codec. This is an alias for @code{-codec:s}.
  630. @item -sn (@emph{output})
  631. Disable subtitle recording.
  632. @item -sbsf @var{bitstream_filter}
  633. Deprecated, see -bsf
  634. @end table
  635. @section Audio/Video grab options
  636. @table @option
  637. @item -isync (@emph{global})
  638. Synchronize read on input.
  639. @end table
  640. @section Advanced options
  641. @table @option
  642. @item -map [-]@var{input_file_id}[:@var{stream_specifier}][,@var{sync_file_id}[:@var{stream_specifier}]] (@emph{output})
  643. Designate one or more input streams as a source for the output file. Each input
  644. stream is identified by the input file index @var{input_file_id} and
  645. the input stream index @var{input_stream_id} within the input
  646. file. Both indices start at 0. If specified,
  647. @var{sync_file_id}:@var{stream_specifier} sets which input stream
  648. is used as a presentation sync reference.
  649. The first @code{-map} option on the command line specifies the
  650. source for output stream 0, the second @code{-map} option specifies
  651. the source for output stream 1, etc.
  652. A @code{-} character before the stream identifier creates a "negative" mapping.
  653. It disables matching streams from already created mappings.
  654. For example, to map ALL streams from the first input file to output
  655. @example
  656. ffmpeg -i INPUT -map 0 output
  657. @end example
  658. For example, if you have two audio streams in the first input file,
  659. these streams are identified by "0:0" and "0:1". You can use
  660. @code{-map} to select which streams to place in an output file. For
  661. example:
  662. @example
  663. ffmpeg -i INPUT -map 0:1 out.wav
  664. @end example
  665. will map the input stream in @file{INPUT} identified by "0:1" to
  666. the (single) output stream in @file{out.wav}.
  667. For example, to select the stream with index 2 from input file
  668. @file{a.mov} (specified by the identifier "0:2"), and stream with
  669. index 6 from input @file{b.mov} (specified by the identifier "1:6"),
  670. and copy them to the output file @file{out.mov}:
  671. @example
  672. ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  673. @end example
  674. To select all video and the third audio stream from an input file:
  675. @example
  676. ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  677. @end example
  678. To map all the streams except the second audio, use negative mappings
  679. @example
  680. ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  681. @end example
  682. Note that using this option disables the default mappings for this output file.
  683. @item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
  684. Map an audio channel from a given input to an output. If
  685. @var{output_file_id}.@var{stream_specifier} are not set, the audio channel will
  686. be mapped on all the audio streams.
  687. Using "-1" instead of
  688. @var{input_file_id}.@var{stream_specifier}.@var{channel_id} will map a muted
  689. channel.
  690. For example, assuming @var{INPUT} is a stereo audio file, you can switch the
  691. two audio channels with the following command:
  692. @example
  693. ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
  694. @end example
  695. If you want to mute the first channel and keep the second:
  696. @example
  697. ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
  698. @end example
  699. The order of the "-map_channel" option specifies the order of the channels in
  700. the output stream. The output channel layout is guessed from the number of
  701. channels mapped (mono if one "-map_channel", stereo if two, etc.). Using "-ac"
  702. in combination of "-map_channel" makes the channel gain levels to be updated if
  703. channel layouts don't match (for instance two "-map_channel" options and "-ac
  704. 6").
  705. You can also extract each channel of an @var{INPUT} to specific outputs; the
  706. following command extract each channel of the audio stream (file 0, stream 0)
  707. to the respective @var{OUTPUT_CH0} and @var{OUTPUT_CH1}:
  708. @example
  709. ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
  710. @end example
  711. The following example split the channels of a stereo input into streams:
  712. @example
  713. ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
  714. @end example
  715. Note that "-map_channel" is currently limited to the scope of one input for
  716. each output; you can't for example use it to pick multiple input audio files
  717. and mix them into one single output.
  718. @item -map_metadata[:@var{metadata_type}][:@var{index}] @var{infile}[:@var{metadata_type}][:@var{index}] (@emph{output,per-metadata})
  719. Set metadata information of the next output file from @var{infile}. Note that
  720. those are file indices (zero-based), not filenames.
  721. Optional @var{metadata_type} parameters specify, which metadata to copy - (g)lobal
  722. (i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
  723. per-(p)rogram. All metadata specifiers other than global must be followed by the
  724. stream/chapter/program index. If metadata specifier is omitted, it defaults to
  725. global.
  726. By default, global metadata is copied from the first input file,
  727. per-stream and per-chapter metadata is copied along with streams/chapters. These
  728. default mappings are disabled by creating any mapping of the relevant type. A negative
  729. file index can be used to create a dummy mapping that just disables automatic copying.
  730. For example to copy metadata from the first stream of the input file to global metadata
  731. of the output file:
  732. @example
  733. ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  734. @end example
  735. @item -map_chapters @var{input_file_index} (@emph{output})
  736. Copy chapters from input file with index @var{input_file_index} to the next
  737. output file. If no chapter mapping is specified, then chapters are copied from
  738. the first input file with at least one chapter. Use a negative file index to
  739. disable any chapter copying.
  740. @item -debug @var{category}
  741. Print specific debug info.
  742. @var{category} is a number or a string containing one of the following values:
  743. @table @samp
  744. @item bitstream
  745. @item buffers
  746. picture buffer allocations
  747. @item bugs
  748. @item dct_coeff
  749. @item er
  750. error recognition
  751. @item mb_type
  752. macroblock (MB) type
  753. @item mmco
  754. memory management control operations (H.264)
  755. @item mv
  756. motion vector
  757. @item pict
  758. picture info
  759. @item pts
  760. @item qp
  761. per-block quantization parameter (QP)
  762. @item rc
  763. rate control
  764. @item skip
  765. @item startcode
  766. @item thread_ops
  767. threading operations
  768. @item vis_mb_type
  769. visualize block types
  770. @item vis_qp
  771. visualize quantization parameter (QP), lower QP are tinted greener
  772. @end table
  773. @item -benchmark (@emph{global})
  774. Show benchmarking information at the end of an encode.
  775. Shows CPU time used and maximum memory consumption.
  776. Maximum memory consumption is not supported on all systems,
  777. it will usually display as 0 if not supported.
  778. @item -timelimit @var{duration} (@emph{global})
  779. Exit after ffmpeg has been running for @var{duration} seconds.
  780. @item -dump (@emph{global})
  781. Dump each input packet to stderr.
  782. @item -hex (@emph{global})
  783. When dumping packets, also dump the payload.
  784. @item -ps @var{size}
  785. Set RTP payload size in bytes.
  786. @item -re (@emph{input})
  787. Read input at native frame rate. Mainly used to simulate a grab device.
  788. @item -loop_input
  789. Loop over the input stream. Currently it works only for image
  790. streams. This option is used for automatic FFserver testing.
  791. This option is deprecated, use -loop 1.
  792. @item -loop_output @var{number_of_times}
  793. Repeatedly loop output for formats that support looping such as animated GIF
  794. (0 will loop the output infinitely).
  795. This option is deprecated, use -loop.
  796. @item -threads @var{count}
  797. Thread count.
  798. @item -vsync @var{parameter}
  799. Video sync method.
  800. @table @option
  801. @item 0
  802. Each frame is passed with its timestamp from the demuxer to the muxer.
  803. @item 1
  804. Frames will be duplicated and dropped to achieve exactly the requested
  805. constant framerate.
  806. @item 2
  807. Frames are passed through with their timestamp or dropped so as to
  808. prevent 2 frames from having the same timestamp.
  809. @item -1
  810. Chooses between 1 and 2 depending on muxer capabilities. This is the
  811. default method.
  812. @end table
  813. With -map you can select from which stream the timestamps should be
  814. taken. You can leave either video or audio unchanged and sync the
  815. remaining stream(s) to the unchanged one.
  816. @item -async @var{samples_per_second}
  817. Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
  818. the parameter is the maximum samples per second by which the audio is changed.
  819. -async 1 is a special case where only the start of the audio stream is corrected
  820. without any later correction.
  821. @item -copyts
  822. Copy timestamps from input to output.
  823. @item -copytb
  824. Copy input stream time base from input to output when stream copying.
  825. @item -shortest
  826. Finish encoding when the shortest input stream ends.
  827. @item -dts_delta_threshold
  828. Timestamp discontinuity delta threshold.
  829. @item -muxdelay @var{seconds} (@emph{input})
  830. Set the maximum demux-decode delay.
  831. @item -muxpreload @var{seconds} (@emph{input})
  832. Set the initial demux-decode delay.
  833. @item -streamid @var{output-stream-index}:@var{new-value} (@emph{output})
  834. Assign a new stream-id value to an output stream. This option should be
  835. specified prior to the output filename to which it applies.
  836. For the situation where multiple output files exist, a streamid
  837. may be reassigned to a different value.
  838. For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  839. an output mpegts file:
  840. @example
  841. ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
  842. @end example
  843. @item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
  844. Set bitstream filters for matching streams. @var{bistream_filters} is
  845. a comma-separated list of bitstream filters. Use the @code{-bsfs} option
  846. to get the list of bitstream filters.
  847. @example
  848. ffmpeg -i h264.mp4 -c:v copy -vbsf h264_mp4toannexb -an out.h264
  849. @end example
  850. @example
  851. ffmpeg -i file.mov -an -vn -sbsf mov2textsub -c:s copy -f rawvideo sub.txt
  852. @end example
  853. @item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{per-stream})
  854. Force a tag/fourcc for matching streams.
  855. @end table
  856. @section Preset files
  857. A preset file contains a sequence of @var{option}=@var{value} pairs,
  858. one for each line, specifying a sequence of options which would be
  859. awkward to specify on the command line. Lines starting with the hash
  860. ('#') character are ignored and are used to provide comments. Check
  861. the @file{presets} directory in the FFmpeg source tree for examples.
  862. Preset files are specified with the @code{vpre}, @code{apre},
  863. @code{spre}, and @code{fpre} options. The @code{fpre} option takes the
  864. filename of the preset instead of a preset name as input and can be
  865. used for any kind of codec. For the @code{vpre}, @code{apre}, and
  866. @code{spre} options, the options specified in a preset file are
  867. applied to the currently selected codec of the same type as the preset
  868. option.
  869. The argument passed to the @code{vpre}, @code{apre}, and @code{spre}
  870. preset options identifies the preset file to use according to the
  871. following rules:
  872. First ffmpeg searches for a file named @var{arg}.ffpreset in the
  873. directories @file{$FFMPEG_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
  874. the datadir defined at configuration time (usually @file{PREFIX/share/ffmpeg})
  875. or in a @file{ffpresets} folder along the executable on win32,
  876. in that order. For example, if the argument is @code{libx264-max}, it will
  877. search for the file @file{libx264-max.ffpreset}.
  878. If no such file is found, then ffmpeg will search for a file named
  879. @var{codec_name}-@var{arg}.ffpreset in the above-mentioned
  880. directories, where @var{codec_name} is the name of the codec to which
  881. the preset file options will be applied. For example, if you select
  882. the video codec with @code{-vcodec libx264} and use @code{-vpre max},
  883. then it will search for the file @file{libx264-max.ffpreset}.
  884. @c man end OPTIONS
  885. @chapter Tips
  886. @c man begin TIPS
  887. @itemize
  888. @item
  889. For streaming at very low bitrate application, use a low frame rate
  890. and a small GOP size. This is especially true for RealVideo where
  891. the Linux player does not seem to be very fast, so it can miss
  892. frames. An example is:
  893. @example
  894. ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
  895. @end example
  896. @item
  897. The parameter 'q' which is displayed while encoding is the current
  898. quantizer. The value 1 indicates that a very good quality could
  899. be achieved. The value 31 indicates the worst quality. If q=31 appears
  900. too often, it means that the encoder cannot compress enough to meet
  901. your bitrate. You must either increase the bitrate, decrease the
  902. frame rate or decrease the frame size.
  903. @item
  904. If your computer is not fast enough, you can speed up the
  905. compression at the expense of the compression ratio. You can use
  906. '-me zero' to speed up motion estimation, and '-intra' to disable
  907. motion estimation completely (you have only I-frames, which means it
  908. is about as good as JPEG compression).
  909. @item
  910. To have very low audio bitrates, reduce the sampling frequency
  911. (down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
  912. @item
  913. To have a constant quality (but a variable bitrate), use the option
  914. '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
  915. quality).
  916. @end itemize
  917. @c man end TIPS
  918. @chapter Examples
  919. @c man begin EXAMPLES
  920. @section Preset files
  921. A preset file contains a sequence of @var{option=value} pairs, one for
  922. each line, specifying a sequence of options which can be specified also on
  923. the command line. Lines starting with the hash ('#') character are ignored and
  924. are used to provide comments. Empty lines are also ignored. Check the
  925. @file{presets} directory in the FFmpeg source tree for examples.
  926. Preset files are specified with the @code{pre} option, this option takes a
  927. preset name as input. FFmpeg searches for a file named @var{preset_name}.avpreset in
  928. the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
  929. the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg})
  930. in that order. For example, if the argument is @code{libx264-max}, it will
  931. search for the file @file{libx264-max.avpreset}.
  932. @section Video and Audio grabbing
  933. If you specify the input format and device then ffmpeg can grab video
  934. and audio directly.
  935. @example
  936. ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  937. @end example
  938. Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  939. @example
  940. ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  941. @end example
  942. Note that you must activate the right video source and channel before
  943. launching ffmpeg with any TV viewer such as
  944. @uref{http://linux.bytesex.org/xawtv/, xawtv} by Gerd Knorr. You also
  945. have to set the audio recording levels correctly with a
  946. standard mixer.
  947. @section X11 grabbing
  948. Grab the X11 display with ffmpeg via
  949. @example
  950. ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
  951. @end example
  952. 0.0 is display.screen number of your X11 server, same as
  953. the DISPLAY environment variable.
  954. @example
  955. ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
  956. @end example
  957. 0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  958. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  959. @section Video and Audio file format conversion
  960. Any supported file format and protocol can serve as input to ffmpeg:
  961. Examples:
  962. @itemize
  963. @item
  964. You can use YUV files as input:
  965. @example
  966. ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  967. @end example
  968. It will use the files:
  969. @example
  970. /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  971. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  972. @end example
  973. The Y files use twice the resolution of the U and V files. They are
  974. raw files, without header. They can be generated by all decent video
  975. decoders. You must specify the size of the image with the @option{-s} option
  976. if ffmpeg cannot guess it.
  977. @item
  978. You can input from a raw YUV420P file:
  979. @example
  980. ffmpeg -i /tmp/test.yuv /tmp/out.avi
  981. @end example
  982. test.yuv is a file containing raw YUV planar data. Each frame is composed
  983. of the Y plane followed by the U and V planes at half vertical and
  984. horizontal resolution.
  985. @item
  986. You can output to a raw YUV420P file:
  987. @example
  988. ffmpeg -i mydivx.avi hugefile.yuv
  989. @end example
  990. @item
  991. You can set several input files and output files:
  992. @example
  993. ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  994. @end example
  995. Converts the audio file a.wav and the raw YUV video file a.yuv
  996. to MPEG file a.mpg.
  997. @item
  998. You can also do audio and video conversions at the same time:
  999. @example
  1000. ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  1001. @end example
  1002. Converts a.wav to MPEG audio at 22050 Hz sample rate.
  1003. @item
  1004. You can encode to several formats at the same time and define a
  1005. mapping from input stream to output streams:
  1006. @example
  1007. ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
  1008. @end example
  1009. Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
  1010. file:index' specifies which input stream is used for each output
  1011. stream, in the order of the definition of output streams.
  1012. @item
  1013. You can transcode decrypted VOBs:
  1014. @example
  1015. ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
  1016. @end example
  1017. This is a typical DVD ripping example; the input is a VOB file, the
  1018. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  1019. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  1020. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  1021. input video. Furthermore, the audio stream is MP3-encoded so you need
  1022. to enable LAME support by passing @code{--enable-libmp3lame} to configure.
  1023. The mapping is particularly useful for DVD transcoding
  1024. to get the desired audio language.
  1025. NOTE: To see the supported input formats, use @code{ffmpeg -formats}.
  1026. @item
  1027. You can extract images from a video, or create a video from many images:
  1028. For extracting images from a video:
  1029. @example
  1030. ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  1031. @end example
  1032. This will extract one video frame per second from the video and will
  1033. output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg},
  1034. etc. Images will be rescaled to fit the new WxH values.
  1035. If you want to extract just a limited number of frames, you can use the
  1036. above command in combination with the -vframes or -t option, or in
  1037. combination with -ss to start extracting from a certain point in time.
  1038. For creating a video from many images:
  1039. @example
  1040. ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
  1041. @end example
  1042. The syntax @code{foo-%03d.jpeg} specifies to use a decimal number
  1043. composed of three digits padded with zeroes to express the sequence
  1044. number. It is the same syntax supported by the C printf function, but
  1045. only formats accepting a normal integer are suitable.
  1046. @item
  1047. You can put many streams of the same type in the output:
  1048. @example
  1049. ffmpeg -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
  1050. @end example
  1051. The resulting output file @file{test12.avi} will contain first four streams from
  1052. the input file in reverse order.
  1053. @end itemize
  1054. @c man end EXAMPLES
  1055. @include eval.texi
  1056. @include decoders.texi
  1057. @include encoders.texi
  1058. @include demuxers.texi
  1059. @include muxers.texi
  1060. @include indevs.texi
  1061. @include outdevs.texi
  1062. @include protocols.texi
  1063. @include bitstream_filters.texi
  1064. @include filters.texi
  1065. @include metadata.texi
  1066. @ignore
  1067. @setfilename ffmpeg
  1068. @settitle ffmpeg video converter
  1069. @c man begin SEEALSO
  1070. ffplay(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
  1071. @c man end
  1072. @c man begin AUTHORS
  1073. See git history
  1074. @c man end
  1075. @end ignore
  1076. @bye