由于版权原因,Qt官方无法在二进制包中提供一些解码器,导致QtWebengine无法支持一些常用的视频格式(例如:mp4),用户可以重编QtWebengine以解决这个问题。
环境:
ubuntu 20.04
qt 6.4.0
依赖:
bios,flex,gperf , python3 + html5lib, perl,nodejs
vmware 16 正常安装ubuntu20.04
vmware tools
改变ubuntu系统源为阿里云 mirrors.aliyun.com
sudo apt install openssh-openserver
在线安装 qt 6.4.0
wget https://download.qt.io/archive/online_installers/4.4/qt-unified-linux-x64-4.4.2-online.run
sudo apt install libxcb-xinerama0
sudo qt-unified-linux-x64-4.4.2-online.run
sudo apt install gcc g++ make
sudo apt-get install libgl1-mesa-dev
sudo ln -sf /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld编译环境
sudo apt install git -y
cd /Qt/6.4.0/gcc/Src
sudo apt install gperf bison flex -y
sudo apt install python2 python2-dev -y
sudo apt install libnss3-dev -y
sudo apt install libdbus-1-dev -y
sudo apt install libfontconfig1-dev -y
sudo apt install libxkbfile-dev -y
sudo apt install ffmpeg -y
sudo apt-get install libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev libpci-dev libpulse-dev libudev-dev libxtst-dev libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxss-dev libwebp-dev libjsoncpp-dev libopus-dev libminizip-dev libavutil-dev libavformat-dev libavcodec-dev libevent-dev -y
sudo apt install nodejs -y
ln -s /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 /usr/lib/x86_64-linux-gnu/libX11-xcb.so
sudo apt-cache search x11-dev
./configure -webengine-proprietary-codecs
ninja qtbase/all
ninja qtwebengine/all
10 cmake --install qtwebengine --prefix=/opt/webengine