为 Ubuntu 18.04 LTS 构建 OBS 且没有依赖项或 ffmpeg 错误的步骤是什么?
我最初遵循的是 Ubuntu 官方文档:https://obsproject.com/wiki/install-instructions#linux如下:
$sudo apt-get install ffmpeg $sudo add-apt-repository ppa:obsproject/obs-studio $sudo apt-get update $sudo apt-get install obs-studio
这会导致软件包版本出现问题:
The following packages have unmet dependencies: obs-studio : Depends: libavcodec57 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed or libavcodec-extra57 (>= 7:3.4.4) but it is not going to be installed Depends: libavdevice57 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed Depends: libavformat57 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed Depends: libavutil55 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed Depends: libswresample2 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed Depends: libswscale4 (>= 7:3.4.4) but 7:3.4.2-2 is to be installed E: Unable to correct problems, you have held broken packages.
从源代码构建,使用 Git 克隆:
git clone --recursive https://github.com/obsproject/obs-studio.git
...仍然出现错误:
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find FFmpeg (missing: FFMPEG_AVCODEC_LIBRARIES FFMPEG_AVCODEC_INCLUDE_DIRS avcodec avdevice avutil avformat)
答案1
在运行 cmake 和 make 之前添加以下库:
$sudo apt install libavcodec-dev libavformat-dev libavdevice-dev
(参考:如何从 Launchpad 下载并安装 ffmpeg?)
接下来你需要:
$sudo apt-get install libmbedtls-dev
并且也需要 Qt5Svg:
$sudo apt-get install libqt5svg5-dev