背景
客户端程序,需要运行在国产化机器上,程序里有web模块,并且需要播放webrtc的视频
使用的qt6开发,默认的浏览器插件qtwebengine是不支持webrtc,需要自己手动编译源码
编译版本
QT 6.7.1
成果
运行环境
银河麒麟V10 aarch64
参考文档
Qt WebEngine Platform Notes | Qt WebEngine 6.7.1
Ubuntu 20.04 环境下编译 qtwebengine 6.4.0 以支撑MP4解码 - 简书 (jianshu.com)
总结需要安装库:
apt install bison build-essential clang flex gperf
apt install libxcb-cursor-dev libfreetype-dev
apt install libatspi2.0-dev libbluetooth-dev libclang-dev libcups2-dev libdrm-dev
apt install libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev
apt install libgstreamer1.0-dev libhunspell-dev libnss3-dev libopengl-dev
apt install libpulse-dev libssl-dev libts-dev libx11-dev libx11-xcb-dev
apt install libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev
apt install libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev
apt install libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev
apt install libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb1-dev
apt install libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev
apt install libxfixes-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
apt install libxkbfile-dev libxrandr-dev libxrender-dev libxshmfence-dev
apt install libxshmfence1 llvm ninja-build
apt install python-is-python3 python3
apt install libdbus-1-dev
apt install ffmpeg
apt install libasound2-dev libbz2-dev libcap-dev libpci-dev libudev-dev libxtst-dev libxss-dev
apt install libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev libavutil-dev
apt install libavformat-dev libavcodec-dev libevent-dev
需要pip安装html5lib
apt install python3-pip/apt install pip
pip install html5lib
apt install python3-html5lib
注意:
严格参考官方文档的支持环境可行性!!!
1、不支持静态编译
2、Linux 6.7版本以后才支持arm64,并且需要在Debian系统下。
3、GCC10+,CMake20+,nodejs20+ ,这些看系统升级的版本,达不到需要源码编译安装
注意nodejs源码编译安装会很耗时,10个小时以上
debain升级后的GCC 10.2.1可以用,不用升级
4、只要不报错,继续执行就可以。顺利的话大概需要8个小时以上
5、WARNING: System GBM is disabled. The bundled minigbm supports Intel only, you might need to install libgbm to avoid rendering issues.
需要安装 apt-install libgbm-dev
6、WARNING: SensorFW support currently not enabled with cmake
暂时没管
备注
编译完后目录如下:
把整个目录覆盖到QT目录下即可
编译好的资源下载:
linuxarm64Qt6/PySide6WebEngine支持webrtc-h264资源-优快云文库
补充支持的属性: (红色为关键项)
Building for: linux-g++ (arm64, CPU features: cx16 neon)
Compiler: gcc 12.1.0
Build options:
Mode ................................... release
Optimize release build for size ........ no
Fully optimize release builds (-O3) .... no
Building shared libraries .............. yes
Using ccache ........................... no
Unity Build ............................ no
Using new DTAGS ........................ yes
Relocatable ............................ yes
Using precompiled headers .............. yes
Using Link Time Optimization (LTCG) .... no
Using Intel CET ........................ no
Target compiler supports:
ARM Extensions ....................... NEON
Sanitizers:
Addresses ............................ no
Threads .............................. no