Advertisement
Guest User

0.2 howto compile ffmpeg

a guest
Jan 26th, 2011
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.38 KB | None | 0 0
  1. Original instructions
  2. courtesy qyot27 from
  3. http://doom10.org/index.php?topic=1234.new;topicseen#new
  4. http://pastebin.com/7jRtWUXR
  5. and courtesy liquid217 from
  6. http://forum.videohelp.com/threads/331105-help-how-to-compile-latest-nightly-ffmpeg-for-win32-%28XP%29-with-mingw?p=2051519#post2051519
  7.  
  8.  
  9.  
  10. 0. Create yourself a VM with XP in it. Within that, do the following.
  11.  
  12. 1. Download and install XP PowerToys "Open Command Window Here" from
  13. http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
  14.  
  15. 2. Download an install 7zip from http://www.7-zip.org/
  16.  
  17. 3. Download and install latest the Mingw automated installer from
  18. http://sourceforge.net/projects/mingw/
  19. You will need to check the "MSYS Basic System", and the "MinGW Developer Toolkit".
  20.  
  21. 4.1 Download and extract the latest of following packages into C:\MinGW\msys\1.0\bin
  22. The utilities must be placed directly in this path, not a subdirectory of it.
  23. wget 1.11.4 http://users.ugent.be/~bpuype/cgi-bin/fetch.pl?dl=wget/wget.exe
  24. 7zip CLI http://www.7-zip.org/download.html -- note we want the CLI version
  25.  
  26. 4.2 Download the latest Win32 exe UNRAR from http://www.rarlab.com/rar/unrarw32.exe
  27. Put it into the msys's bin directory (c:\mingw\msys\1.0\bin).
  28.  
  29. 4.3 Download the latest Win32 exe yasm from
  30. http://www.tortall.net/projects/yasm/wiki/Download
  31. Rename it to yasm.exe, and put it in the msys's bin directory (c:\mingw\msys\1.0\bin).
  32.  
  33. 4.4 Download the Win32 exe nasm from http://www.nasm.us
  34. The current version is http://www.nasm.us/pub/nasm/releasebuilds/2.09.04/win32/nasm-2.09.04-win32.zip
  35. Extract both nasm.exe and ndisasm.exe into the msys's bin directory (c:\mingw\msys\1.0\bin).
  36.  
  37. 5. In Windows Explorer, show folders and navigate to c:\mingw\msys\1.0 (old instrictions said "C:\msys\1.0"),
  38. Right-click on the "1.0" in the folders pane, and choose the "Open Command Window Here" option.
  39. Type 'msys --norxvt' (without the quotes), and hit enter.
  40. On first load, it will create a directory for you with your name in the 'home' directory.
  41. For instance, c:\mingw\msys\1.0\home\qyot27 or c:\mingw\msys\1.0\home\myusername
  42. From here on out, I'll be using Unix-style directory naming when talking about the compiling process
  43. - c:\mingw\msys\1.0 is referred to as /, and the folders beneath it would be /bin, /home, /local, or so on).
  44. * other cmd tool ** Now, right-click on the Prompt's title bar and choose Properties.
  45. * other cmd tool ** Under the 'Edit Options' area, make sure that QuickEdit mode is checked, and then click OK.
  46. * other cmd tool ** When the Apply Properties dialog comes up, choose 'Save properties for future windows with same title'.
  47.  
  48. 5.1 In Windows Explorer, show folders and navigate to c:\mingw\msys\1.0
  49. Right-click on the file msys.bat and drag it somewhere onto whitespace in that folder andrelease the right-click.
  50. Select "Create Shortrcut Here" from the pop-up context menu.
  51. Right-click on the new shortcut and rename it to get rid of the ".bat".
  52. Right-click on the new shortcut and choose "Properties".
  53. * add --norxvt to the Target, so that it looks like this C:\MinGW\msys\1.0\msys.bat --norxvt
  54. * ensure the "Start In" is set to C:\MinGW\msys\1.0
  55. Now you can copy this shortcut to wherever you want - desktop, quickstart bar etc - and use it to start msys.
  56.  
  57. 6. There are a couple things you should compile and install first, though. The latest zlib and bzip2.
  58. (from time to time, check these version are the latest by checking the websites http://zlib.net and http://bzip.org)
  59.  
  60. Assuming your username is "yourusername" then do the following...
  61. With the MSys prompt open, copy and paste the following commands and hit Enter after each line:
  62.  
  63. cd /home/yourusername
  64. wget http://zlib.net/zlib-1.2.5.tar.gz
  65. tar -xzvf zlib-1.2.5.tar.gz
  66. cd zlib-1.2.5
  67. make -f win32/Makefile.gcc BINARY_PATH=/mingw/bin INCLUDE_PATH=/mingw/include LIBRARY_PATH=/mingw/lib install
  68. cd /home/yourusername
  69. wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
  70. tar -xzvf bzip2-1.0.6.tar.gz
  71. cd bzip2-1.0.6
  72. make
  73. make install
  74. cp *.h /mingw/include
  75. cp *.a /mingw/lib
  76. exit
  77.  
  78. 7. Download Git, which you'll need to download ffmpeg's source code. Download the installer from here:
  79. http://code.google.com/p/msysgit/
  80. Specifically as at 26 Jan 2011 :-
  81. http://code.google.com/p/msysgit/downloads/detail?name=Git-1.7.3.1-preview20101002.exe
  82.  
  83. Launch the installer, and click Next until you get to selecting the components you want to install.
  84. Uncheck everything but Windows Explorer integration, and under that section, choose the 'Context menu entries' option.
  85. You can uncheck 'Git GUI Here' if you want, as you won't be using it.
  86. Just make sure that 'Git Bash Here' is checked.
  87. Now keep on clicking Next until the install finishes.
  88.  
  89. 7.1 Now, you should be in Windows Explorer looking inside C:\msys\1.0\home\yourusername for the next bit.
  90. In the left pane of Windows Explorer, right click on the new 'yourusername' folder and choose Git Bash Here.
  91.  
  92. 8. With the Git Bash window still open, type or copy-&-paste the following command and then hit Enter:
  93. git clone git://git.ffmpeg.org/ffmpeg.git
  94.  
  95. 9. That will create a folder named ffmpeg and download FFmpeg's source code into it. Wait.
  96. When the download is finished, close the Git Bash window by typing in the command: exit
  97.  
  98. 10. Open the MSys window like previously described
  99. (right-click, Open Command Prompt Here, 'msys --norxvt'), or even better - use the Shortcut you created earlier
  100.  
  101. 12. Now that MSys' prompt is open, type or copy-&-paste the following commands - hit Enter after each one:
  102. cd ffmpeg
  103. ./configure --enable-gpl --enable-version3 --enable-postproc --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --extra-cflags="-U__STRICT_ANSI__"
  104. make
  105. make install
  106. exit
  107.  
  108.  
  109.  
  110. Things to try
  111. ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --extra-cflags="-U__STRICT_ANSI__"
  112.  
  113.  
  114.  
  115. (Special note for the above:
  116. IF you're going to be using the build on just ONE computer,
  117. Leave out --enable-runtime-cpudetect and add '-march=native' to the --extra-cflags option, like this: --extra-cflags="-march=native -U__STRICT_ANSI__"
  118. In other words to make it portable, DO NOT do this)
  119.  
  120. 13. Generally speaking, the same steps apply to just about any type of software you can compile with GCC:
  121. A './configure' step
  122. A 'make' step
  123. A 'make install' step
  124. Yes, sometimes the actual steps differ, but the assumption is typically that the above three commands are the default.
  125. Before attempting this, though, make sure that there's actually a file in the source code's directory named 'configure'
  126. - if there isn't, that means it uses a different process, and there's usually files named INSTALL or README
  127. which you can refer to in order to see if they describe the build process for that piece of software.
  128. Also, whenever dealing with the ./configure step,
  129. it's usually possible to do './configure --help', which will list all the options you can give to ./configure.
  130.  
  131.  
  132. 14. The files/options specified by http://ffmpeg.arrozcru.org/autobuilds/ffmpeg/readme/ffmpeg-r26400-swscale-r32676-README
  133. are
  134. Automated FFmpeg 32-bit Windows builds made by Ramiro Polla.
  135.  
  136. FFmpeg revision: 26400
  137. SwScale revision: 32676
  138.  
  139. Build date: Tue, 18 Jan 2011 04:05:32 -0200
  140.  
  141. libswscale version: 0.12.0
  142. libavcodec version: 52.108.0
  143. libavcore version: 0.16.1
  144. libavdevice version: 52.2.3
  145. libavformat version: 52.93.0
  146. libavutil version: 50.36.0
  147. libavfilter version: 1.74.0
  148.  
  149. FFmpeg configuration:
  150. --enable-gpl
  151. --enable-version3
  152. --enable-libgsm
  153. --enable-libvorbis
  154. --enable-libtheora
  155. --enable-libspeex
  156. --enable-libmp3lame
  157. --enable-libopenjpeg
  158. --enable-libschroedinger
  159. --enable-libopencore_amrwb
  160. --enable-libopencore_amrnb
  161. --enable-libvpx --disable-decoder=libvpx
  162. --arch=x86
  163. --enable-runtime-cpudetect
  164. --enable-libxvid
  165. --enable-libx264
  166. --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm'
  167. --target-os=mingw32
  168. --enable-avisynth
  169. --enable-w32threads
  170. --cross-prefix=i686-mingw32-
  171. --cc='ccache i686-mingw32-gcc'
  172. --enable-memalign-hack
  173.  
  174. All source code used can be found at:
  175. http://ffmpeg.arrozcru.org/autobuilds
  176.  
  177. Comments, suggestions, bug reports, compliments, donations, etc:
  178. http://ffmpeg.arrozcru.org/forum
  179.  
  180. These builds are cross-compiled from an amd64 Ubuntu Jaunty system.
  181. The relevant development package versions from the main repository are:
  182. nasm 2.05.01-1
  183. yasm 0.7.1-0ubuntu2
  184.  
  185. The cross-compilation packages are available from:
  186. http://apt.arrozcru.org
  187.  
  188. The cross-development package versions from that repository are:
  189. mingw32-gcc-4.4 4.4.2-1
  190. mingw32-binutils 2.20-1
  191. mingw32-runtime 3.17-1
  192. mingw32-w32api 3.14-1
  193.  
  194. The external libraries compiled into FFmpeg are:
  195.  
  196. http://www.bzip.org
  197. mingw32-bzip2 1.0.5-1
  198.  
  199. http://www.quut.com/gsm/
  200. mingw32-libgsm 1.0-pl13-2
  201.  
  202. http://lame.sourceforge.net
  203. mingw32-libmp3lame 3.98.4-1
  204.  
  205. http://code.entropywave.com/projects/orc/
  206. mingw32-liborc 0.4.5-1
  207.  
  208. http://sourceforge.net/projects/opencore-amr
  209. mingw32-libopencore-amr 0.1.2-1
  210.  
  211. http://www.openjpeg.org
  212. mingw32-libopenjpeg 1.3-1
  213.  
  214. http://diracvideo.org
  215. mingw32-libschroedinger 1.0.9-2
  216.  
  217. http://www.libsdl.org
  218. mingw32-libsdl 1.2.14-3
  219.  
  220. http://www.xiph.org
  221. mingw32-libogg 1.2.2-1
  222. mingw32-libvorbis 1.3.2-1
  223. mingw32-libspeex 1.2rc1-1
  224. mingw32-libtheora 1.1.1-1
  225.  
  226. http://www.videolan.org/developers/x264.html
  227. mingw32-libx264 1834-1
  228.  
  229. http://www.polarssl.org
  230. mingw32-polarssl 0.13.1-1
  231.  
  232. http://rtmpdump.mplayerhq.hu
  233. mingw32-librtmp 537-1
  234.  
  235. http://www.xvid.org
  236. mingw32-libxvid 1.2.2-1
  237.  
  238. http://www.webmproject.org
  239. mingw32-libvpx 0.9.5-1
  240.  
  241. http://www.zlib.net
  242. mingw32-zlib 1.2.5-1
  243.  
  244. The license for each library can be found in the licenses directory.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement