简体   繁体   English

是否可以在Windows上构建ffmpeg x64?

[英]Is it possible to build ffmpeg x64 on Windows?

The real answer is probably "no", but still, just to double check. 真正的答案可能是“不”,但仍然只是要仔细检查。 Has anyone ever been able to build ffmpeg x64 on Windows (VS2013 or VS2015)? 有没有人能够在Windows(VS2013或VS2015)上构建ffmpeg x64? I know it is not possible with publicly available sources without heavy modifications. 我知道没有经过大量修改就无法使用公开资源。 However, if somebody did it and if he is willing to share a few tips... 但是,如果有人这样做,并且他愿意分享一些技巧......

Edit: It is interesting how most of the required x64 tools for running the "configure" are distributed without dependencies and it is impossible to get them anywhere. 编辑:有趣的是,运行“配置”所需的大多数x64工具是如何在没有依赖关系的情况下分发的,并且无法将它们放在任何地方。 Looks like a professional trolling. 看起来像一个专业的拖钓。

Edit2: There are thousands of errors like this: Edit2:有成千上万的错误:

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

features.h is missing as many other header files. features.h缺少许多其他头文件。 Is there a fix for that, or switching to Linux is the only option? 有没有解决方法,或切换到Linux是唯一的选择?

Assuming with x64 you mean the standard 64-bit version, yes it is possible. 假设x64是指标准的64位版本,是的,它是可能的。 See the fate page for all tested builds of FFmpeg, there's various 32- and 64-bit versions of Visual Studio in that list, including VS2013 and VS2015 64-bit. 有关FFmpeg的所有测试版本的命运页面,该列表中有各种32位和64位版本的Visual Studio,包括VS2013和VS2015 64位。 Search for "Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x64" (or "19.00.24215.1") or "VS2013"/"VS2015", all the way at the bottom. 搜索“Microsoft(R)C / C ++优化编译器版本18.00.40629 for x64”(或“19.00.24215.1”)或“VS2013”​​/“VS2015”,一直在底部。 For exact build options, see here for 2013 or here for 2015 . 有关精确构建选项,请参阅2013年2015 此处。 The important part is to open a Windows shell with the 64-bit commandline build tools in your $PATH and open a msys shell from there, and then run configure using the --arch=x86_64 --target-os=win64 --toolchain=msvc options. 重要的是在$PATH打开一个带有64位命令行构建工具的Windows shell,然后从那里打开一个msys shell,然后使用--arch=x86_64 --target-os=win64 --toolchain=msvc运行configure --arch=x86_64 --target-os=win64 --toolchain=msvc选项。 For more detail, see the MSVC compilation wiki page. 有关更多详细信息,请参阅MSVC编译Wiki页面。

I used to compile ffmpeg on a linux machine with MinGW, but now I'm able to compile on a windows machine, in my case Windows 10. 我曾经用MinGW在linux机器上编译ffmpeg,但现在我可以在Windows机器上编译,在我的情况下是Windows 10。

NOTE: For me it only worked for ffmpeg versions >= 3.0 and I tested using VS 2013 and 2015 注意:对我来说它只适用于ffmpeg版本> = 3.0并且我使用VS 2013和2015测试

Few steps but very important: 几个步骤,但非常重要:

Download and install (except YASM): 下载并安装(YASM除外):

Steps: 脚步:

  1. Install MSYS2 to a fixed folder (eg.: C:\\Dev\\msys64) 将MSYS2安装到固定文件夹(例如:C:\\ Dev \\ msys64)
  2. Run msys2.exe 运行msys2.exe
  3. Execute command "pacman -S make gcc diffutils" and press "Y" to install 执行命令“pacman -S make gcc diffutils”并按“Y”进行安装
  4. Close msys2 关闭msys2
  5. Rename C:\\Dev\\msys64\\usr\\bin\\link.exe to some other name (eg.: msys2_link.exe) 将C:\\ Dev \\ msys64 \\ usr \\ bin \\ link.exe重命名为其他名称(例如:msys2_link.exe)
  6. Copy and rename "yasm--win64.exe" to "C:\\Dev\\yasm.exe" 复制并将“yasm - win64.exe”重命名为“C:\\ Dev \\ yasm.exe”
  7. Add "C:\\Dev" to environment variables PATH 将“C:\\ Dev”添加到环境变量PATH
  8. Run VS2013/2015 x86 (for x86) or x64 for (x64) Command Prompt 运行VS2013 / 2015 x86(适用于x86)或x64(x64)命令提示符
  9. Execute "C:\\Dev\\msys64\\msys2_shell.cmd -msys -use-full-path" 执行“C:\\ Dev \\ msys64 \\ msys2_shell.cmd -msys -use-full-path”
  10. On the msys2 window execute "which cl" and you should see the path of your VS 在msys2窗口中执行“which cl”,您应该看到VS的路径
  11. Execute "which link" and you should also see the path of your VS 执行“哪个链接”,您还应该看到VS的路径
  12. Go to the ffmpeg source path (eg.: "cd /c/ffmpeg3.3") 转到ffmpeg源路径(例如:“cd /c/ffmpeg3.3”)
  13. Run ./configure and make 运行./configure并make

I use this configuration: 我用这个配置:

./configure \
    --toolchain=msvc \
    --arch=x86_64 \
    --enable-yasm \
    --enable-asm\
    --enable-shared \
    --enable-w32threads \
    --disable-programs \
    --disable-ffserver \
    --disable-doc \
    --disable-static \
    --prefix=/c/ffmpeg3.3/DLLS

NOTE2: If you used the last line --prefix=/c/ffmpeg3.3/DLLS , as a final step, run make install and the binaries will be copied to that path 注意2:如果你使用最后一行--prefix = / c / ffmpeg3.3 / DLLS ,作为最后一步,运行make install,二进制文件将被复制到该路径

Hope it helped. 希望它有所帮助。

Best of luck 祝你好运

There is a How-to on the FFmpeg Page itself.It didn't work for me so far, but at least you should get rid of the C99 Errors and so on. FFmpeg页面本身有一个操作方法。到目前为止它对我不起作用,但至少你应该摆脱C99错误等等。

https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC

Maybe you try installing this stuff (I had to download pkg-config seperatly with Msys2 for it to work) and follow these steps. 也许你尝试安装这些东西(我必须单独下载pkg-config和Msys2才能工作)并按照这些步骤操作。

No, it cannot be done. 不,它无法完成。 MS compiler doesn't support #include_next. MS编译器不支持#include_next。 Plus, many other problems... You need MinGW. 另外,还有很多其他问题......你需要MinGW。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM