ffmpeg-doc.texi 27 KB

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