faq.texi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. \input texinfo @c -*- texinfo -*-
  2. @settitle FFmpeg FAQ
  3. @titlepage
  4. @sp 7
  5. @center @titlefont{FFmpeg FAQ}
  6. @sp 3
  7. @end titlepage
  8. @chapter General Problems
  9. @section I cannot read this file although this format seems to be supported by ffmpeg.
  10. Even if ffmpeg can read the file format, it may not support all its
  11. codecs. Please consult the supported codec list in the ffmpeg
  12. documentation.
  13. @section How do I encode JPEGs to another format ?
  14. If the JPEGs are named img1.jpg, img2.jpg, img3.jpg,..., use:
  15. @example
  16. ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
  17. @end example
  18. @samp{%d} is replaced by the image number.
  19. @file{img%03d.jpg} generates @file{img001.jpg}, @file{img002.jpg}, etc...
  20. The same system is used for the other image formats.
  21. @section How do I encode movie to single pictures ?
  22. Use:
  23. @example
  24. ffmpeg -i movie.mpg movie%d.jpg
  25. @end example
  26. The @file{movie.mpg} used as input will be converted to
  27. @file{movie1.jpg}, @file{movie2.jpg}, etc...
  28. Instead of relying on file format self-recognition, you may also use
  29. @table @option
  30. @item -vcodec ppm
  31. @item -vcodec png
  32. @item -vcodec mjpeg
  33. @end table
  34. to force the encoding.
  35. Applying that to the previous example:
  36. @example
  37. ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
  38. @end example
  39. Beware that there is no "jpeg" codec. Use "mjpeg" instead.
  40. @section FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it ?
  41. No. FFmpeg only supports open source codecs. Windows DLLs are not
  42. portable, bloated and often slow.
  43. @section I get "Unsupported codec (id=86043) for input stream #0.1". What is the problem ?
  44. This is the Qcelp codec, FFmpeg has no support for that codec currently. Try mencoder/mplayer it might work.
  45. @section Why do I see a slight quality degradation with multithreaded MPEG* encoding ?
  46. For multithreaded MPEG* encoding, the encoded slices must be independent,
  47. otherwise thread n would practically have to wait for n-1 to finish, so it's
  48. quite logical that there is a small reduction of quality. This is not a bug.
  49. @section How can I read from the standard input or write to the standard output ?
  50. Use @file{-} as filename.
  51. @section Why does ffmpeg not decode audio in VOB files ?
  52. The audio is AC3 (a.k.a. A/52). AC3 decoding is an optional component in ffmpeg
  53. as the component that handles AC3 decoding (liba52) is currently released under
  54. the GPL. If you have liba52 installed on your system, enable AC3 decoding
  55. with @code{./configure --enable-liba52 --enable-gpl}. Take care: by
  56. enabling AC3, you automatically change the license of libavcodec from
  57. LGPL to GPL.
  58. @section Which codecs are supported by Windows ?
  59. Windows does not support standard formats like MPEG very well, unless you
  60. install some additional codecs
  61. The following list of video codecs should work on most Windows systems:
  62. @table @option
  63. @item msmpeg4v2
  64. .avi/.asf
  65. @item msmpeg4
  66. .asf only
  67. @item wmv1
  68. .asf only
  69. @item wmv2
  70. .asf only
  71. @item mpeg4
  72. only if you have some MPEG-4 codec installed like ffdshow or XviD
  73. @item mpeg1
  74. .mpg only
  75. @end table
  76. Note, ASF files often have .wmv or .wma extensions in Windows. It should also
  77. be mentioned that Microsoft claims a patent on the ASF format, and may sue
  78. or threaten users who create ASF files with non-Microsoft software. It is
  79. strongly advised to avoid ASF where possible.
  80. The following list of audio codecs should work on most Windows systems:
  81. @table @option
  82. @item adpcm_ima_wav
  83. @item adpcm_ms
  84. @item pcm
  85. @item mp3
  86. if some MP3 codec like LAME is installed
  87. @end table
  88. @section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
  89. This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
  90. (@url{http://svn.mplayerhq.hu/michael/trunk/patches/bttv-420-2.4.26.patch?view=co}). This may also
  91. apply cleanly to other 2.4-series kernels.
  92. @section How do I avoid the ugly aliasing artifacts in bt8x8 captures on Linux?
  93. Pass 'combfilter=1 lumafilter=1' to the bttv driver. Note though that 'combfilter=1'
  94. will cause somewhat too strong filtering. A fix is to apply (@url{http://svn.mplayerhq.hu/michael/trunk/patches/bttv-comb-2.4.26.patch?view=co})
  95. or (@url{http://svn.mplayerhq.hu/michael/trunk/patches/bttv-comb-2.6.6.patch?view=co})
  96. and pass 'combfilter=2'.
  97. @section I have a problem with an old version of ffmpeg; where should I report it?
  98. Nowhere. Upgrade to the latest release or if there is no recent release upgrade
  99. to Subversion HEAD. You could also try to report it. Maybe you will get lucky and
  100. become the first person in history to get an answer different from "upgrade
  101. to Subversion HEAD".
  102. @section -f jpeg doesn't work.
  103. Try '-f image2 test%d.jpg'.
  104. @section Why can I not change the framerate?
  105. Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
  106. Choose a different codec with the -vcodec command line option.
  107. @section ffmpeg does not work; What is wrong?
  108. Try a 'make distclean' in the ffmpeg source directory before the build. If this does not help see
  109. (@url{http://ffmpeg.org/bugreports.php}).
  110. @section How do I encode XviD or DivX video with ffmpeg?
  111. Both XviD and DivX (version 4+) are implementations of the ISO MPEG-4
  112. standard (note that there are many other coding formats that use this
  113. same standard). Thus, use '-vcodec mpeg4' to encode these formats. The
  114. default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
  115. a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
  116. force the fourcc 'xvid' to be stored as the video fourcc rather than the
  117. default.
  118. @section How do I encode videos which play on the iPod?
  119. @table @option
  120. @item needed stuff
  121. -acodec aac -vcodec mpeg4 width<=320 height<=240
  122. @item working stuff
  123. 4mv, title
  124. @item non-working stuff
  125. B-frames
  126. @item example command line
  127. ffmpeg -i input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X output.mp4
  128. @end table
  129. @section How do I encode videos which play on the PSP?
  130. @table @option
  131. @item needed stuff
  132. -acodec aac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
  133. @item working stuff
  134. 4mv, title
  135. @item non-working stuff
  136. B-frames
  137. @item example command line
  138. ffmpeg -i input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp output.mp4
  139. @item needed stuff for H.264
  140. -acodec aac -vcodec h264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
  141. @item working stuff for H.264
  142. title, loop filter
  143. @item non-working stuff for H.264
  144. CAVLC
  145. @item example command line
  146. ffmpeg -i input -acodec aac -ab 128kb -vcodec h264 -b 1200kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
  147. @end table
  148. @section Which are good parameters for encoding high quality MPEG-4?
  149. '-mbd rd -flags +4mv+trell+aic -cmp 2 -subcmp 2 -g 300 -pass 1/2',
  150. things to try: '-bf 2', '-flags qprd', '-flags mv0', '-flags skiprd'.
  151. @section Which are good parameters for encoding high quality MPEG-1/MPEG-2?
  152. '-mbd rd -flags +trell -cmp 2 -subcmp 2 -g 100 -pass 1/2'
  153. but beware the '-g 100' might cause problems with some decoders.
  154. Things to try: '-bf 2', '-flags qprd', '-flags mv0', '-flags skiprd.
  155. @section Interlaced video looks very bad when encoded with ffmpeg, whats wrong?
  156. You should use '-flags +ilme+ildct' and maybe '-flags +alt' for interlaced
  157. material, and try '-top 0/1' if the result looks really messed-up.
  158. @section How can I read DirectShow files?
  159. If you have built FFmpeg with @code{./configure --enable-avisynth}
  160. (only possible on MinGW/Cygwin platforms),
  161. then you may use any file that DirectShow can read as input.
  162. (Be aware that this feature has been recently added,
  163. so you will need to help yourself in case of problems.)
  164. Just create an "input.avs" text file with this single line ...
  165. @example
  166. DirectShowSource("C:\path to your file\yourfile.asf")
  167. @end example
  168. ... and then feed that text file to FFmpeg:
  169. @example
  170. ffmpeg -i input.avs
  171. @end example
  172. For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
  173. @section My bugreport/mail to ffmpeg-devel/user has not received any replies.
  174. Likely reasons
  175. @itemize
  176. @item We are busy and haven't had time yet to read your report or
  177. investigate the issue.
  178. @item You didn't follow bugreports.html.
  179. @item You didn't use Subversion HEAD.
  180. @item You reported a segmentation fault without gdb output.
  181. @item You describe a problem but not how to reproduce it.
  182. @item It's unclear if you use ffmpeg as command line tool or use
  183. libav* from another application.
  184. @item You speak about a video having problems on playback but
  185. not what you use to play it.
  186. @item We have no faint clue what you are talking about besides
  187. that it is related to FFmpeg.
  188. @end itemize
  189. @chapter Development
  190. @section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
  191. Like most open source projects FFmpeg suffers from a certain lack of
  192. manpower. For this reason the developers have to prioritize the work
  193. they do and putting out releases is not at the top of the list, fixing
  194. bugs and reviewing patches takes precedence. Please don't complain or
  195. request more timely and/or frequent releases unless you are willing to
  196. help out creating them.
  197. @section Why doesn't FFmpeg support feature [xyz]?
  198. Because no one has taken on that task yet. FFmpeg development is
  199. driven by the tasks that are important to the individual developers.
  200. If there is a feature that is important to you, the best way to get
  201. it implemented is to undertake the task yourself.
  202. @section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat ?
  203. Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively,
  204. examine the source code for one of the many open source projects that
  205. already incorporate ffmpeg at (@url{projects.php}).
  206. @section Can you support my C compiler XXX ?
  207. It depends. If your compiler is C99-compliant, then patches to support
  208. it are likely to be welcome if they do not pollute the source code
  209. with @code{#ifdef}s related to the compiler.
  210. @section Visual C++ produces many errors.
  211. Visual C++ is not compliant to the C standard and does not support
  212. the inline assembly used in FFmpeg.
  213. If you wish - for whatever weird reason - to use Visual C++ for your
  214. project then you can link the Visual C++ code with libav* as long as
  215. you compile the latter with a working C compiler. For more information, see
  216. the @emph{Visual C++ compatibility} section in the FFmpeg documentation.
  217. There have been efforts to make FFmpeg compatible with Visual C++ in the
  218. past. However, they have all been rejected as too intrusive, especially
  219. since MinGW does the job perfectly adequately. None of the core developers
  220. work with Visual C++ and thus this item is low priority. Should you find
  221. the silver bullet that solves this problem, feel free to shoot it at us.
  222. @section Can I use FFmpeg or libavcodec under Windows ?
  223. Yes, but the MinGW tools @emph{must} be used to compile FFmpeg. You
  224. can link the resulting DLLs with any other Windows program. Read the
  225. @emph{Native Windows Compilation} and @emph{Visual C++ compatibility}
  226. sections in the FFmpeg documentation to find more information.
  227. To get help and instructions for using FFmpeg under Windows, check out
  228. the FFmpeg Windows Help Forum at
  229. @url{http://arrozcru.no-ip.org/ffmpeg/}.
  230. @section Can you add automake, libtool or autoconf support ?
  231. No. These tools are too bloated and they complicate the build.
  232. @section Why not rewrite ffmpeg in object-oriented C++ ?
  233. ffmpeg is already organized in a highly modular manner and does not need to
  234. be rewritten in a formal object language. Further, many of the developers
  235. favor straight C; it works for them. For more arguments on this matter,
  236. read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
  237. @section Why are the ffmpeg programs devoid of debugging symbols ?
  238. The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug
  239. information. Those binaries are strip'd to create ffmpeg, ffplay, etc. If
  240. you need the debug information, used the *_g versions.
  241. @section I do not like the LGPL, can I contribute code under the GPL instead ?
  242. Yes, as long as the code is optional and can easily and cleanly be placed
  243. under #ifdef CONFIG_GPL without breaking anything. So for example a new codec
  244. or filter would be OK under GPL while a bugfix to LGPL code would not.
  245. @section I want to compile xyz.c alone but my compiler produced many errors.
  246. Common code is in its own files in libav* and is used by the individual
  247. codecs. They will not work without the common parts, you have to compile
  248. the whole libav*. If you wish, disable some parts with configure switches.
  249. You can also try to hack it and remove more, but if you had problems fixing
  250. the compilation failure then you are probably not qualified for this.
  251. @section I have a file in memory / a API different from *open/*read/ libc how do i use it with libavformat ?
  252. You have to implement a URLProtocol, see libavformat/file.c in FFmpeg
  253. and libmpdemux/demux_lavf.c in MPlayer sources.
  254. @section I get "No compatible shell script interpreter found." in MSys.
  255. The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
  256. @section I tried to pass RTP packets into a decoder, but it doesn't work.
  257. Of course not, you MUST strip ALL RTP headers and assemble valid packets
  258. first, an MP3 decoder decodes MP3 packets not bastardized MP3 packets
  259. encapsulated in RTP. The same applies to all decoders, this is not specific
  260. to ffmpeg or libavcodec.
  261. @section Where can I find libav* headers for Pascal/Delphi?
  262. see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
  263. @section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
  264. see @url{http://svn.mplayerhq.hu/michael/trunk/docs/}
  265. @bye