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.

911 lines
22KB

  1. <HTML>
  2. <HEAD>
  3. <!-- Created by texi2html 1.56k from ffmpeg-doc.texi on 17 April 2003 -->
  4. <TITLE>FFmpeg Documentation</TITLE>
  5. </HEAD>
  6. <BODY>
  7. <H1>FFmpeg Documentation</H1>
  8. <P>
  9. <P><HR><P>
  10. <H1>Table of Contents</H1>
  11. <UL>
  12. <LI><A NAME="TOC1" HREF="ffmpeg-doc.html#SEC1">1. Introduction</A>
  13. <LI><A NAME="TOC2" HREF="ffmpeg-doc.html#SEC2">2. Quick Start</A>
  14. <UL>
  15. <LI><A NAME="TOC3" HREF="ffmpeg-doc.html#SEC3">2.1 Video and Audio grabbing</A>
  16. <LI><A NAME="TOC4" HREF="ffmpeg-doc.html#SEC4">2.2 Video and Audio file format conversion</A>
  17. </UL>
  18. <LI><A NAME="TOC5" HREF="ffmpeg-doc.html#SEC5">3. Invocation</A>
  19. <UL>
  20. <LI><A NAME="TOC6" HREF="ffmpeg-doc.html#SEC6">3.1 Syntax</A>
  21. <LI><A NAME="TOC7" HREF="ffmpeg-doc.html#SEC7">3.2 Main options</A>
  22. <LI><A NAME="TOC8" HREF="ffmpeg-doc.html#SEC8">3.3 Video Options</A>
  23. <LI><A NAME="TOC9" HREF="ffmpeg-doc.html#SEC9">3.4 Audio Options</A>
  24. <LI><A NAME="TOC10" HREF="ffmpeg-doc.html#SEC10">3.5 Advanced options</A>
  25. <LI><A NAME="TOC11" HREF="ffmpeg-doc.html#SEC11">3.6 Protocols</A>
  26. </UL>
  27. <LI><A NAME="TOC12" HREF="ffmpeg-doc.html#SEC12">4. Tips</A>
  28. <LI><A NAME="TOC13" HREF="ffmpeg-doc.html#SEC13">5. Supported File Formats and Codecs</A>
  29. <UL>
  30. <LI><A NAME="TOC14" HREF="ffmpeg-doc.html#SEC14">5.1 File Formats</A>
  31. <LI><A NAME="TOC15" HREF="ffmpeg-doc.html#SEC15">5.2 Image Formats</A>
  32. <LI><A NAME="TOC16" HREF="ffmpeg-doc.html#SEC16">5.3 Video Codecs</A>
  33. <LI><A NAME="TOC17" HREF="ffmpeg-doc.html#SEC17">5.4 Audio Codecs</A>
  34. </UL>
  35. <LI><A NAME="TOC18" HREF="ffmpeg-doc.html#SEC18">6. Platform Specific information</A>
  36. <UL>
  37. <LI><A NAME="TOC19" HREF="ffmpeg-doc.html#SEC19">6.1 Linux</A>
  38. <LI><A NAME="TOC20" HREF="ffmpeg-doc.html#SEC20">6.2 BSD</A>
  39. <LI><A NAME="TOC21" HREF="ffmpeg-doc.html#SEC21">6.3 Windows</A>
  40. <LI><A NAME="TOC22" HREF="ffmpeg-doc.html#SEC22">6.4 MacOS X</A>
  41. <LI><A NAME="TOC23" HREF="ffmpeg-doc.html#SEC23">6.5 BeOS</A>
  42. </UL>
  43. <LI><A NAME="TOC24" HREF="ffmpeg-doc.html#SEC24">7. Developers Guide</A>
  44. <UL>
  45. <LI><A NAME="TOC25" HREF="ffmpeg-doc.html#SEC25">7.1 API</A>
  46. <LI><A NAME="TOC26" HREF="ffmpeg-doc.html#SEC26">7.2 Integrating libavcodec or libavformat in your program</A>
  47. <LI><A NAME="TOC27" HREF="ffmpeg-doc.html#SEC27">7.3 Coding Rules</A>
  48. <LI><A NAME="TOC28" HREF="ffmpeg-doc.html#SEC28">7.4 Submitting patches</A>
  49. <LI><A NAME="TOC29" HREF="ffmpeg-doc.html#SEC29">7.5 Regression tests</A>
  50. </UL>
  51. </UL>
  52. <P><HR><P>
  53. <P>
  54. FFmpeg Documentation
  55. <H1><A NAME="SEC1" HREF="ffmpeg-doc.html#TOC1">1. Introduction</A></H1>
  56. <P>
  57. FFmpeg is a very fast video and audio converter. It can also grab from
  58. a live audio/video source.
  59. The command line interface is designed to be intuitive, in the sense
  60. that ffmpeg tries to figure out all the parameters, when
  61. possible. You have usually to give only the target bitrate you want.
  62. <P>
  63. FFmpeg can also convert from any sample rate to any other, and resize
  64. video on the fly with a high quality polyphase filter.
  65. <H1><A NAME="SEC2" HREF="ffmpeg-doc.html#TOC2">2. Quick Start</A></H1>
  66. <H2><A NAME="SEC3" HREF="ffmpeg-doc.html#TOC3">2.1 Video and Audio grabbing</A></H2>
  67. <P>
  68. FFmpeg can use a video4linux compatible video source and any Open Sound
  69. System audio source:
  70. <PRE>
  71. ffmpeg /tmp/out.mpg
  72. </PRE>
  73. <P>
  74. Note that you must activate the right video source and channel before
  75. launching ffmpeg. You can use any TV viewer such as xawtv
  76. (<A HREF="http://bytesex.org/xawtv/">http://bytesex.org/xawtv/</A>) by Gerd Knorr which I find very
  77. good. You must also set correctly the audio recording levels with a
  78. standard mixer.
  79. <H2><A NAME="SEC4" HREF="ffmpeg-doc.html#TOC4">2.2 Video and Audio file format conversion</A></H2>
  80. <P>
  81. * ffmpeg can use any supported file format and protocol as input:
  82. <P>
  83. Examples:
  84. <P>
  85. * You can input from YUV files:
  86. <PRE>
  87. ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  88. </PRE>
  89. <P>
  90. It will use the files:
  91. <PRE>
  92. /tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  93. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  94. </PRE>
  95. <P>
  96. The Y files use twice the resolution of the U and V files. They are
  97. raw files, without header. They can be generated by all decent video
  98. decoders. You must specify the size of the image with the '-s' option
  99. if ffmpeg cannot guess it.
  100. <P>
  101. * You can input from a RAW YUV420P file:
  102. <PRE>
  103. ffmpeg -i /tmp/test.yuv /tmp/out.avi
  104. </PRE>
  105. <P>
  106. The RAW YUV420P is a file containing RAW YUV planar, for each frame first
  107. come the Y plane followed by U and V planes, which are half vertical and
  108. horizontal resolution.
  109. <P>
  110. * You can output to a RAW YUV420P file:
  111. <PRE>
  112. ffmpeg -i mydivx.avi -o hugefile.yuv
  113. </PRE>
  114. <P>
  115. * You can set several input files and output files:
  116. <PRE>
  117. ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  118. </PRE>
  119. <P>
  120. Convert the audio file a.wav and the raw yuv video file a.yuv
  121. to mpeg file a.mpg
  122. <P>
  123. * You can also do audio and video conversions at the same time:
  124. <PRE>
  125. ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  126. </PRE>
  127. <P>
  128. Convert the sample rate of a.wav to 22050 Hz and encode it to MPEG audio.
  129. <P>
  130. * You can encode to several formats at the same time and define a
  131. mapping from input stream to output streams:
  132. <PRE>
  133. ffmpeg -i /tmp/a.wav -ab 64 /tmp/a.mp2 -ab 128 /tmp/b.mp2 -map 0:0 -map 0:0
  134. </PRE>
  135. <P>
  136. Convert a.wav to a.mp2 at 64 kbits and b.mp2 at 128 kbits. '-map
  137. file:index' specify which input stream is used for each output
  138. stream, in the order of the definition of output streams.
  139. <P>
  140. * You can transcode decrypted VOBs
  141. <PRE>
  142. ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 snatch.avi
  143. </PRE>
  144. <P>
  145. This is a typical DVD ripper example, input from a VOB file, output
  146. to an AVI file with MPEG-4 video and MP3 audio, note that in this
  147. command we use B frames so the MPEG-4 stream is DivX5 compatible, GOP
  148. size is 300 that means an INTRA frame every 10 seconds for 29.97 fps
  149. input video. Also the audio stream is MP3 encoded so you need LAME
  150. support which is enabled using <CODE>--enable-mp3lame</CODE> when
  151. configuring. The mapping is particularly useful for DVD transcoding
  152. to get the desired audio language.
  153. <P>
  154. NOTE: to see the supported input formats, use <CODE>ffmpeg -formats</CODE>.
  155. <H1><A NAME="SEC5" HREF="ffmpeg-doc.html#TOC5">3. Invocation</A></H1>
  156. <H2><A NAME="SEC6" HREF="ffmpeg-doc.html#TOC6">3.1 Syntax</A></H2>
  157. <P>
  158. The generic syntax is:
  159. <PRE>
  160. ffmpeg [[options][-i input_file]]... {[options] output_file}...
  161. </PRE>
  162. <P>
  163. If no input file is given, audio/video grabbing is done.
  164. <P>
  165. As a general rule, options are applied to the next specified
  166. file. For example, if you give the '-b 64' option, it sets the video
  167. bitrate of the next file. Format option may be needed for raw input
  168. files.
  169. <P>
  170. By default, ffmpeg tries to convert as losslessly as possible: it
  171. uses the same audio and video parameter for the outputs as the one
  172. specified for the inputs.
  173. <H2><A NAME="SEC7" HREF="ffmpeg-doc.html#TOC7">3.2 Main options</A></H2>
  174. <DL COMPACT>
  175. <DT><SAMP>`-L'</SAMP>
  176. <DD>
  177. show license
  178. <DT><SAMP>`-h'</SAMP>
  179. <DD>
  180. show help
  181. <DT><SAMP>`-formats'</SAMP>
  182. <DD>
  183. show available formats, codecs, protocols, ...
  184. <DT><SAMP>`-f fmt'</SAMP>
  185. <DD>
  186. force format
  187. <DT><SAMP>`-i filename'</SAMP>
  188. <DD>
  189. input file name
  190. <DT><SAMP>`-y'</SAMP>
  191. <DD>
  192. overwrite output files
  193. <DT><SAMP>`-t duration'</SAMP>
  194. <DD>
  195. set the recording time in seconds. <CODE>hh:mm:ss[.xxx]</CODE> syntax is also
  196. supported.
  197. <DT><SAMP>`-title string'</SAMP>
  198. <DD>
  199. set the title
  200. <DT><SAMP>`-author string'</SAMP>
  201. <DD>
  202. set the author
  203. <DT><SAMP>`-copyright string'</SAMP>
  204. <DD>
  205. set the copyright
  206. <DT><SAMP>`-comment string'</SAMP>
  207. <DD>
  208. set the comment
  209. <DT><SAMP>`-b bitrate'</SAMP>
  210. <DD>
  211. set video bitrate (in kbit/s)
  212. </DL>
  213. <H2><A NAME="SEC8" HREF="ffmpeg-doc.html#TOC8">3.3 Video Options</A></H2>
  214. <DL COMPACT>
  215. <DT><SAMP>`-s size'</SAMP>
  216. <DD>
  217. set frame size [160x128]
  218. <DT><SAMP>`-r fps'</SAMP>
  219. <DD>
  220. set frame rate [25]
  221. <DT><SAMP>`-b bitrate'</SAMP>
  222. <DD>
  223. set the video bitrate in kbit/s [200]
  224. <DT><SAMP>`-vn'</SAMP>
  225. <DD>
  226. disable video recording [no]
  227. <DT><SAMP>`-bt tolerance'</SAMP>
  228. <DD>
  229. set video bitrate tolerance (in kbit/s)
  230. <DT><SAMP>`-sameq'</SAMP>
  231. <DD>
  232. use same video quality as source (implies VBR)
  233. <DT><SAMP>`-pass n'</SAMP>
  234. <DD>
  235. select the pass number (1 or 2). It is useful to do two pass encoding. The statistics of the video are recorded in the first pass and the video at the exact requested bit rate is generated in the second pass.
  236. <DT><SAMP>`-passlogfile file'</SAMP>
  237. <DD>
  238. select two pass log file name
  239. </DL>
  240. <H2><A NAME="SEC9" HREF="ffmpeg-doc.html#TOC9">3.4 Audio Options</A></H2>
  241. <DL COMPACT>
  242. <DT><SAMP>`-ab bitrate'</SAMP>
  243. <DD>
  244. set audio bitrate (in kbit/s)
  245. <DT><SAMP>`-ar freq'</SAMP>
  246. <DD>
  247. set the audio sampling freq [44100]
  248. <DT><SAMP>`-ab bitrate'</SAMP>
  249. <DD>
  250. set the audio bitrate in kbit/s [64]
  251. <DT><SAMP>`-ac channels'</SAMP>
  252. <DD>
  253. set the number of audio channels [1]
  254. <DT><SAMP>`-an'</SAMP>
  255. <DD>
  256. disable audio recording [no]
  257. </DL>
  258. <H2><A NAME="SEC10" HREF="ffmpeg-doc.html#TOC10">3.5 Advanced options</A></H2>
  259. <DL COMPACT>
  260. <DT><SAMP>`-map file:stream'</SAMP>
  261. <DD>
  262. set input stream mapping
  263. <DT><SAMP>`-g gop_size'</SAMP>
  264. <DD>
  265. set the group of picture size
  266. <DT><SAMP>`-intra'</SAMP>
  267. <DD>
  268. use only intra frames
  269. <DT><SAMP>`-qscale q'</SAMP>
  270. <DD>
  271. use fixed video quantiser scale (VBR)
  272. <DT><SAMP>`-qmin q'</SAMP>
  273. <DD>
  274. min video quantiser scale (VBR)
  275. <DT><SAMP>`-qmax q'</SAMP>
  276. <DD>
  277. max video quantiser scale (VBR)
  278. <DT><SAMP>`-qdiff q'</SAMP>
  279. <DD>
  280. max difference between the quantiser scale (VBR)
  281. <DT><SAMP>`-qblur blur'</SAMP>
  282. <DD>
  283. video quantiser scale blur (VBR)
  284. <DT><SAMP>`-qcomp compression'</SAMP>
  285. <DD>
  286. video quantiser scale compression (VBR)
  287. <DT><SAMP>`-vd device'</SAMP>
  288. <DD>
  289. set video device
  290. <DT><SAMP>`-vcodec codec'</SAMP>
  291. <DD>
  292. force video codec
  293. <DT><SAMP>`-me method'</SAMP>
  294. <DD>
  295. set motion estimation method
  296. <DT><SAMP>`-bf frames'</SAMP>
  297. <DD>
  298. use 'frames' B frames (only MPEG-4)
  299. <DT><SAMP>`-hq'</SAMP>
  300. <DD>
  301. activate high quality settings
  302. <DT><SAMP>`-4mv'</SAMP>
  303. <DD>
  304. use four motion vector by macroblock (only MPEG-4)
  305. <DT><SAMP>`-ad device'</SAMP>
  306. <DD>
  307. set audio device
  308. <DT><SAMP>`-acodec codec'</SAMP>
  309. <DD>
  310. force audio codec
  311. <DT><SAMP>`-deinterlace'</SAMP>
  312. <DD>
  313. deinterlace pictures
  314. <DT><SAMP>`-benchmark'</SAMP>
  315. <DD>
  316. add timings for benchmarking
  317. <DT><SAMP>`-hex'</SAMP>
  318. <DD>
  319. dump each input packet
  320. <DT><SAMP>`-psnr'</SAMP>
  321. <DD>
  322. calculate PSNR of compressed frames
  323. <DT><SAMP>`-vstats'</SAMP>
  324. <DD>
  325. dump video coding statistics to file
  326. </DL>
  327. <H2><A NAME="SEC11" HREF="ffmpeg-doc.html#TOC11">3.6 Protocols</A></H2>
  328. <P>
  329. The filename can be <TT>`-'</TT> to read from the standard input or to write
  330. to the standard output.
  331. <P>
  332. ffmpeg handles also many protocols specified with the URL syntax.
  333. <P>
  334. Use 'ffmpeg -formats' to have a list of the supported protocols.
  335. <P>
  336. The protocol <CODE>http:</CODE> is currently used only to communicate with
  337. ffserver (see the ffserver documentation). When ffmpeg will be a
  338. video player it will also be used for streaming :-)
  339. <H1><A NAME="SEC12" HREF="ffmpeg-doc.html#TOC12">4. Tips</A></H1>
  340. <UL>
  341. <LI>For streaming at very low bit rate application, use a low frame rate
  342. and a small gop size. This is especially true for real video where
  343. the Linux player does not seem to be very fast, so it can miss
  344. frames. An example is:
  345. <PRE>
  346. ffmpeg -g 3 -r 3 -t 10 -b 50 -s qcif -f rv10 /tmp/b.rm
  347. </PRE>
  348. <LI>The parameter 'q' which is displayed while encoding is the current
  349. quantizer. The value of 1 indicates that a very good quality could
  350. be achieved. The value of 31 indicates the worst quality. If q=31
  351. too often, it means that the encoder cannot compress enough to meet
  352. your bit rate. You must either increase the bit rate, decrease the
  353. frame rate or decrease the frame size.
  354. <LI>If your computer is not fast enough, you can speed up the
  355. compression at the expense of the compression ratio. You can use
  356. '-me zero' to speed up motion estimation, and '-intra' to disable
  357. completely motion estimation (you have only I frames, which means it
  358. is about as good as JPEG compression).
  359. <LI>To have very low bitrates in audio, reduce the sampling frequency
  360. (down to 22050 kHz for mpeg audio, 22050 or 11025 for ac3).
  361. <LI>To have a constant quality (but a variable bitrate), use the option
  362. '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
  363. quality).
  364. <LI>When converting video files, you can use the '-sameq' option which
  365. uses in the encoder the same quality factor than in the decoder. It
  366. allows to be almost lossless in encoding.
  367. </UL>
  368. <H1><A NAME="SEC13" HREF="ffmpeg-doc.html#TOC13">5. Supported File Formats and Codecs</A></H1>
  369. <P>
  370. You can use the <CODE>-formats</CODE> option to have an exhaustive list.
  371. <H2><A NAME="SEC14" HREF="ffmpeg-doc.html#TOC14">5.1 File Formats</A></H2>
  372. <P>
  373. FFmpeg supports the following file formats through the <CODE>libavformat</CODE>
  374. library:
  375. <TABLE BORDER>
  376. <TR><TD>Supported File Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
  377. </TR>
  378. <TR><TD>MPEG audio </TD><TD> X </TD><TD> X</TD>
  379. </TR>
  380. <TR><TD>MPEG1 systems </TD><TD> X </TD><TD> X</TD>
  381. </TD><TD> muxed audio and video
  382. </TR>
  383. <TR><TD>MPEG2 PS </TD><TD> X </TD><TD> X</TD>
  384. </TD><TD> also known as <CODE>VOB</CODE> file
  385. </TR>
  386. <TR><TD>MPEG2 TS </TD><TD> </TD><TD> X</TD>
  387. </TD><TD> also known as DVB Transport Stream
  388. </TR>
  389. <TR><TD>ASF</TD><TD> X </TD><TD> X</TD>
  390. </TR>
  391. <TR><TD>AVI</TD><TD> X </TD><TD> X</TD>
  392. </TR>
  393. <TR><TD>WAV</TD><TD> X </TD><TD> X</TD>
  394. </TR>
  395. <TR><TD>Macromedia Flash</TD><TD> X </TD><TD> X</TD>
  396. </TD><TD> Only embedded audio is decoded
  397. </TR>
  398. <TR><TD>Real Audio and Video </TD><TD> X </TD><TD> X</TD>
  399. </TR>
  400. <TR><TD>Raw AC3 </TD><TD> X </TD><TD> X</TD>
  401. </TR>
  402. <TR><TD>Raw MJPEG </TD><TD> X </TD><TD> X</TD>
  403. </TR>
  404. <TR><TD>Raw MPEG video </TD><TD> X </TD><TD> X</TD>
  405. </TR>
  406. <TR><TD>Raw PCM8/16 bits, mulaw/Alaw</TD><TD> X </TD><TD> X</TD>
  407. </TR>
  408. <TR><TD>SUN AU format </TD><TD> X </TD><TD> X</TD>
  409. </TR>
  410. <TR><TD>Quicktime </TD><TD> </TD><TD> X</TD>
  411. </TR>
  412. <TR><TD>MPEG4 </TD><TD> </TD><TD> X</TD>
  413. </TD><TD> MPEG4 is a variant of Quicktime
  414. </TR>
  415. <TR><TD>Raw MPEG4 video </TD><TD> X </TD><TD> X</TD>
  416. </TR>
  417. <TR><TD>DV </TD><TD> </TD><TD> X</TD>
  418. </TD><TD> Only the video track is decoded.
  419. </TR></TABLE>
  420. <P>
  421. <CODE>X</CODE> means that the encoding (resp. decoding) is supported.
  422. <H2><A NAME="SEC15" HREF="ffmpeg-doc.html#TOC15">5.2 Image Formats</A></H2>
  423. <P>
  424. FFmpeg can read and write images for each frame of a video sequence. The
  425. following image formats are supported:
  426. <TABLE BORDER>
  427. <TR><TD>Supported Image Format </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
  428. </TR>
  429. <TR><TD>PGM, PPM </TD><TD> X </TD><TD> X</TD>
  430. </TR>
  431. <TR><TD>PGMYUV </TD><TD> X </TD><TD> X </TD><TD> PGM with U and V components in 420</TD>
  432. </TR>
  433. <TR><TD>JPEG </TD><TD> X </TD><TD> X </TD><TD> Progressive JPEG is not supported</TD>
  434. </TR>
  435. <TR><TD>.Y.U.V </TD><TD> X </TD><TD> X </TD><TD> One raw file per component</TD>
  436. </TR>
  437. <TR><TD>Animated GIF </TD><TD> X </TD><TD> </TD><TD> Only uncompressed GIFs are generated</TD>
  438. </TR></TABLE>
  439. <P>
  440. <CODE>X</CODE> means that the encoding (resp. decoding) is supported.
  441. <H2><A NAME="SEC16" HREF="ffmpeg-doc.html#TOC16">5.3 Video Codecs</A></H2>
  442. <TABLE BORDER>
  443. <TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
  444. </TR>
  445. <TR><TD>MPEG1 video </TD><TD> X </TD><TD> X</TD>
  446. </TR>
  447. <TR><TD>MPEG2 video </TD><TD> </TD><TD> X</TD>
  448. </TR>
  449. <TR><TD>MPEG4 </TD><TD> X </TD><TD> X </TD><TD> Also known as DIVX4/5</TD>
  450. </TR>
  451. <TR><TD>MSMPEG4 V1 </TD><TD> X </TD><TD> X</TD>
  452. </TR>
  453. <TR><TD>MSMPEG4 V2 </TD><TD> X </TD><TD> X</TD>
  454. </TR>
  455. <TR><TD>MSMPEG4 V3 </TD><TD> X </TD><TD> X </TD><TD> Also known as DIVX3</TD>
  456. </TR>
  457. <TR><TD>WMV7 </TD><TD> X </TD><TD> X</TD>
  458. </TR>
  459. <TR><TD>H263(+) </TD><TD> X </TD><TD> X </TD><TD> Also known as Real Video 1.0</TD>
  460. </TR>
  461. <TR><TD>MJPEG </TD><TD> X </TD><TD> X</TD>
  462. </TR>
  463. <TR><TD>DV </TD><TD> </TD><TD> X</TD>
  464. </TR>
  465. <TR><TD>Huff YUV </TD><TD> X </TD><TD> X</TD>
  466. </TR></TABLE>
  467. <P>
  468. <CODE>X</CODE> means that the encoding (resp. decoding) is supported.
  469. <P>
  470. Check at <A HREF="http://www.mplayerhq.hu/~michael/codec-features.html">http://www.mplayerhq.hu/~michael/codec-features.html</A> to
  471. get a precise comparison of FFmpeg MPEG4 codec compared to the other
  472. solutions.
  473. <H2><A NAME="SEC17" HREF="ffmpeg-doc.html#TOC17">5.4 Audio Codecs</A></H2>
  474. <TABLE BORDER>
  475. <TR><TD>Supported Codec </TD><TD> Encoding </TD><TD> Decoding </TD><TD> Comments</TD>
  476. </TR>
  477. <TR><TD>MPEG audio layer 2 </TD><TD> IX </TD><TD> IX</TD>
  478. </TR>
  479. <TR><TD>MPEG audio layer 1/3 </TD><TD> IX </TD><TD> IX</TD>
  480. </TD><TD> MP3 encoding is supported through the external library LAME
  481. </TR>
  482. <TR><TD>AC3 </TD><TD> IX </TD><TD> X</TD>
  483. </TD><TD> liba52 is used internally for decoding.
  484. </TR>
  485. <TR><TD>Vorbis </TD><TD> X </TD><TD> X</TD>
  486. </TD><TD> supported through the external library libvorbis.
  487. </TR>
  488. <TR><TD>WMA V1/V2 </TD><TD> </TD><TD> X</TD>
  489. </TR></TABLE>
  490. <P>
  491. <CODE>X</CODE> means that the encoding (resp. decoding) is supported.
  492. <P>
  493. <CODE>I</CODE> means that an integer only version is available too (ensures highest
  494. performances on systems without hardware floating point support).
  495. <H1><A NAME="SEC18" HREF="ffmpeg-doc.html#TOC18">6. Platform Specific information</A></H1>
  496. <H2><A NAME="SEC19" HREF="ffmpeg-doc.html#TOC19">6.1 Linux</A></H2>
  497. <P>
  498. ffmpeg should be compiled with at least GCC 2.95.3. GCC 3.2 is the
  499. preferred compiler now for ffmpeg. All future optimizations will depend on
  500. features only found in GCC 3.2.
  501. <H2><A NAME="SEC20" HREF="ffmpeg-doc.html#TOC20">6.2 BSD</A></H2>
  502. <H2><A NAME="SEC21" HREF="ffmpeg-doc.html#TOC21">6.3 Windows</A></H2>
  503. <H2><A NAME="SEC22" HREF="ffmpeg-doc.html#TOC22">6.4 MacOS X</A></H2>
  504. <H2><A NAME="SEC23" HREF="ffmpeg-doc.html#TOC23">6.5 BeOS</A></H2>
  505. <P>
  506. The configure script should guess the configuration itself.
  507. Networking support is currently not finished.
  508. errno issues fixed by Andrew Bachmann.
  509. <P>
  510. Old stuff:
  511. <P>
  512. François Revol - revol at free dot fr - April 2002
  513. <P>
  514. The configure script should guess the configuration itself,
  515. however I still didn't tested building on net_server version of BeOS.
  516. <P>
  517. ffserver is broken (needs poll() implementation).
  518. <P>
  519. There is still issues with errno codes, which are negative in BeOs, and
  520. that ffmpeg negates when returning. This ends up turning errors into
  521. valid results, then crashes.
  522. (To be fixed)
  523. <H1><A NAME="SEC24" HREF="ffmpeg-doc.html#TOC24">7. Developers Guide</A></H1>
  524. <H2><A NAME="SEC25" HREF="ffmpeg-doc.html#TOC25">7.1 API</A></H2>
  525. <UL>
  526. <LI>libavcodec is the library containing the codecs (both encoding and
  527. decoding). See <TT>`libavcodec/apiexample.c'</TT> to see how to use it.
  528. <LI>libavformat is the library containing the file formats handling (mux and
  529. demux code for several formats). (no example yet, the API is likely to
  530. evolve).
  531. </UL>
  532. <H2><A NAME="SEC26" HREF="ffmpeg-doc.html#TOC26">7.2 Integrating libavcodec or libavformat in your program</A></H2>
  533. <P>
  534. You can integrate all the source code of the libraries to link them
  535. statically to avoid any version problem. All you need is to provide a
  536. 'config.mak' and a 'config.h' in the parent directory. See the defines
  537. generated by ./configure to understand what is needed.
  538. <P>
  539. You can use libavcodec or libavformat in your commercial program, but
  540. <EM>any patch you make must be published</EM>. The best way to proceed is
  541. to send your patches to the ffmpeg mailing list.
  542. <H2><A NAME="SEC27" HREF="ffmpeg-doc.html#TOC27">7.3 Coding Rules</A></H2>
  543. <P>
  544. ffmpeg is programmed in ANSI C language. GCC extensions are
  545. tolerated. Indent size is 4. The TAB character should not be used.
  546. <P>
  547. The presentation is the one specified by 'indent -i4 -kr'.
  548. <P>
  549. Main priority in ffmpeg is simplicity and small code size (=less
  550. bugs).
  551. <P>
  552. Comments: for functions visible from other modules, use the JavaDoc
  553. format (see examples in <TT>`libav/utils.c'</TT>) so that a documentation
  554. can be generated automatically.
  555. <H2><A NAME="SEC28" HREF="ffmpeg-doc.html#TOC28">7.4 Submitting patches</A></H2>
  556. <P>
  557. When you submit your patch, try to send a unified diff (diff '-u'
  558. option). I cannot read other diffs :-)
  559. <P>
  560. Run the regression tests before submitting a patch so that you can
  561. verify that there are no big problems.
  562. <P>
  563. Patches should be posted as base64 encoded attachments (or any other
  564. encoding which ensures that the patch wont be trashed during
  565. transmission) to the ffmpeg-devel mailinglist, see
  566. <A HREF="http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel">http://lists.sourceforge.net/lists/listinfo/ffmpeg-devel</A>
  567. <H2><A NAME="SEC29" HREF="ffmpeg-doc.html#TOC29">7.5 Regression tests</A></H2>
  568. <P>
  569. Before submitting a patch (or committing with CVS), you should at least
  570. test that you did not break anything.
  571. <P>
  572. The regression test build a synthetic video stream and a synthetic
  573. audio stream. Then these are encoded then decoded with all codecs or
  574. formats. The CRC (or MD5) of each generated file is recorded in a
  575. result file. Then a 'diff' is launched with the reference results and
  576. the result file.
  577. <P>
  578. The regression test then goes on to test the ffserver code with a
  579. limited set of streams. It is important that this step runs correctly
  580. as well.
  581. <P>
  582. Run 'make test' to test all the codecs.
  583. <P>
  584. Run 'make libavtest' to test all the codecs.
  585. <P>
  586. [Of course, some patches may change the regression tests results. In
  587. this case, the regression tests reference results shall be modified
  588. accordingly].
  589. <P><HR><P>
  590. This document was generated on 17 April 2003 using
  591. <A HREF="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</A>&nbsp;1.56k.
  592. </BODY>
  593. </HTML>