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.

963 lines
29KB

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