分享

Mingw msys编译ffmpeg 0.6.1 win7下

 su_day 2013-04-26

Mingw msys编译ffmpeg 0.6.1 win7下

到官网上下载新版的ffmpeg  0.6.1 :http://www./releases/ffmpeg-0.6.1.tar.bz2

 

我当时下载mingw安装时是完全在线安装,在mingw目录下会有msys

 

我mingw装在c:/mingw 下,msys在c:/mingw /msys

 

编译ffmpeg 还需要SDL   地址:http://www./release/SDL-1.2.14.tar.gz

解压该软件包;
将lib下的所有文件复制到C:/mingw/lib;
将include下的所有文件复制到C:/mingw/include;
将bin下的i386-mingw32msvc-sdl-config复制到C:/mingw/bin,并重命名为sdl-config;
将bin下的SDL.dll复制到C:/mingw/bin中。

并找到sdl的源码包,将其中的include文件复制到C:/mingw/include中

(因为ffmpeg例子依赖其头文件)

 

解压ffmpeg-0.6.1.tar.bz2,复制到盘,c:/ffmpeg-0.6.1  (此文件夹中就有configure等文件了)

打开msys/1.0/etc中的文件fstab 增加一行:C:/ffmpeg-0.6.1

接着运行:msys.bat文件,启动了命令行界面:

切换到cd C:/ffmpeg-0.6.1

 

接着输入命令:

./configure --enable-memalign-hack

 

可能不妙,会出现configure: line ***: pr: command not found  的问题。

这样,我们还需要下载coreutils   下载地址:http://ftp./gnu/coreutils/

安装coreutils  打开其安装目录,复制其bin文件夹中的pr.exe ,libintl3.dll,libiconv2.dll 这三个文件到mingw/bin中,OK

 

用msys.bat重启命令行界面,

输入:

   ./configure --enable-memalign-hack --enable-shared

 

通过了,

之后,

make

之后

make install

 

完工。

得到的文件在msys/1.0/local中

其中的bin中有

ffmpeg.exe

ffprobe.exe  (ffmpeg-0.6.1中有4个可执行文件)

include文件夹中包含

libavcodec

libavdevice

libavformat

libavutil

libswscale

5个文件夹

lib中有上面对应的5个.a静态库文件

总共49.5M

  --------------------------------

生成vc环境下可用的dll,lib库文件

在msys.bat中加入下面语句:

call "D:/Program Files/Microsoft Visual Studio 9.0/VC/bin/VCVARS32.BAT"    

(自己给出相应路径)

msys.bat启动,输入命令:

./configure --enable-shared --disable-static --enable-memalign-hack

make

make install

 

生成的dll,lib在msys/1.0/local中

 

 

 =====================================

以下是其个性化定制,自已找相应的支持库。 ./configure   中

 

 Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                   print this message
  --logfile=FILE           log tests and output to FILE [config.err]
  --disable-logging        do not log configure debug information
  --prefix=PREFIX          install in PREFIX [$prefix]
  --bindir=DIR             install binaries in DIR [PREFIX/bin]
  --datadir=DIR            install data files in DIR [PREFIX/share/ffmpeg]
  --libdir=DIR             install libs in DIR [PREFIX/lib]
  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
  --incdir=DIR             install includes in DIR [PREFIX/include]
  --mandir=DIR             install man page in DIR [PREFIX/share/man]

Configuration options:
  --disable-static         do not build static libraries [no]
  --enable-shared          build shared libraries [no]
  --enable-gpl             allow use of GPL code, the resulting libs
                           and binaries will be under GPL [no]
  --enable-version3        upgrade (L)GPL to version 3 [no]
  --enable-nonfree         allow use of nonfree code, the resulting libs
                           and binaries will be unredistributable [no]
  --disable-doc            do not build documentation
  --disable-ffmpeg         disable ffmpeg build
  --disable-ffplay         disable ffplay build
  --disable-ffprobe        disable ffprobe build
  --disable-ffserver       disable ffserver build
  --disable-avdevice       disable libavdevice build
  --disable-avcodec        disable libavcodec build
  --disable-avformat       disable libavformat build
  --disable-swscale        disable libswscale build
  --enable-postproc        enable GPLed postprocessing support [no]
  --enable-avfilter        video filter support [no]
  --enable-avfilter-lavf   video filters dependent on avformat [no]
  --enable-beosthreads     use BeOS threads [no]
  --enable-os2threads      use OS/2 threads [no]
  --enable-pthreads        use pthreads [no]
  --enable-w32threads      use Win32 threads [no]
  --enable-x11grab         enable X11 grabbing [no]
  --disable-network        disable network support [no]
  --disable-mpegaudio-hp   faster (but less accurate) MPEG audio decoding [no]
  --enable-gray            enable full grayscale support (slower color)
  --disable-swscale-alpha  disable alpha channel support in swscale
  --disable-fastdiv        disable table-based division
  --enable-small           optimize for size instead of speed
  --disable-aandct         disable AAN DCT code
  --disable-dct            disable DCT code
  --disable-fft            disable FFT code
  --disable-golomb         disable Golomb code
  --disable-lpc            disable LPC code
  --disable-mdct           disable MDCT code
  --disable-rdft           disable RDFT code
  --disable-vaapi          disable VAAPI code
  --disable-vdpau          disable VDPAU code
  --disable-dxva2          disable DXVA2 code
  --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  --enable-memalign-hack   emulate memalign, interferes with memory debuggers
  --enable-beos-netserver  enable BeOS netserver
  --disable-everything     disable all components listed below
  --disable-encoder=NAME   disable encoder NAME
  --enable-encoder=NAME    enable encoder NAME
  --disable-encoders       disable all encoders
  --disable-decoder=NAME   disable decoder NAME
  --enable-decoder=NAME    enable decoder NAME
  --disable-decoders       disable all decoders
  --disable-hwaccel=NAME   disable hwaccel NAME
  --enable-hwaccel=NAME    enable hwaccel NAME
  --disable-hwaccels       disable all hwaccels
  --disable-muxer=NAME     disable muxer NAME
  --enable-muxer=NAME      enable muxer NAME
  --disable-muxers         disable all muxers
  --disable-demuxer=NAME   disable demuxer NAME
  --enable-demuxer=NAME    enable demuxer NAME
  --disable-demuxers       disable all demuxers
  --enable-parser=NAME     enable parser NAME
  --disable-parser=NAME    disable parser NAME
  --disable-parsers        disable all parsers
  --enable-bsf=NAME        enable bitstream filter NAME
  --disable-bsf=NAME       disable bitstream filter NAME
  --disable-bsfs           disable all bitstream filters
  --enable-protocol=NAME   enable protocol NAME
  --disable-protocol=NAME  disable protocol NAME
  --disable-protocols      disable all protocols
  --disable-indev=NAME     disable input device NAME
  --disable-outdev=NAME    disable output device NAME
  --disable-indevs         disable input devices
  --disable-outdevs        disable output devices
  --disable-devices        disable all devices
  --enable-filter=NAME     enable filter NAME
  --disable-filter=NAME    disable filter NAME
  --disable-filters        disable all filters
  --list-decoders          show all available decoders
  --list-encoders          show all available encoders
  --list-hwaccels          show all available hardware accelerators
  --list-muxers            show all available muxers
  --list-demuxers          show all available demuxers
  --list-parsers           show all available parsers
  --list-protocols         show all available protocols
  --list-bsfs              show all available bitstream filters
  --list-indevs            show all available input devices
  --list-outdevs           show all available output devices
  --list-filters           show all available filters

External library support:
  --enable-avisynth        enable reading of AVISynth script files [no]
  --enable-bzlib           enable bzlib [autodetect]
  --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  --enable-libdc1394       enable IIDC-1394 grabbing using libdc1394
                           and libraw1394 [no]
  --enable-libdirac        enable Dirac support via libdirac [no]
  --enable-libfaac         enable FAAC support via libfaac [no]
  --enable-libfaad         enable FAAD support via libfaad [no]
  --enable-libfaadbin      open libfaad.so.0 at runtime [no]
  --enable-libgsm          enable GSM support via libgsm [no]
  --enable-libmp3lame      enable MP3 encoding via libmp3lame [no]
  --enable-libnut          enable NUT (de)muxing via libnut,
                           native (de)muxer exists [no]
  --enable-libopenjpeg     enable JPEG 2000 decoding via OpenJPEG [no]
  --enable-librtmp         enable RTMP[E] support via librtmp [no]
  --enable-libschroedinger enable Dirac support via libschroedinger [no]
  --enable-libspeex        enable Speex decoding via libspeex [no]
  --enable-libtheora       enable Theora encoding via libtheora [no]
  --enable-libvorbis       enable Vorbis encoding via libvorbis,
                           native implementation exists [no]
  --enable-libvpx          enable VP8 support via libvpx [no]
  --enable-libx264         enable H.264 encoding via x264 [no]
  --enable-libxvid         enable Xvid encoding via xvidcore,
                           native MPEG-4/Xvid encoder exists [no]
  --enable-mlib            enable Sun medialib [no]
  --enable-zlib            enable zlib [autodetect]

Advanced options (experts only):
  --source-path=PATH       path to source code [$source_path]
  --cross-prefix=PREFIX    use PREFIX for compilation tools [$cross_prefix]
  --enable-cross-compile   assume a cross-compiler is used
  --sysroot=PATH           root of cross-build tree
  --sysinclude=PATH        location of cross-build system headers
  --target-os=OS           compiler targets OS [$target_os]
  --target-exec=CMD        command to run executables on target
  --target-path=DIR        path to view of build directory on target
  --nm=NM                  use nm tool
  --ar=AR                  use archive tool AR [$ar_default]
  --as=AS                  use assembler AS [$as_default]
  --cc=CC                  use C compiler CC [$cc_default]
  --ld=LD                  use linker LD
  --host-cc=HOSTCC         use host C compiler HOSTCC
  --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
  --host-ldflags=HLDFLAGS  use HLDFLAGS when linking for host
  --host-libs=HLIBS        use libs HLIBS when linking for host
  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]
  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  --extra-libs=ELIBS       add ELIBS [$ELIBS]
  --extra-version=STRING   version string suffix []
  --build-suffix=SUFFIX    library name suffix []
  --arch=ARCH              select architecture [$arch]
  --cpu=CPU                select the minimum required CPU (affects
                           instruction selection, may crash on older CPUs)
  --enable-powerpc-perf    enable performance report on PPC
                           (requires enabling PMC)
  --disable-asm            disable all assembler optimizations
  --disable-altivec        disable AltiVec optimizations
  --disable-amd3dnow       disable 3DNow! optimizations
  --disable-amd3dnowext    disable 3DNow! extended optimizations
  --disable-mmx            disable MMX optimizations
  --disable-mmx2           disable MMX2 optimizations
  --disable-sse            disable SSE optimizations
  --disable-ssse3          disable SSSE3 optimizations
  --disable-armv5te        disable armv5te optimizations
  --disable-armv6          disable armv6 optimizations
  --disable-armv6t2        disable armv6t2 optimizations
  --disable-armvfp         disable ARM VFP optimizations
  --disable-iwmmxt         disable iwmmxt optimizations
  --disable-mmi            disable MMI optimizations
  --disable-neon           disable neon optimizations
  --disable-vis            disable VIS optimizations
  --disable-yasm           disable use of yasm assembler
  --enable-pic             build position-independent code
  --malloc-prefix=PFX      prefix malloc and related names with PFX
  --enable-sram            allow use of on-chip SRAM

Developer options (useful when working on FFmpeg itself):
  --disable-debug          disable debugging symbols
  --enable-debug=LEVEL     set the debug level [$debuglevel]
  --enable-gprof           enable profiling with gprof [$gprof]
  --disable-optimizations  disable compiler optimizations
  --enable-extra-warnings  enable more compiler warnings
  --disable-stripping      disable stripping of executables and shared libraries
  --samples=PATH           location of test samples for FATE

 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多