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.

984 lines
30KB

  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 the parameters, when
  13. possible. You have usually to give only the target bitrate you want.
  14. FFmpeg can also convert from any sample rate to any other, and resize
  15. video on the fly with a high quality polyphase filter.
  16. @chapter Quick Start
  17. @c man begin EXAMPLES
  18. @section Video and Audio grabbing
  19. FFmpeg can use a video4linux compatible video source and any Open Sound
  20. System audio source:
  21. @example
  22. ffmpeg /tmp/out.mpg
  23. @end example
  24. Note that you must activate the right video source and channel before
  25. launching ffmpeg. You can use any TV viewer such as xawtv
  26. (@url{http://bytesex.org/xawtv/}) by Gerd Knorr which I find very
  27. good. You must also set correctly the audio recording levels with a
  28. standard mixer.
  29. @section Video and Audio file format conversion
  30. * ffmpeg can use any supported file format and protocol as input:
  31. Examples:
  32. * You can input from YUV files:
  33. @example
  34. ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  35. @end example
  36. It will use the files:
  37. @example
  38. /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  39. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  40. @end example
  41. The Y files use twice the resolution of the U and V files. They are
  42. raw files, without header. They can be generated by all decent video
  43. decoders. You must specify the size of the image with the @option{-s} option
  44. if ffmpeg cannot guess it.
  45. * You can input from a RAW YUV420P file:
  46. @example
  47. ffmpeg -i /tmp/test.yuv /tmp/out.avi
  48. @end example
  49. The RAW YUV420P is a file containing RAW YUV planar, for each frame first
  50. come the Y plane followed by U and V planes, which are half vertical and
  51. horizontal resolution.
  52. * You can output to a RAW YUV420P file:
  53. @example
  54. ffmpeg -i mydivx.avi -o hugefile.yuv
  55. @end example
  56. * You can set several input files and output files:
  57. @example
  58. ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  59. @end example
  60. Convert the audio file a.wav and the raw yuv video file a.yuv
  61. to mpeg file a.mpg
  62. * You can also do audio and video conversions at the same time:
  63. @example
  64. ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  65. @end example
  66. Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
  67. * You can encode to several formats at the same time and define a
  68. mapping from input stream to output streams:
  69. @example
  70. ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
  71. @end example
  72. Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
  73. file:index' specify which input stream is used for each output
  74. stream, in the order of the definition of output streams.
  75. * You can transcode decrypted VOBs
  76. @example
  77. ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
  78. @end example
  79. This is a typical DVD ripper example, input from a VOB file, output
  80. to an AVI file with MPEG-4 video and MP3 audio, note that in this
  81. command we use B frames so the MPEG-4 stream is DivX5 compatible, GOP
  82. size is 300 that means an INTRA frame every 10 seconds for 29.97 fps
  83. input video. Also the audio stream is MP3 encoded so you need LAME
  84. support which is enabled using @code{--enable-mp3lame} when
  85. configuring. The mapping is particularly useful for DVD transcoding
  86. to get the desired audio language.
  87. NOTE: to see the supported input formats, use @code{ffmpeg -formats}.
  88. @c man end
  89. @chapter Invocation
  90. @section Syntax
  91. The generic syntax is:
  92. @example
  93. @c man begin SYNOPSIS
  94. ffmpeg [[options][@option{-i} @var{input_file}]]... @{[options] @var{output_file}@}...
  95. @c man end
  96. @end example
  97. @c man begin DESCRIPTION
  98. If no input file is given, audio/video grabbing is done.
  99. As a general rule, options are applied to the next specified
  100. file. For example, if you give the @option{-b 64} option, it sets the video
  101. bitrate of the next file. Format option may be needed for raw input
  102. files.
  103. By default, ffmpeg tries to convert as losslessly as possible: it
  104. uses the same audio and video parameter for the outputs as the one
  105. specified for the inputs.
  106. @c man end
  107. @c man begin OPTIONS
  108. @section Main options
  109. @table @option
  110. @item -L
  111. show license
  112. @item -h
  113. show help
  114. @item -formats
  115. show available formats, codecs, protocols, ...
  116. @item -f fmt
  117. force format
  118. @item -i filename
  119. input file name
  120. @item -y
  121. overwrite output files
  122. @item -t duration
  123. set the recording time in seconds. @code{hh:mm:ss[.xxx]} syntax is also
  124. supported.
  125. @item -ss position
  126. seek to given time position. @code{hh:mm:ss[.xxx]} syntax is also
  127. supported.
  128. @item -title string
  129. set the title
  130. @item -author string
  131. set the author
  132. @item -copyright string
  133. set the copyright
  134. @item -comment string
  135. set the comment
  136. @item -target type
  137. specify target file type ("vcd", "svcd" or "dvd"). All the format
  138. options (bitrate, codecs, buffer sizes) are automatically set by this
  139. option. You can just type:
  140. @example
  141. ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  142. @end example
  143. @item -hq
  144. activate high quality settings
  145. @end table
  146. @section Video Options
  147. @table @option
  148. @item -b bitrate
  149. set the video bitrate in kbit/s (default = 200 kb/s)
  150. @item -r fps
  151. set frame rate (default = 25)
  152. @item -s size
  153. set frame size. The format is @samp{WxH} (default 160x128). The
  154. following abbreviations are recognized:
  155. @table @samp
  156. @item sqcif
  157. 128x96
  158. @item qcif
  159. 176x144
  160. @item cif
  161. 352x288
  162. @item 4cif
  163. 704x576
  164. @end table
  165. @item -aspect aspect
  166. set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
  167. @item -croptop size
  168. set top crop band size (in pixels)
  169. @item -cropbottom size
  170. set bottom crop band size (in pixels)
  171. @item -cropleft size
  172. set left crop band size (in pixels)
  173. @item -cropright size
  174. set right crop band size (in pixels)
  175. @item -vn
  176. disable video recording
  177. @item -bt tolerance
  178. set video bitrate tolerance (in kbit/s)
  179. @item -maxrate bitrate
  180. set max video bitrate tolerance (in kbit/s)
  181. @item -minrate bitrate
  182. set min video bitrate tolerance (in kbit/s)
  183. @item -bufsize size
  184. set ratecontrol buffere size (in kbit)
  185. @item -vcodec codec
  186. force video codec to @var{codec}. Use the @code{copy} special value to
  187. tell that the raw codec data must be copied as is.
  188. @item -sameq
  189. use same video quality as source (implies VBR)
  190. @item -pass n
  191. select the pass number (1 or 2). It is useful to do two pass
  192. encoding. The statistics of the video are recorded in the first pass and
  193. the video at the exact requested bit rate is generated in the second
  194. pass.
  195. @item -passlogfile file
  196. select two pass log file name to @var{file}.
  197. @end table
  198. @section Advanced Video Options
  199. @table @option
  200. @item -g gop_size
  201. set the group of picture size
  202. @item -intra
  203. use only intra frames
  204. @item -qscale q
  205. use fixed video quantiser scale (VBR)
  206. @item -qmin q
  207. min video quantiser scale (VBR)
  208. @item -qmax q
  209. max video quantiser scale (VBR)
  210. @item -qdiff q
  211. max difference between the quantiser scale (VBR)
  212. @item -qblur blur
  213. video quantiser scale blur (VBR)
  214. @item -qcomp compression
  215. video quantiser scale compression (VBR)
  216. @item -rc_init_cplx complexity
  217. initial complexity for 1-pass encoding
  218. @item -b_qfactor factor
  219. qp factor between p and b frames
  220. @item -i_qfactor factor
  221. qp factor between p and i frames
  222. @item -b_qoffset offset
  223. qp offset between p and b frames
  224. @item -i_qoffset offset
  225. qp offset between p and i frames
  226. @item -rc_eq equation
  227. set rate control equation (@pxref{FFmpeg formula
  228. evaluator}). Default is @code{tex^qComp}.
  229. @item -rc_override override
  230. rate control override for specific intervals
  231. @item -me method
  232. set motion estimation method to @var{method}. Available methods are
  233. (from lower to best quality):
  234. @table @samp
  235. @item zero
  236. Try just the (0, 0) vector.
  237. @item phods
  238. @item log
  239. @item x1
  240. @item epzs
  241. (default method)
  242. @item full
  243. exhaustive search (slow and marginally better than epzs)
  244. @end table
  245. @item -dct_algo algo
  246. set dct algorithm to @var{algo}. Available values are:
  247. @table @samp
  248. @item 0
  249. FF_DCT_AUTO (default)
  250. @item 1
  251. FF_DCT_FASTINT
  252. @item 2
  253. FF_DCT_INT
  254. @item 3
  255. FF_DCT_MMX
  256. @item 4
  257. FF_DCT_MLIB
  258. @item 5
  259. FF_DCT_ALTIVEC
  260. @end table
  261. @item -idct_algo algo
  262. set idct algorithm to @var{algo}. Available values are:
  263. @table @samp
  264. @item 0
  265. FF_IDCT_AUTO (default)
  266. @item 1
  267. FF_IDCT_INT
  268. @item 2
  269. FF_IDCT_SIMPLE
  270. @item 3
  271. FF_IDCT_SIMPLEMMX
  272. @item 4
  273. FF_IDCT_LIBMPEG2MMX
  274. @item 5
  275. FF_IDCT_PS2
  276. @item 6
  277. FF_IDCT_MLIB
  278. @item 7
  279. FF_IDCT_ARM
  280. @item 8
  281. FF_IDCT_ALTIVEC
  282. @item 9
  283. FF_IDCT_SH4
  284. @item 10
  285. FF_IDCT_SIMPLEARM
  286. @end table
  287. @item -er n
  288. set error resilience to @var{n}.
  289. @table @samp
  290. @item 1
  291. FF_ER_CAREFULL (default)
  292. @item 2
  293. FF_ER_COMPLIANT
  294. @item 3
  295. FF_ER_AGGRESSIVE
  296. @item 4
  297. FF_ER_VERY_AGGRESSIVE
  298. @end table
  299. @item -ec bit_mask
  300. set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
  301. the following values:
  302. @table @samp
  303. @item 1
  304. FF_EC_GUESS_MVS (default=enabled)
  305. @item 2
  306. FF_EC_DEBLOCK (default=enabled)
  307. @end table
  308. @item -bf frames
  309. use 'frames' B frames (supported for MPEG-1, MPEG-2 and MPEG-4)
  310. @item -mbd mode
  311. macroblock decision
  312. @table @samp
  313. @item 0
  314. FF_MB_DECISION_SIMPLE: use mb_cmp (cannot change it yet in ffmpeg)
  315. @item 1
  316. FF_MB_DECISION_BITS: chooses the one which needs the fewest bits
  317. @item 2
  318. FF_MB_DECISION_RD: rate distoration
  319. @end table
  320. @item -4mv
  321. use four motion vector by macroblock (only MPEG-4)
  322. @item -part
  323. use data partitioning (only MPEG-4)
  324. @item -bug param
  325. workaround not auto detected encoder bugs
  326. @item -strict strictness
  327. how strictly to follow the standarts
  328. @item -aic
  329. enable Advanced intra coding (h263+)
  330. @item -umv
  331. enable Unlimited Motion Vector (h263+)
  332. @item -deinterlace
  333. deinterlace pictures
  334. @item -interlace
  335. force interlacing support in encoder (only MPEG-2 and MPEG-4). Use this option
  336. if your input file is interlaced and if you want to keep the interlaced
  337. format for minimum losses. The alternative is to deinterlace the input
  338. stream with @option{-deinterlace}, but deinterlacing introduces more
  339. losses.
  340. @item -psnr
  341. calculate PSNR of compressed frames
  342. @item -vstats
  343. dump video coding statistics to @file{vstats_HHMMSS.log}.
  344. @item -vhook module
  345. insert video processing @var{module}. @var{module} contains the module
  346. name and its parameters separated by spaces.
  347. @end table
  348. @section Audio Options
  349. @table @option
  350. @item -ab bitrate
  351. set audio bitrate (in kbit/s)
  352. @item -ar freq
  353. set the audio sampling freq (default = 44100 Hz)
  354. @item -ab bitrate
  355. set the audio bitrate in kbit/s (default = 64)
  356. @item -ac channels
  357. set the number of audio channels (default = 1)
  358. @item -an
  359. disable audio recording
  360. @item -acodec codec
  361. force audio codec to @var{codec}. Use the @code{copy} special value to
  362. tell that the raw codec data must be copied as is.
  363. @end table
  364. @section Audio/Video grab options
  365. @table @option
  366. @item -vd device
  367. set video grab device (e.g. @file{/dev/video0})
  368. @item -vc channel
  369. set video grab channel (DV1394 only)
  370. @item -tvstd standard
  371. set television standard (NTSC, PAL (SECAM))
  372. @item -dv1394
  373. set DV1394 grab
  374. @item -ad device
  375. set audio device (e.g. @file{/dev/dsp})
  376. @end table
  377. @section Advanced options
  378. @table @option
  379. @item -map file:stream
  380. set input stream mapping
  381. @item -debug
  382. print specific debug info
  383. @item -benchmark
  384. add timings for benchmarking
  385. @item -hex
  386. dump each input packet
  387. @item -bitexact
  388. only use bit exact algorithms (for codec testing)
  389. @item -ps size
  390. set packet size in bits
  391. @item -re
  392. read input at native frame rate. Mainly used to simulate a grab device.
  393. @item -loop
  394. loop over the input stream. Currently it works only for image
  395. streams. This option is used for ffserver automatic testing.
  396. @end table
  397. @node FFmpeg formula evaluator
  398. @section FFmpeg formula evaluator
  399. When evaluating a rate control string, FFmpeg uses an internal formula
  400. evaluator.
  401. The following binary operators are available: @code{+}, @code{-},
  402. @code{*}, @code{/}, @code{^}.
  403. The following unary operators are available: @code{+}, @code{-},
  404. @code{(...)}.
  405. The following functions are available:
  406. @table @var
  407. @item sinh(x)
  408. @item cosh(x)
  409. @item tanh(x)
  410. @item sin(x)
  411. @item cos(x)
  412. @item tan(x)
  413. @item exp(x)
  414. @item log(x)
  415. @item squish(x)
  416. @item gauss(x)
  417. @item abs(x)
  418. @item max(x, y)
  419. @item min(x, y)
  420. @item gt(x, y)
  421. @item lt(x, y)
  422. @item eq(x, y)
  423. @item bits2qp(bits)
  424. @item qp2bits(qp)
  425. @end table
  426. The following constants are available:
  427. @table @var
  428. @item PI
  429. @item E
  430. @item iTex
  431. @item pTex
  432. @item tex
  433. @item mv
  434. @item fCode
  435. @item iCount
  436. @item mcVar
  437. @item var
  438. @item isI
  439. @item isP
  440. @item isB
  441. @item avgQP
  442. @item qComp
  443. @item avgIITex
  444. @item avgPITex
  445. @item avgPPTex
  446. @item avgBPTex
  447. @item avgTex
  448. @end table
  449. @c man end
  450. @ignore
  451. @setfilename ffmpeg
  452. @settitle FFmpeg video converter
  453. @c man begin SEEALSO
  454. ffserver(1), ffplay(1) and the html documentation of @file{ffmpeg}.
  455. @c man end
  456. @c man begin AUTHOR
  457. Fabrice Bellard
  458. @c man end
  459. @end ignore
  460. @section Protocols
  461. The filename can be @file{-} to read from the standard input or to write
  462. to the standard output.
  463. ffmpeg handles also many protocols specified with the URL syntax.
  464. Use 'ffmpeg -formats' to have a list of the supported protocols.
  465. The protocol @code{http:} is currently used only to communicate with
  466. ffserver (see the ffserver documentation). When ffmpeg will be a
  467. video player it will also be used for streaming :-)
  468. @chapter Tips
  469. @itemize
  470. @item For streaming at very low bit rate application, use a low frame rate
  471. and a small gop size. This is especially true for real video where
  472. the Linux player does not seem to be very fast, so it can miss
  473. frames. An example is:
  474. @example
  475. ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
  476. @end example
  477. @item The parameter 'q' which is displayed while encoding is the current
  478. quantizer. The value of 1 indicates that a very good quality could
  479. be achieved. The value of 31 indicates the worst quality. If q=31
  480. too often, it means that the encoder cannot compress enough to meet
  481. your bit rate. You must either increase the bit rate, decrease the
  482. frame rate or decrease the frame size.
  483. @item If your computer is not fast enough, you can speed up the
  484. compression at the expense of the compression ratio. You can use
  485. '-me zero' to speed up motion estimation, and '-intra' to disable
  486. completely motion estimation (you have only I frames, which means it
  487. is about as good as JPEG compression).
  488. @item To have very low bitrates in audio, reduce the sampling frequency
  489. (down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
  490. @item To have a constant quality (but a variable bitrate), use the option
  491. '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
  492. quality).
  493. @item When converting video files, you can use the '-sameq' option which
  494. uses in the encoder the same quality factor than in the decoder. It
  495. allows to be almost lossless in encoding.
  496. @end itemize
  497. @chapter Supported File Formats and Codecs
  498. You can use the @code{-formats} option to have an exhaustive list.
  499. @section File Formats
  500. FFmpeg supports the following file formats through the @code{libavformat}
  501. library:
  502. @multitable @columnfractions .4 .1 .1
  503. @item Supported File Format @tab Encoding @tab Decoding @tab Comments
  504. @item MPEG audio @tab X @tab X
  505. @item MPEG1 systems @tab X @tab X
  506. @tab muxed audio and video
  507. @item MPEG2 PS @tab X @tab X
  508. @tab also known as @code{VOB} file
  509. @item MPEG2 TS @tab @tab X
  510. @tab also known as DVB Transport Stream
  511. @item ASF@tab X @tab X
  512. @item AVI@tab X @tab X
  513. @item WAV@tab X @tab X
  514. @item Macromedia Flash@tab X @tab X
  515. @tab Only embedded audio is decoded
  516. @item FLV @tab X @tab X
  517. @tab Macromedia Flash video files
  518. @item Real Audio and Video @tab X @tab X
  519. @item Raw AC3 @tab X @tab X
  520. @item Raw MJPEG @tab X @tab X
  521. @item Raw MPEG video @tab X @tab X
  522. @item Raw PCM8/16 bits, mulaw/Alaw@tab X @tab X
  523. @item Raw CRI ADX audio @tab X @tab X
  524. @item SUN AU format @tab X @tab X
  525. @item NUT @tab X @tab X @tab NUT Open Container Format
  526. @item Quicktime @tab X @tab X
  527. @item MPEG4 @tab X @tab X
  528. @tab MPEG4 is a variant of Quicktime
  529. @item Raw MPEG4 video @tab X @tab X
  530. @item DV @tab X @tab X
  531. @item 4xm @tab @tab X
  532. @tab 4X Technologies format, used in some games
  533. @item Playstation STR @tab @tab X
  534. @item Id RoQ @tab @tab X
  535. @tab used in Quake III, Jedi Knight 2, other computer games
  536. @item Interplay MVE @tab @tab X
  537. @tab format used in various Interplay computer games
  538. @item WC3 Movie @tab @tab X
  539. @tab multimedia format used in Origin's Wing Commander III computer game
  540. @item Sega FILM/CPK @tab @tab X
  541. @tab used in many Sega Saturn console games
  542. @item Westwood Studios VQA/AUD @tab @tab X
  543. @tab Multimedia formats used in Westwood Studios games
  544. @item Id Cinematic (.cin) @tab @tab X
  545. @tab Used in Quake II
  546. @item FLIC format @tab @tab X
  547. @tab .fli/.flc files
  548. @item Sierra VMD @tab @tab X
  549. @tab used in Sierra CD-ROM games
  550. @item Matroska @tab @tab X
  551. @end multitable
  552. @code{X} means that the encoding (resp. decoding) is supported.
  553. @section Image Formats
  554. FFmpeg can read and write images for each frame of a video sequence. The
  555. following image formats are supported:
  556. @multitable @columnfractions .4 .1 .1
  557. @item Supported Image Format @tab Encoding @tab Decoding @tab Comments
  558. @item PGM, PPM @tab X @tab X
  559. @item PAM @tab X @tab X @tab PAM is a PNM extension with alpha support
  560. @item PGMYUV @tab X @tab X @tab PGM with U and V components in YUV 4:2:0
  561. @item JPEG @tab X @tab X @tab Progressive JPEG is not supported
  562. @item .Y.U.V @tab X @tab X @tab One raw file per component
  563. @item Animated GIF @tab X @tab X @tab Only uncompressed GIFs are generated
  564. @item PNG @tab X @tab X @tab 2 bit and 4 bit/pixel not supported yet
  565. @item SGI @tab X @tab X @tab SGI RGB image format
  566. @end multitable
  567. @code{X} means that the encoding (resp. decoding) is supported.
  568. @section Video Codecs
  569. @multitable @columnfractions .4 .1 .1 .7
  570. @item Supported Codec @tab Encoding @tab Decoding @tab Comments
  571. @item MPEG1 video @tab X @tab X
  572. @item MPEG2 video @tab X @tab X
  573. @item MPEG4 @tab X @tab X @tab Also known as DIVX4/5
  574. @item MSMPEG4 V1 @tab X @tab X
  575. @item MSMPEG4 V2 @tab X @tab X
  576. @item MSMPEG4 V3 @tab X @tab X @tab Also known as DIVX3
  577. @item WMV7 @tab X @tab X
  578. @item WMV8 @tab X @tab X @tab Not completely working
  579. @item H263(+) @tab X @tab X @tab Also known as Real Video 1.0
  580. @item MJPEG @tab X @tab X
  581. @item Lossless MJPEG @tab X @tab X
  582. @item Apple MJPEG-B @tab @tab X
  583. @item Sunplus MJPEG @tab @tab X @tab fourcc: SP5X
  584. @item DV @tab X @tab X
  585. @item Huff YUV @tab X @tab X
  586. @item FFmpeg Video 1 @tab X @tab X @tab Lossless codec (fourcc: FFV1)
  587. @item Asus v1 @tab X @tab X @tab fourcc: ASV1
  588. @item Asus v2 @tab X @tab X @tab fourcc: ASV2
  589. @item Creative YUV @tab @tab X @tab fourcc: CYUV
  590. @item H.264 @tab @tab X
  591. @item Sorenson Video 1 @tab @tab X @tab fourcc: SVQ1
  592. @item Sorenson Video 3 @tab @tab X @tab fourcc: SVQ3
  593. @item On2 VP3 @tab @tab X @tab still experimental
  594. @item Theora @tab @tab X @tab still experimental
  595. @item Intel Indeo 3 @tab @tab X @tab only works on i386 right now
  596. @item FLV @tab X @tab X @tab Flash H263 variant
  597. @item ATI VCR1 @tab @tab X @tab fourcc: VCR1
  598. @item ATI VCR2 @tab @tab X @tab fourcc: VCR2
  599. @item Cirrus Logic AccuPak @tab @tab X @tab fourcc: CLJR
  600. @item 4X Video @tab @tab X @tab used in certain computer games
  601. @item Sony Playstation MDEC @tab @tab X
  602. @item Id RoQ @tab @tab X @tab used in Quake III, Jedi Knight 2, other computer games
  603. @item Xan/WC3 @tab @tab X @tab used in Wing Commander III .MVE files
  604. @item Interplay Video @tab @tab X @tab used in Interplay .MVE files
  605. @item Apple Animation @tab @tab X @tab fourcc: 'rle '
  606. @item Apple Graphics @tab @tab X @tab fourcc: 'smc '
  607. @item Apple Video @tab @tab X @tab fourcc: rpza
  608. @item Cinepak @tab @tab X
  609. @item Microsoft RLE @tab @tab X
  610. @item Microsoft Video-1 @tab @tab X
  611. @item Westwood VQA @tab @tab X
  612. @item Id Cinematic Video @tab @tab X @tab used in Quake II
  613. @item Planar RGB @tab @tab X @tab fourcc: 8BPS
  614. @item FLIC video @tab @tab X
  615. @item Duck TrueMotion v1 @tab @tab X @tab fourcc: DUCK
  616. @item VMD Video @tab @tab X @tab used in Sierra VMD files
  617. @item MSZH @tab @tab X @tab Part of LCL
  618. @item ZLIB @tab X @tab X @tab Part of LCL, encoder experimental
  619. @end multitable
  620. @code{X} means that the encoding (resp. decoding) is supported.
  621. Check at @url{http://www.mplayerhq.hu/~michael/codec-features.html} to
  622. get a precise comparison of FFmpeg MPEG4 codec compared to the other
  623. solutions.
  624. @section Audio Codecs
  625. @multitable @columnfractions .4 .1 .1 .1 .7
  626. @item Supported Codec @tab Encoding @tab Decoding @tab Comments
  627. @item MPEG audio layer 2 @tab IX @tab IX
  628. @item MPEG audio layer 1/3 @tab IX @tab IX
  629. @tab MP3 encoding is supported through the external library LAME
  630. @item AC3 @tab IX @tab X
  631. @tab liba52 is used internally for decoding
  632. @item Vorbis @tab X @tab X
  633. @tab supported through the external library libvorbis
  634. @item WMA V1/V2 @tab @tab X
  635. @item Microsoft ADPCM @tab X @tab X
  636. @item MS IMA ADPCM @tab X @tab X
  637. @item QT IMA ADPCM @tab @tab X
  638. @item 4X IMA ADPCM @tab @tab X
  639. @item G.726 ADPCM @tab X @tab X
  640. @item Duck DK3 IMA ADPCM @tab @tab X
  641. @tab used in some Sega Saturn console games
  642. @item Duck DK4 IMA ADPCM @tab @tab X
  643. @tab used in some Sega Saturn console games
  644. @item Westwood Studios IMA ADPCM @tab @tab X
  645. @tab used in Westwood Studios games like Command and Conquer
  646. @item SMJPEG IMA ADPCM @tab @tab X
  647. @tab used in certain Loki game ports
  648. @item CD-ROM XA ADPCM @tab @tab X
  649. @item CRI ADX ADPCM @tab X @tab X
  650. @tab used in Sega Dreamcast games
  651. @item Electronic Arts ADPCM @tab @tab X
  652. @tab used in various EA titles
  653. @item RA144 @tab @tab X
  654. @tab Real 14400 bit/s codec
  655. @item RA288 @tab @tab X
  656. @tab Real 28800 bit/s codec
  657. @item AMR-NB @tab X @tab X
  658. @tab supported through an external library
  659. @item AMR-WB @tab X @tab X
  660. @tab supported through an external library
  661. @item DV audio @tab @tab X
  662. @item Id RoQ DPCM @tab @tab X
  663. @tab used in Quake III, Jedi Knight 2, other computer games
  664. @item Interplay MVE DPCM @tab @tab X
  665. @tab used in various Interplay computer games
  666. @item Xan DPCM @tab @tab X
  667. @tab used in Origin's Wing Commander IV AVI files
  668. @item Apple MACE 3 @tab @tab X
  669. @item Apple MACE 6 @tab @tab X
  670. @item FLAC @tab @tab X
  671. @end multitable
  672. @code{X} means that the encoding (resp. decoding) is supported.
  673. @code{I} means that an integer only version is available too (ensures highest
  674. performances on systems without hardware floating point support).
  675. @chapter Platform Specific information
  676. @section Linux
  677. ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
  678. preferred compiler now for ffmpeg. All future optimizations will depend on
  679. features only found in GCC 3.2.
  680. @section BSD
  681. @section Windows
  682. @subsection Native Windows compilation
  683. @itemize
  684. @item Install the current versions of MSYS and MinGW from
  685. @url{http://www.mingw.org/}. You can find detailed installation
  686. instructions in the download section and the FAQ.
  687. @item If you want to test the FFmpeg Simple Media Player, also download
  688. the MinGW development library of SDL 1.2.x
  689. (@file{SDL-devel-1.2.x-mingw32.tar.gz}) from
  690. @url{http://www.libsdl.org}. Unpack it in a temporary place, and
  691. unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool
  692. directory. Edit the @file{sdl-config} script so that it gives the
  693. correct SDL directory when invoked.
  694. @item Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
  695. @item Start the MSYS shell (file @file{msys.bat}).
  696. @item Change to the FFMPEG directory and follow
  697. the instructions of how to compile ffmpeg (file
  698. @file{INSTALL}). Usually, launching @file{./configure} and @file{make}
  699. suffices. If you have problems using SDL, verify that
  700. @file{sdl-config} can be launched from the MSYS command line.
  701. @item You can install FFmpeg in @file{Program Files/FFmpeg} by typing @file{make install}. Don't forget to copy @file{SDL.dll} at the place you launch
  702. @file{ffplay}.
  703. @end itemize
  704. Notes:
  705. @itemize
  706. @item The target @file{make wininstaller} can be used to create a
  707. Nullsoft based Windows installer for FFmpeg and FFplay. @file{SDL.dll}
  708. must be copied in the ffmpeg directory in order to build the
  709. installer.
  710. @item By using @code{./configure --enable-shared} when configuring ffmpeg,
  711. you can build @file{avcodec.dll} and @file{avformat.dll}. With
  712. @code{make install} you install the FFmpeg DLLs and the associated
  713. headers in @file{Program Files/FFmpeg}.
  714. @item Visual C++ compatibility: if you used @code{./configure --enable-shared}
  715. when configuring FFmpeg, then FFmpeg tries to use the Microsoft Visual
  716. C++ @code{lib} tool to build @code{avcodec.lib} and
  717. @code{avformat.lib}. With these libraries, you can link your Visual C++
  718. code directly with the FFmpeg DLLs.
  719. @end itemize
  720. @subsection Cross compilation for Windows with Linux
  721. You must use the MinGW cross compilation tools available at
  722. @url{http://www.mingw.org/}.
  723. Then configure ffmpeg with the following options:
  724. @example
  725. ./configure --enable-mingw32 --cross-prefix=i386-mingw32msvc-
  726. @end example
  727. (you can change the cross-prefix according to the prefix choosen for the
  728. MinGW tools).
  729. Then you can easily test ffmpeg with wine
  730. (@url{http://www.winehq.com/}).
  731. @section MacOS X
  732. @section BeOS
  733. The configure script should guess the configuration itself.
  734. Networking support is currently not finished.
  735. errno issues fixed by Andrew Bachmann.
  736. Old stuff:
  737. François Revol - revol at free dot fr - April 2002
  738. The configure script should guess the configuration itself,
  739. however I still didn't tested building on net_server version of BeOS.
  740. ffserver is broken (needs poll() implementation).
  741. There is still issues with errno codes, which are negative in BeOs, and
  742. that ffmpeg negates when returning. This ends up turning errors into
  743. valid results, then crashes.
  744. (To be fixed)
  745. @chapter Developers Guide
  746. @section API
  747. @itemize
  748. @item libavcodec is the library containing the codecs (both encoding and
  749. decoding). See @file{libavcodec/apiexample.c} to see how to use it.
  750. @item libavformat is the library containing the file formats handling (mux and
  751. demux code for several formats). See @file{ffplay.c} to use it in a
  752. player. See @file{output_example.c} to use it to generate audio or video
  753. streams.
  754. @end itemize
  755. @section Integrating libavcodec or libavformat in your program
  756. You can integrate all the source code of the libraries to link them
  757. statically to avoid any version problem. All you need is to provide a
  758. 'config.mak' and a 'config.h' in the parent directory. See the defines
  759. generated by ./configure to understand what is needed.
  760. You can use libavcodec or libavformat in your commercial program, but
  761. @emph{any patch you make must be published}. The best way to proceed is
  762. to send your patches to the ffmpeg mailing list.
  763. @section Coding Rules
  764. ffmpeg is programmed in ANSI C language. GCC extensions are
  765. tolerated. Indent size is 4. The TAB character should not be used.
  766. The presentation is the one specified by 'indent -i4 -kr'.
  767. Main priority in ffmpeg is simplicity and small code size (=less
  768. bugs).
  769. Comments: for functions visible from other modules, use the JavaDoc
  770. format (see examples in @file{libav/utils.c}) so that a documentation
  771. can be generated automatically.
  772. fprintf and printf are forbidden in libavformat and libavcodec,
  773. please use av_log() instead.
  774. @section Submitting patches
  775. When you submit your patch, try to send a unified diff (diff '-up'
  776. option). I cannot read other diffs :-)
  777. Run the regression tests before submitting a patch so that you can
  778. verify that there are no big problems.
  779. Patches should be posted as base64 encoded attachments (or any other
  780. encoding which ensures that the patch wont be trashed during
  781. transmission) to the ffmpeg-devel mailinglist, see
  782. @url{http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel}
  783. It also helps quite a bit if you tell us what the patch does (for example
  784. 'replaces lrint by lrintf') , and why (for example '*bsd isnt c99 compliant
  785. and has no lrint()')
  786. @section Regression tests
  787. Before submitting a patch (or committing with CVS), you should at least
  788. test that you did not break anything.
  789. The regression test build a synthetic video stream and a synthetic
  790. audio stream. Then these are encoded then decoded with all codecs or
  791. formats. The CRC (or MD5) of each generated file is recorded in a
  792. result file. Then a 'diff' is launched with the reference results and
  793. the result file.
  794. The regression test then goes on to test the ffserver code with a
  795. limited set of streams. It is important that this step runs correctly
  796. as well.
  797. Run 'make test' to test all the codecs and formats.
  798. Run 'make fulltest' to test all the codecs, formats and ffserver.
  799. [Of course, some patches may change the regression tests results. In
  800. this case, the regression tests reference results shall be modified
  801. accordingly].
  802. @bye