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.

1027 lines
31KB

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