ffmpeg在windows上的编译

由于需要用到lib链接库和dll,所以编译一波

我用的是windows上的ubuntu WSL

电脑上要装好visual studio或mingw(我用的是vs)和yasm

cd /mnt/… #进入ffmpeg的存储路径

输入:

./configure –toolchain=msvc –arch=x86_64 –enable-shared –enable-w32threads –prefix=output –enable-optimizations

如果报错:

cl.exe is unable to create an executable file.
If cl.exe is a cross-compiler, use the –enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

就改为 : ./configure –toolchain=msvc –arch=x86_64 –enable-shared –enable-w32threads –prefix=output –enable-optimizations –enable-yasm –cc=cl.exe –ld=link.exe (还不行的话加上 –enable-cross-compile)

然后执行:

make install

结束后在ffmpeg目录可以找到ffmpeg.exe,在目录内的output文件夹找到相应dll

踩的坑:

1.报错:

Could not create temporary library.
make: *** [ffbuild/library.mak:118: libavutil/avutil-57.dll] Error 1

解决:清除之前编译的缓存

make clean

make distclean

然后再重新编译一遍

2.找不到cl.exe link.exe 之类的报错:

type cl.exe #找cl.exe的路径

sudo ln -s ‘刚才找到的绝对路径’ /usr/bin/cl #建立链接

chmod 777 doc/print_options.exe

ln -s doc/print_options.exe doc/print_option

3.编译过程中报错

/bin/sh: 1: doc/print_options: not found
make: *** [doc/Makefile:59: doc/avoptions_format.texi] Error 127

进入ffmpeg/doc 把 print_options.exe 的后缀名去掉再 make install



2022年 March 14日|21:16  作者:
目录: 计算机, 音视频 标签:,, , ,
欢迎留下你的评论~~
订阅
通知
guest
0 Comments
内嵌回复
查看所有评论