FFmpeg编译口令

FFmpeg编译
编译pthreads-w32-2-8-0-release.tar.gz为动态库
tar zxfv pthreads-w32-2-8-0-release.tar.gz
patch -p0 < pthreads-w32-2-8-0.diff
cd pthreads-w32-2-8-0-release
make clean GC
cp pthreadGC2.dll /mingw/lib
cp pthreadGC2.dll /mingw/bin
cp pthreadGC2.dll /mingw/lib/pthread.dll
cp pthread.h sched.h /mingw/include

编译为静态库:
tar zxfv pthreads-w32-2-8-0-release.tar.gz
patch -p0 < pthreads-w32-2-8-0.diff
cd pthreads-w32-2-8-0-release
make clean GC-static
cp libpthreadGC2.a /mingw/lib
cp pthread.h sched.h /mingw/include


static编译:
cd /d/ffmpeg
./configure --enable-memalign-hack --extra-cflags="-fno-common"
make
make install

shared 编译:
cd /d/ffmpeg
./configure --enable-shared --disable-static --enable-memalign-hack --extra-cflags="-fno-common"
make
make install

PATH=$PATH:/usr/local/lib

当前目录会自动出现一个ffmpeg的目录,耐心等它下载完。我下的大小差不多32MB
./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame --enable-libxvid --enable-libfaad --enable-libfaadbin --enable-swscale --enable-pthreads
--enable-swscale一定要,后面编译mediastreamer2要用到

清理:
make distclean
或者make clean

MSVC编译需要的lib库
strmbasd.lib winmm.lib strmiids.lib
libavutil.lib libavcodec.lib libavformat.lib
可能还需要libswscale.lib

avutil-49.lib avformat-52.lib avcodec-52.lib

If you need it, you must also add libavdevice.a.
If your build has enabled the software scaler, you must also add libswscale.a.
Additionally, for static libraries, you must add libgcc.a, which belongs to MinGW. It must be the same library as the gcc version used to compile FFmpeg.
If you get an unresolved symbol to _snprint, you must also link to libmingwex.a, found in the MinGW lib folder.
If you get an unresolved symbol to _strcasecmp, you must also link to libcoldname.a, found in the MinGW lib folder.
Obviously, if you used any external library, you must also link to them (e.g. libxvidcore.a, libz.a).
static pthreads-w32 libraries must also be linked to wsock32.lib (from MSVC).
static x264 libraries must also be linked to pthreads-w32 (which in their turn need wsock32.lib).
If avisynth was enabled, you must also link to vfw32.lib.
If you get an unresolved symbol to *_lc_codepage, you must either use a non-DLL runtime library (in C/C++->Code Generation->Runtime Library), or also link to libmsvcrt.a, found in the MinGW lib folder, which is probably an incredibly stupid idea (I should investigate further).

Additional Dependencies
libavcodec.a libavformat.a libavutil.a libswscale.a libz.a libdts.a libfaac.a
libfaad.a libgsm.a libmp3lame.a libnut.a libogg.a libtheora.a libvorbis.a
libvorbisenc.a libx264.a libxvidcore.a libpthreadGC2.a libgcc.a libmingwex.a
wsock32.lib vfw32.lib

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值