FFmpeg編譯口令

來源:互聯網
上載者:User

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.