編譯
$ 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