当前位置: 首页>移动开发>正文

Ubuntu 20.04 环境下编译 qtwebengine 6.4.0 以支撑MP4解码

由于版权原因,Qt官方无法在二进制包中提供一些解码器,导致QtWebengine无法支持一些常用的视频格式(例如:mp4),用户可以重编QtWebengine以解决这个问题。

环境:
ubuntu 20.04
qt 6.4.0
依赖:
bios,flex,gperf , python3 + html5lib, perl,nodejs

  1. vmware 16 正常安装ubuntu20.04

  2. vmware tools

  3. 改变ubuntu系统源为阿里云 mirrors.aliyun.com

  4. sudo apt install openssh-openserver

  5. 在线安装 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

  6. 编译环境
    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

  1. ./configure -webengine-proprietary-codecs

  2. ninja qtbase/all

  3. ninja qtwebengine/all

10 cmake --install qtwebengine --prefix=/opt/webengine


https://www.xamrdz.com/mobile/4zp1994036.html

相关文章: