You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

868 lines
22KB

  1. \input texinfo @c -*- texinfo -*-
  2. @settitle FFmpeg Documentation
  3. @titlepage
  4. @sp 7
  5. @center @titlefont{FFmpeg Documentation}
  6. @sp 3
  7. @end titlepage
  8. @chapter Introduction
  9. FFmpeg is a very fast video and audio converter. It can also grab from
  10. a live audio/video source.
  11. The command line interface is designed to be intuitive, in the sense
  12. that FFmpeg tries to figure out all parameters that can possibly be
  13. derived automatically. You usually only have to specify the target
  14. bitrate you want.
  15. FFmpeg can also convert from any sample rate to any other, and resize
  16. video on the fly with a high quality polyphase filter.
  17. @chapter Quick Start
  18. @c man begin EXAMPLES
  19. @section Video and Audio grabbing
  20. FFmpeg can grab video and audio from devices given that you specify the input
  21. format and device.
  22. @example
  23. ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  24. @end example
  25. Note that you must activate the right video source and channel before
  26. launching FFmpeg with any TV viewer such as xawtv
  27. (@url{http://bytesex.org/xawtv/}) by Gerd Knorr. You also
  28. have to set the audio recording levels correctly with a
  29. standard mixer.
  30. @section X11 grabbing
  31. FFmpeg can grab the X11 display.
  32. @example
  33. ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg
  34. @end example
  35. 0.0 is display.screen number of your X11 server, same as
  36. the DISPLAY environment variable.
  37. @example
  38. ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg
  39. @end example
  40. 0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  41. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  42. @section Video and Audio file format conversion
  43. * FFmpeg can use any supported file format and protocol as input:
  44. Examples:
  45. * You can use YUV files as input:
  46. @example
  47. ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  48. @end example
  49. It will use the files:
  50. @example
  51. /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  52. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  53. @end example
  54. The Y files use twice the resolution of the U and V files. They are
  55. raw files, without header. They can be generated by all decent video
  56. decoders. You must specify the size of the image with the @option{-s} option
  57. if FFmpeg cannot guess it.
  58. * You can input from a raw YUV420P file:
  59. @example
  60. ffmpeg -i /tmp/test.yuv /tmp/out.avi
  61. @end example
  62. test.yuv is a file containing raw YUV planar data. Each frame is composed
  63. of the Y plane followed by the U and V planes at half vertical and
  64. horizontal resolution.
  65. * You can output to a raw YUV420P file:
  66. @example
  67. ffmpeg -i mydivx.avi hugefile.yuv
  68. @end example
  69. * You can set several input files and output files:
  70. @example
  71. ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  72. @end example
  73. Converts the audio file a.wav and the raw YUV video file a.yuv
  74. to MPEG file a.mpg.
  75. * You can also do audio and video conversions at the same time:
  76. @example
  77. ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  78. @end example
  79. Converts a.wav to MPEG audio at 22050Hz sample rate.
  80. * You can encode to several formats at the same time and define a
  81. mapping from input stream to output streams:
  82. @example
  83. ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
  84. @end example
  85. Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
  86. file:index' specifies which input stream is used for each output
  87. stream, in the order of the definition of output streams.
  88. * You can transcode decrypted VOBs:
  89. @example
  90. ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
  91. @end example
  92. This is a typical DVD ripping example; the input is a VOB file, the
  93. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  94. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  95. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  96. input video. Furthermore, the audio stream is MP3-encoded so you need
  97. to enable LAME support by passing @code{--enable-libmp3lame} to configure.
  98. The mapping is particularly useful for DVD transcoding
  99. to get the desired audio language.
  100. NOTE: To see the supported input formats, use @code{ffmpeg -formats}.
  101. @c man end
  102. @chapter Invocation
  103. @section Syntax
  104. The generic syntax is:
  105. @example
  106. @c man begin SYNOPSIS
  107. ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
  108. @c man end
  109. @end example
  110. @c man begin DESCRIPTION
  111. As a general rule, options are applied to the next specified
  112. file. Therefore, order is important, and you can have the same
  113. option on the command line multiple times. Each occurrence is
  114. then applied to the next input or output file.
  115. * To set the video bitrate of the output file to 64kbit/s:
  116. @example
  117. ffmpeg -i input.avi -b 64k output.avi
  118. @end example
  119. * To force the frame rate of the input and output file to 24 fps:
  120. @example
  121. ffmpeg -r 24 -i input.avi output.avi
  122. @end example
  123. * To force the frame rate of the output file to 24 fps:
  124. @example
  125. ffmpeg -i input.avi -r 24 output.avi
  126. @end example
  127. * To force the frame rate of input file to 1 fps and the output file to 24 fps:
  128. @example
  129. ffmpeg -r 1 -i input.avi -r 24 output.avi
  130. @end example
  131. The format option may be needed for raw input files.
  132. By default, FFmpeg tries to convert as losslessly as possible: It
  133. uses the same audio and video parameters for the outputs as the one
  134. specified for the inputs.
  135. @c man end
  136. @c man begin OPTIONS
  137. @section Main options
  138. @table @option
  139. @item -L
  140. Show license.
  141. @item -h
  142. Show help.
  143. @item -version
  144. Show version.
  145. @item -formats
  146. Show available formats, codecs, protocols, ...
  147. @item -f @var{fmt}
  148. Force format.
  149. @item -i @var{filename}
  150. input file name
  151. @item -y
  152. Overwrite output files.
  153. @item -t @var{duration}
  154. Restrict the transcoded/captured video sequence
  155. to the duration specified in seconds.
  156. @code{hh:mm:ss[.xxx]} syntax is also supported.
  157. @item -fs @var{limit_size}
  158. Set the file size limit.
  159. @item -ss @var{position}
  160. Seek to given time position in seconds.
  161. @code{hh:mm:ss[.xxx]} syntax is also supported.
  162. @item -itsoffset @var{offset}
  163. Set the input time offset in seconds.
  164. @code{[-]hh:mm:ss[.xxx]} syntax is also supported.
  165. This option affects all the input files that follow it.
  166. The offset is added to the timestamps of the input files.
  167. Specifying a positive offset means that the corresponding
  168. streams are delayed by 'offset' seconds.
  169. @item -title @var{string}
  170. Set the title.
  171. @item -timestamp @var{time}
  172. Set the timestamp.
  173. @item -author @var{string}
  174. Set the author.
  175. @item -copyright @var{string}
  176. Set the copyright.
  177. @item -comment @var{string}
  178. Set the comment.
  179. @item -album @var{string}
  180. Set the album.
  181. @item -track @var{number}
  182. Set the track.
  183. @item -year @var{number}
  184. Set the year.
  185. @item -v @var{number}
  186. Set the logging verbosity level.
  187. @item -target @var{type}
  188. Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
  189. "ntsc-svcd", ... ). All the format options (bitrate, codecs,
  190. buffer sizes) are then set automatically. You can just type:
  191. @example
  192. ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  193. @end example
  194. Nevertheless you can specify additional options as long as you know
  195. they do not conflict with the standard, as in:
  196. @example
  197. ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  198. @end example
  199. @item -dframes @var{number}
  200. Set the number of data frames to record.
  201. @item -scodec @var{codec}
  202. Force subtitle codec ('copy' to copy stream).
  203. @item -newsubtitle
  204. Add a new subtitle stream to the current output stream.
  205. @item -slang @var{code}
  206. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  207. @end table
  208. @section Video Options
  209. @table @option
  210. @item -b @var{bitrate}
  211. Set the video bitrate in bit/s (default = 200 kb/s).
  212. @item -vframes @var{number}
  213. Set the number of video frames to record.
  214. @item -r @var{fps}
  215. Set frame rate (Hz value, fraction or abbreviation), (default = 25).
  216. @item -s @var{size}
  217. Set frame size. The format is @samp{wxh} (ffserver default = 160x128, ffmpeg default = same as source).
  218. The following abbreviations are recognized:
  219. @table @samp
  220. @item sqcif
  221. 128x96
  222. @item qcif
  223. 176x144
  224. @item cif
  225. 352x288
  226. @item 4cif
  227. 704x576
  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{aspect}
  278. Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777).
  279. @item -croptop @var{size}
  280. Set top crop band size (in pixels).
  281. @item -cropbottom @var{size}
  282. Set bottom crop band size (in pixels).
  283. @item -cropleft @var{size}
  284. Set left crop band size (in pixels).
  285. @item -cropright @var{size}
  286. Set right crop band size (in pixels).
  287. @item -padtop @var{size}
  288. Set top pad band size (in pixels).
  289. @item -padbottom @var{size}
  290. Set bottom pad band size (in pixels).
  291. @item -padleft @var{size}
  292. Set left pad band size (in pixels).
  293. @item -padright @var{size}
  294. Set right pad band size (in pixels).
  295. @item -padcolor @var{hex_color}
  296. Set color of padded bands. The value for padcolor is expressed
  297. as a six digit hexadecimal number where the first two digits
  298. represent red, the middle two digits green and last two digits
  299. blue (default = 000000 (black)).
  300. @item -vn
  301. Disable video recording.
  302. @item -bt @var{tolerance}
  303. Set video bitrate tolerance (in bit/s).
  304. @item -maxrate @var{bitrate}
  305. Set max video bitrate (in bit/s).
  306. Requires -bufsize to be set.
  307. @item -minrate @var{bitrate}
  308. Set min video bitrate (in bit/s).
  309. Most useful in setting up a CBR encode:
  310. @example
  311. ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  312. @end example
  313. It is of little use elsewise.
  314. @item -bufsize @var{size}
  315. Set video buffer verifier buffer size (in bits).
  316. @item -vcodec @var{codec}
  317. Force video codec to @var{codec}. Use the @code{copy} special value to
  318. tell that the raw codec data must be copied as is.
  319. @item -sameq
  320. Use same video quality as source (implies VBR).
  321. @item -pass @var{n}
  322. Select the pass number (1 or 2). It is useful to do two pass
  323. encoding. The statistics of the video are recorded in the first
  324. pass and the video is generated at the exact requested bitrate
  325. in the second pass.
  326. @item -passlogfile @var{file}
  327. Set two pass logfile name to @var{file}.
  328. @item -newvideo
  329. Add a new video stream to the current output stream.
  330. @end table
  331. @section Advanced Video Options
  332. @table @option
  333. @item -pix_fmt @var{format}
  334. Set pixel format. Use 'list' as parameter to show all the supported
  335. pixel formats.
  336. @item -sws_flags @var{flags}
  337. Set SwScaler flags (only available when compiled with swscale support).
  338. @item -g @var{gop_size}
  339. Set the group of pictures size.
  340. @item -intra
  341. Use only intra frames.
  342. @item -vdt @var{n}
  343. Discard threshold.
  344. @item -qscale @var{q}
  345. Use fixed video quantizer scale (VBR).
  346. @item -qmin @var{q}
  347. minimum video quantizer scale (VBR)
  348. @item -qmax @var{q}
  349. maximum video quantizer scale (VBR)
  350. @item -qdiff @var{q}
  351. maximum difference between the quantizer scales (VBR)
  352. @item -qblur @var{blur}
  353. video quantizer scale blur (VBR)
  354. @item -qcomp @var{compression}
  355. video quantizer scale compression (VBR)
  356. @item -lmin @var{lambda}
  357. minimum video lagrange factor (VBR)
  358. @item -lmax @var{lambda}
  359. max video lagrange factor (VBR)
  360. @item -mblmin @var{lambda}
  361. minimum macroblock quantizer scale (VBR)
  362. @item -mblmax @var{lambda}
  363. maximum macroblock quantizer scale (VBR)
  364. These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
  365. but you may use the QP2LAMBDA constant to easily convert from 'q' units:
  366. @example
  367. ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  368. @end example
  369. @item -rc_init_cplx @var{complexity}
  370. initial complexity for single pass encoding
  371. @item -b_qfactor @var{factor}
  372. qp factor between P- and B-frames
  373. @item -i_qfactor @var{factor}
  374. qp factor between P- and I-frames
  375. @item -b_qoffset @var{offset}
  376. qp offset between P- and B-frames
  377. @item -i_qoffset @var{offset}
  378. qp offset between P- and I-frames
  379. @item -rc_eq @var{equation}
  380. Set rate control equation (@pxref{FFmpeg formula
  381. evaluator}) (default = @code{tex^qComp}).
  382. @item -rc_override @var{override}
  383. rate control override for specific intervals
  384. @item -me_method @var{method}
  385. Set motion estimation method to @var{method}.
  386. Available methods are (from lowest to best quality):
  387. @table @samp
  388. @item zero
  389. Try just the (0, 0) vector.
  390. @item phods
  391. @item log
  392. @item x1
  393. @item hex
  394. @item umh
  395. @item epzs
  396. (default method)
  397. @item full
  398. exhaustive search (slow and marginally better than epzs)
  399. @end table
  400. @item -dct_algo @var{algo}
  401. Set DCT algorithm to @var{algo}. Available values are:
  402. @table @samp
  403. @item 0
  404. FF_DCT_AUTO (default)
  405. @item 1
  406. FF_DCT_FASTINT
  407. @item 2
  408. FF_DCT_INT
  409. @item 3
  410. FF_DCT_MMX
  411. @item 4
  412. FF_DCT_MLIB
  413. @item 5
  414. FF_DCT_ALTIVEC
  415. @end table
  416. @item -idct_algo @var{algo}
  417. Set IDCT algorithm to @var{algo}. Available values are:
  418. @table @samp
  419. @item 0
  420. FF_IDCT_AUTO (default)
  421. @item 1
  422. FF_IDCT_INT
  423. @item 2
  424. FF_IDCT_SIMPLE
  425. @item 3
  426. FF_IDCT_SIMPLEMMX
  427. @item 4
  428. FF_IDCT_LIBMPEG2MMX
  429. @item 5
  430. FF_IDCT_PS2
  431. @item 6
  432. FF_IDCT_MLIB
  433. @item 7
  434. FF_IDCT_ARM
  435. @item 8
  436. FF_IDCT_ALTIVEC
  437. @item 9
  438. FF_IDCT_SH4
  439. @item 10
  440. FF_IDCT_SIMPLEARM
  441. @end table
  442. @item -er @var{n}
  443. Set error resilience to @var{n}.
  444. @table @samp
  445. @item 1
  446. FF_ER_CAREFUL (default)
  447. @item 2
  448. FF_ER_COMPLIANT
  449. @item 3
  450. FF_ER_AGGRESSIVE
  451. @item 4
  452. FF_ER_VERY_AGGRESSIVE
  453. @end table
  454. @item -ec @var{bit_mask}
  455. Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
  456. the following values:
  457. @table @samp
  458. @item 1
  459. FF_EC_GUESS_MVS (default = enabled)
  460. @item 2
  461. FF_EC_DEBLOCK (default = enabled)
  462. @end table
  463. @item -bf @var{frames}
  464. Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
  465. @item -mbd @var{mode}
  466. macroblock decision
  467. @table @samp
  468. @item 0
  469. FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
  470. @item 1
  471. FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
  472. @item 2
  473. FF_MB_DECISION_RD: rate distortion
  474. @end table
  475. @item -4mv
  476. Use four motion vector by macroblock (MPEG-4 only).
  477. @item -part
  478. Use data partitioning (MPEG-4 only).
  479. @item -bug @var{param}
  480. Work around encoder bugs that are not auto-detected.
  481. @item -strict @var{strictness}
  482. How strictly to follow the standards.
  483. @item -aic
  484. Enable Advanced intra coding (h263+).
  485. @item -umv
  486. Enable Unlimited Motion Vector (h263+)
  487. @item -deinterlace
  488. Deinterlace pictures.
  489. @item -ilme
  490. Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
  491. Use this option if your input file is interlaced and you want
  492. to keep the interlaced format for minimum losses.
  493. The alternative is to deinterlace the input stream with
  494. @option{-deinterlace}, but deinterlacing introduces losses.
  495. @item -psnr
  496. Calculate PSNR of compressed frames.
  497. @item -vstats
  498. Dump video coding statistics to @file{vstats_HHMMSS.log}.
  499. @item -vstats_file @var{file}
  500. Dump video coding statistics to @var{file}.
  501. @item -vhook @var{module}
  502. Insert video processing @var{module}. @var{module} contains the module
  503. name and its parameters separated by spaces.
  504. @item -top @var{n}
  505. top=1/bottom=0/auto=-1 field first
  506. @item -dc @var{precision}
  507. Intra_dc_precision.
  508. @item -vtag @var{fourcc/tag}
  509. Force video tag/fourcc.
  510. @item -qphist
  511. Show QP histogram.
  512. @item -vbsf @var{bitstream_filter}
  513. Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump".
  514. @example
  515. ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
  516. @end example
  517. @end table
  518. @section Audio Options
  519. @table @option
  520. @item -aframes @var{number}
  521. Set the number of audio frames to record.
  522. @item -ar @var{freq}
  523. Set the audio sampling frequency (default = 44100 Hz).
  524. @item -ab @var{bitrate}
  525. Set the audio bitrate in bit/s (default = 64k).
  526. @item -ac @var{channels}
  527. Set the number of audio channels (default = 1).
  528. @item -an
  529. Disable audio recording.
  530. @item -acodec @var{codec}
  531. Force audio codec to @var{codec}. Use the @code{copy} special value to
  532. specify that the raw codec data must be copied as is.
  533. @item -newaudio
  534. Add a new audio track to the output file. If you want to specify parameters,
  535. do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..).
  536. Mapping will be done automatically, if the number of output streams is equal to
  537. the number of input streams, else it will pick the first one that matches. You
  538. can override the mapping using @code{-map} as usual.
  539. Example:
  540. @example
  541. ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
  542. @end example
  543. @item -alang @var{code}
  544. Set the ISO 639 language code (3 letters) of the current audio stream.
  545. @end table
  546. @section Advanced Audio options:
  547. @table @option
  548. @item -atag @var{fourcc/tag}
  549. Force audio tag/fourcc.
  550. @item -absf @var{bitstream_filter}
  551. Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
  552. @end table
  553. @section Subtitle options:
  554. @table @option
  555. @item -scodec @var{codec}
  556. Force subtitle codec ('copy' to copy stream).
  557. @item -newsubtitle
  558. Add a new subtitle stream to the current output stream.
  559. @item -slang @var{code}
  560. Set the ISO 639 language code (3 letters) of the current subtitle stream.
  561. @item -sbsf @var{bitstream_filter}
  562. Bitstream filters available are "mov2textsub", "text2movsub".
  563. @example
  564. ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
  565. @end example
  566. @end table
  567. @section Audio/Video grab options
  568. @table @option
  569. @item -vc @var{channel}
  570. Set video grab channel (DV1394 only).
  571. @item -tvstd @var{standard}
  572. Set television standard (NTSC, PAL (SECAM)).
  573. @item -isync
  574. Synchronize read on input.
  575. @end table
  576. @section Advanced options
  577. @table @option
  578. @item -map input stream id[:input stream id]
  579. Set stream mapping from input streams to output streams.
  580. Just enumerate the input streams in the order you want them in the output.
  581. [input stream id] sets the (input) stream to sync against.
  582. @item -map_meta_data @var{outfile}:@var{infile}
  583. Set meta data information of @var{outfile} from @var{infile}.
  584. @item -debug
  585. Print specific debug info.
  586. @item -benchmark
  587. Add timings for benchmarking.
  588. @item -dump
  589. Dump each input packet.
  590. @item -hex
  591. When dumping packets, also dump the payload.
  592. @item -bitexact
  593. Only use bit exact algorithms (for codec testing).
  594. @item -ps @var{size}
  595. Set packet size in bits.
  596. @item -re
  597. Read input at native frame rate. Mainly used to simulate a grab device.
  598. @item -loop_input
  599. Loop over the input stream. Currently it works only for image
  600. streams. This option is used for automatic FFserver testing.
  601. @item -loop_output @var{number_of_times}
  602. Repeatedly loop output for formats that support looping such as animated GIF
  603. (0 will loop the output infinitely).
  604. @item -threads @var{count}
  605. Thread count.
  606. @item -vsync @var{parameter}
  607. Video sync method. Video will be stretched/squeezed to match the timestamps,
  608. it is done by duplicating and dropping frames. With -map you can select from
  609. which stream the timestamps should be taken. You can leave either video or
  610. audio unchanged and sync the remaining stream(s) to the unchanged one.
  611. @item -async @var{samples_per_second}
  612. Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
  613. the parameter is the maximum samples per second by which the audio is changed.
  614. -async 1 is a special case where only the start of the audio stream is corrected
  615. without any later correction.
  616. @item -copyts
  617. Copy timestamps from input to output.
  618. @item -shortest
  619. Finish encoding when the shortest input stream ends.
  620. @item -dts_delta_threshold
  621. Timestamp discontinuity delta threshold.
  622. @item -muxdelay @var{seconds}
  623. Set the maximum demux-decode delay.
  624. @item -muxpreload @var{seconds}
  625. Set the initial demux-decode delay.
  626. @end table
  627. @node FFmpeg formula evaluator
  628. @section FFmpeg formula evaluator
  629. When evaluating a rate control string, FFmpeg uses an internal formula
  630. evaluator.
  631. The following binary operators are available: @code{+}, @code{-},
  632. @code{*}, @code{/}, @code{^}.
  633. The following unary operators are available: @code{+}, @code{-},
  634. @code{(...)}.
  635. The following functions are available:
  636. @table @var
  637. @item sinh(x)
  638. @item cosh(x)
  639. @item tanh(x)
  640. @item sin(x)
  641. @item cos(x)
  642. @item tan(x)
  643. @item exp(x)
  644. @item log(x)
  645. @item squish(x)
  646. @item gauss(x)
  647. @item abs(x)
  648. @item max(x, y)
  649. @item min(x, y)
  650. @item gt(x, y)
  651. @item lt(x, y)
  652. @item eq(x, y)
  653. @item bits2qp(bits)
  654. @item qp2bits(qp)
  655. @end table
  656. The following constants are available:
  657. @table @var
  658. @item PI
  659. @item E
  660. @item iTex
  661. @item pTex
  662. @item tex
  663. @item mv
  664. @item fCode
  665. @item iCount
  666. @item mcVar
  667. @item var
  668. @item isI
  669. @item isP
  670. @item isB
  671. @item avgQP
  672. @item qComp
  673. @item avgIITex
  674. @item avgPITex
  675. @item avgPPTex
  676. @item avgBPTex
  677. @item avgTex
  678. @end table
  679. @c man end
  680. @ignore
  681. @setfilename ffmpeg
  682. @settitle FFmpeg video converter
  683. @c man begin SEEALSO
  684. ffserver(1), ffplay(1) and the HTML documentation of @file{ffmpeg}.
  685. @c man end
  686. @c man begin AUTHOR
  687. Fabrice Bellard
  688. @c man end
  689. @end ignore
  690. @section Protocols
  691. The file name can be @file{-} to read from standard input or to write
  692. to standard output.
  693. FFmpeg also handles many protocols specified with an URL syntax.
  694. Use 'ffmpeg -formats' to see a list of the supported protocols.
  695. The protocol @code{http:} is currently used only to communicate with
  696. FFserver (see the FFserver documentation). When FFmpeg will be a
  697. video player it will also be used for streaming :-)
  698. @chapter Tips
  699. @itemize
  700. @item For streaming at very low bitrate application, use a low frame rate
  701. and a small GOP size. This is especially true for RealVideo where
  702. the Linux player does not seem to be very fast, so it can miss
  703. frames. An example is:
  704. @example
  705. ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
  706. @end example
  707. @item The parameter 'q' which is displayed while encoding is the current
  708. quantizer. The value 1 indicates that a very good quality could
  709. be achieved. The value 31 indicates the worst quality. If q=31 appears
  710. too often, it means that the encoder cannot compress enough to meet
  711. your bitrate. You must either increase the bitrate, decrease the
  712. frame rate or decrease the frame size.
  713. @item If your computer is not fast enough, you can speed up the
  714. compression at the expense of the compression ratio. You can use
  715. '-me zero' to speed up motion estimation, and '-intra' to disable
  716. motion estimation completely (you have only I-frames, which means it
  717. is about as good as JPEG compression).
  718. @item To have very low audio bitrates, reduce the sampling frequency
  719. (down to 22050 kHz for MPEG audio, 22050 or 11025 for AC3).
  720. @item To have a constant quality (but a variable bitrate), use the option
  721. '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
  722. quality).
  723. @item When converting video files, you can use the '-sameq' option which
  724. uses the same quality factor in the encoder as in the decoder.
  725. It allows almost lossless encoding.
  726. @end itemize
  727. @bye