vs2013编译ffmpeg之十五 libtheora、libogg、libvorbis、libmp3lame

libtheora

对应ffmpeg configure选项–enable-libtheora。
使用的版本是libtheora-1.2.0alpha1,libtheora-1.2.0alpha1\win32\VS2010下面有工程文件,用MSVC2013打开编译没有出现问题。需要修改工程属性,将libtheora_static工程的c/c++–>代码生成–>运行时库 由“多线程调试 DLL (/MDd)”改成“多线程调试(/MTd)”否则在ffmpeg的configure时加了–enable-libtheora,会导致下面的错:

link -DEBUG -LIBPATH:H:/MinGW/msys/1.0/home/AA/contribute/MSVC/SDL-1.2.13/VisualC/SDL/Debug -LIBPATH:H:/MinGW/msys/1.0/home/AA/contribute/MS
VC/faac-1.28/libfaac/Debug -LIBPATH:H:/MinGW/msys/1.0/home/AA/contribute/MSVC/lame-3.99.5/output/Debug -LIBPATH:../../../contribute/MSVC/x264-snapshot-20140315-2245 -LIBPATH:../../
../contribute/MSVC/libtheora-1.1.1/win32/VS2008/Win32/Debug -LIBPATH:../../../contribute/MSVC/openjpeg-2.0.0/bin/Debug -LIBPATH:../../../contribute/MSVC/libogg-1.3.1/win32/VS2010/W
in32/Debug -LIBPATH:../../../contribute/MSVC/libvorbis-1.3.4/win32/VS2010/Win32/Debug -LIBPATH:./extra_lib -nologo -out:test.exe test.o theora_static.lib ogg_static.lib
MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
test.exe : fatal error LNK1169: one or more multiply defined symbols found

另外,ffmpeg的Configure里面,将

enabled libtheora  && require  libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec –logg

改成:

enabled libtheora  && require  libtheora theora/theoraenc.h th_info_init libtheora_static.lib libogg_static.lib

由于libtheora-1.1.1在MSVC2010下工程打不开,所以用libtheora-1.2.0alpha1,这个版本可以在MSVC2010下编译通过。

libogg

libtheora和libvorbis都依赖于libogg。
官网上下载的libogg-1.3.1.tar.gz,MSVC2013打开libogg-1.3.1\win32\VS2010\ libogg_static.sln编译,编译过程中没有遇到错误。

libvorbis

对应ffmpeg configure选项–enable-libvorbis。
下载libvorbis-1.3.4,MSVC2013打开libvorbis-1.3.4\win32\VS2010\ vorbis_static.sln就可以编译。
ffmpeg的configure里面将:

enabled libvorbis         && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis –logg

改成:

enabled libvorbis  && require  libvorbis vorbis/vorbisenc.h vorbis_info_init libvorbis_static.lib libogg_static.lib

libmp3lame

对应ffmpeg configure选项–enable-libmp3lame。
lame是mp3的编码库,下载lame-3.99.5.tar.gz,用VC2008编译,VC2010编译报错。lame-3.99.5/vc_solution下面有VC工程,直接打开后编译。
增加mp3支持,ffmpeg的configure里面,将:

enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame

改成:

enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality libmp3lame-static.lib libmpghip-static.lib

下面的错误:

lame-3.99.5\frontend\gpkplotting.h(25): fatal error C1083: Cannot open include file: 'gtk/gtk.h': No such file or directory

MSVC2013下,app mp3x工程编译通不过,需要gtk的头文件。不用解决,其他几个可以编译通过就已经生成了库文件。

ffmpeg在configure的时候报下面的错误:

fatal error C1083: Cannot open include file: 'lame/lame.h': No such file or directory

Configure里面验证的lame头文件是lame/lame.h,但lame-3.99.5\include没有lame目录,lame目录是lame-3.99.5 make install后生成的,所以直接在lame-3.99.5\include下面建立lame,并把lame.h拷贝到lame目录下。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值