obs mac平台编译

编译

Install-Instructions#macos

$ git clone --recursive https://github.com/obsproject/obs-studio.git
$ brew install qt5
$ brew tap homebrew-ffmpeg/ffmpeg
$ brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-srt
$ mkdir build
$ cd build && cmake .. && make -j8

编译好之后可以在obs-studio/build/rundir/RelWithDebInfo/bin目录下找到obs这个可执行程序

编译错误

FFMPEG编译错误

  • 错误信息:
CMake Error at /usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find FFmpeg (missing: FFMPEG_AVCODEC_INCLUDE_DIRS avcodec
  avdevice avutil avformat)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.15.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/Modules/FindFFmpeg.cmake:151 (find_package_handle_standard_args)
  deps/media-playback/CMakeLists.txt:3 (find_package)
  • 解决办法:
    通过阅读cmake知道这个错误是因为找不到FFmpeg的头文件路径导致的,解决办法就是增加ffmpeg的头文件路径/usr/local/opt/ffmpeg就好了。
diff --git a/cmake/Modules/FindFFmpeg.cmake b/cmake/Modules/FindFFmpeg.cmake
index 4cc7445b..7e6b52d8 100644
--- a/cmake/Modules/FindFFmpeg.cmake
+++ b/cmake/Modules/FindFFmpeg.cmake
@@ -50,7 +50,7 @@ function(find_ffmpeg_library component header)
                        ${DepsPath}
                        ${PC_FFMPEG_${component}_INCLUDE_DIRS}
                PATHS
-                       /usr/include /usr/local/include /opt/local/include /sw/include
+                       /usr/include /usr/local/include /usr/local/opt/ffmpeg /opt/local/include /sw/include
                PATH_SUFFIXES ffmpeg libav include)

        find_library(FFMPEG_${component}_LIBRARY

syphon错误

  • 错误信息
CMake Error at plugins/mac-syphon/CMakeLists.txt:58 (add_library):
  No SOURCES given to target: syphon-framework
  • 解决办法
    这个是因为一开始的时候没有下载子目录导致的。
$ git submodule init
$ git submodule update
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章