编译WINDOWS版FFmpeg:编译FFmpeg

  其实简单。吾之所以费了这么大的事情,关键就在于,试图在WIN7虚拟机上编译,于是有各种莫名其妙的错误。

参考:https://www.jianshu.com/p/5f175dec9109

  • 下载FFmpegInterop

https://github.com/microsoft/FFmpegInterop

  • 下载ffmpeg

下载、解压、改名ffmpeg,放在FFmpegInterop下。

  • MSYS2环境准备

https://quantum6.blog.csdn.net/article/details/105431904

  • 编译x264

https://quantum6.blog.csdn.net/article/details/105484929

  • 编译SDL2

https://blog.csdn.net/quantum7/article/details/105487140

  • configure

修改FFmpegConfig.sh

--enable-gpl \
--enable-nonfree \
--enable-libx264 \
--enable-sdl \
--extra-cflags="-I${BUILD_LIBS}/include" \
--extra-ldflags="-LIBPATH:${BUILD_LIBS}/lib"

执行:

./FFmpegConfig.sh Win10 x64

说是把新生成的config.h文件打开后转换为UTF-8格式。这样可以避免非常多的警告。

  • make
./BuildFFmpeg.bat win10 x64
  • 检查32位还是64位:
查看32位还是64位:
dumpbin /headers libx264.dll

查看符号清单(导出函数)
dumpbin /exports libx264.dll > libx264-exports.txt
发布了2662 篇原创文章 · 获赞 354 · 访问量 211万+

猜你喜欢

转载自blog.csdn.net/quantum7/article/details/105485006