windows 使用qt mingw730_64 编译ffmpeg

2022-4-10 C++

下载ffmpeg源码:https://www.ffmpeg.org/download.html

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg

1. 安装MSYS2

    到https://www.msys2.org/下载最新的MSYS2安装包,一路next

2. 安装完成后启动MSYS2 MinGW x64

3. 安装make yasm diffutils pkg-config工具

pacman -S make yasm diffutils pkg-config

如因网络问题安装不上则修改c:\msys64\etc\pacman.d\mirrorlist.mingw64把tsinghua的源移到第一行

如Server=https://mirrors.tuna.stsinghua.edu.cn/msys2/mingw/x86_64

之后输入pacman -Sy重新加载下

4. 添加qtmingw730bin进PATH

如export PATH=/d/Qt/Qt5.14.2/Tools/mingw730_64/bin:$PATH

5. 配置ffmpeg如

./configure --enable-shared --arch=x86_64 --prefix=/d/ffmpeg/install

6. 之后就是make;make install等待编译完成

标签: ffmpeg qt mingw

评论(0) 浏览(12192)

Windows平台webRTC编译

2022-4-7

1. Visual Studio安装

选择最新的vs2022,用的是社区版,安装时选择自定义安装

a)勾选使用C++的桌面开发

b)  Windows 10 SDK安装10.0.20348.0 取消10.0.1904.0

c)勾选MFC及ATL这两项

d) 安装完VS2022后,必须安装sdk调试工具。打开控制面板->程序与功能,找到Windows Software Development Kit, 点更改

勾选Debugging Tools For Windows

2. 安装depot_tools

从https://storage.googleapis.com/chrome-infra/depot_tools.zip下载depot_tools安装后,解压到电脑任一位置,并把depot_tools目录的路径加到系统环境变量Path里

3. 获取WebRtc源码

a) 需要代理

b)打开cmd窗口,输入gclient安装必须工具

c)设置环境临时变量如

set vs2022_install=C:\Program Files\Microsoft Visual Studio\2022\Community
set GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community
set GYP_GENERATORS=msvs-ninja,ninja
set WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_MSVS_VERSION=2022
d) 创建webrtc源码存放目录,并获取webrtc(编译完大概占用23g的电脑空间)

mkdir d:\webrtc

cd d:\webrtc

fetch --nohooks webrtc

gclient sync

3.编译工程

编译生成release版本

cd d:\webrtc\src

gn gen out/Default --ide=vs2022 --sln=webrtc --args="use_lld=false is_debug=false"

4.参考

https://webrtc.github.io/webrtc-org/native-code/development/

5. 编译遇到的问题:

a)环境变量含中文导致写环境变量失败

UnicodeEncodeError: 'gbk' codec can't encode character '\u04e2' in position 3840: illegal multibyte sequence

修改src\build\toolchain\win\setup_toolchain.py

    f.write(env_block.encode('utf-8').decode('GBK'))

b) lld-link: error: procedure symbol record for `operator new` 

   添加参数use_lld=false 



标签: webrtc vs2022

评论(0) 浏览(1061)

Powered by EMLOG Copyright @ 深圳市炽旗科技 版权所有. 闽ICP备14012694号-2