Windows 下 ffmpeg 的安装和测试
ffmpeg 安装
安装 vcpkg
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
安装 ffmpeg
vcpkg install ffmpeg
安装之后可以查看下:
PS D:\3rd\vcpkg-master> ./vcpkg list
ffmpeg:x64-windows 4.3.2#2 a library to decode, encode, transcode, mux, dem...
ffmpeg:x86-windows 4.3.2#2 a library to decode, encode, transcode, mux, dem...
ffmpeg[avcodec]:x64-windows Build the avcodec library
ffmpeg[avcodec]:x86-windows Build the avcodec library
ffmpeg[avdevice]:x64-windows Build the avdevice library
ffmpeg[avdevice]:x86-windows Build the avdevice library
ffmpeg[avfilter]:x64-windows Build the avfilter library
ffmpeg[avfilter]:x86-windows Build the avfilter library
ffmpeg[avformat]:x64-windows Build the avformat library
ffmpeg[avformat]:x86-windows Build the avformat library
ffmpeg[avresample]:x64-windows Build the avresample library
ffmpeg[avresample]:x86-windows Build the avresample library
ffmpeg[gpl]:x64-windows Allow use of GPL code, the resulting libs and bi...
ffmpeg[gpl]:x86-windows Allow use of GPL code, the resulting libs and bi...
ffmpeg[postproc]:x64-windows Build the postproc library
ffmpeg[postproc]:x86-windows Build the postproc library
ffmpeg[swresample]:x64-windows Build the swresample library
ffmpeg[swresample]:x86-windows Build the swresample library
ffmpeg[swscale]:x64-windows Build the swscale library
ffmpeg[swscale]:x86-windows Build the swscale library
安装 ffmpeg 可执行文件
测试:
PS D:\ffmpeg\bin> .\ffmpeg.exe --version
ffmpeg version N-101994-g84ac1440b2 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --enable-libvmaf --enable-vulkan --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
libavutil 56. 73.100 / 56. 73.100
libavcodec 58.136.101 / 58.136.101
libavformat 58. 78.100 / 58. 78.100
libavdevice 58. 14.100 / 58. 14.100
libavfilter 7.111.100 / 7.111.100
libswscale 5. 10.100 / 5. 10.100
libswresample 3. 10.100 / 3. 10.100
libpostproc 55. 10.100 / 55. 10.100
ffmpeg visual studio 工程测试
打开属性管理器
这里以Debug Win32 为例进行配置:
avcodec.lib
avdevice.lib
avfilter.lib
avformat.lib
avresample.lib
avutil.lib
postproc.lib
swresample.lib
swscale.lib
写个程序测试下:
#include "stdafx.h"
#include <iostream>
using namespace std;
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libavdevice/avdevice.h"
}
int main()
{
av_register_all();
unsigned int version = avcodec_version();
cout << "FFmpeg version is:" << version << endl;
return 0;
}
编译报错:
'av_register_all': 被声明为已否决
修改属性:
编译输出:
FFmpeg version is:3824484
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
2020-04-20 VSCode 的其它便利小插件
2020-04-20 VSCode Git 相关的工具和插件
2020-04-20 VSCode 配置云同步