【學習筆記】obs-studio 編譯


1.下載源碼

因為現在最新的obs-studio 只支持VS2019了,我沒安裝VS2019,安裝的是VS2015,查看wiki記錄

https://github.com/obsproject/obs-studio/wiki/Install-Instructions/0ddc3265c810eec18238dcc996856558c6f88bb7

為最后一版說明,支持VS2015的

通過時間比對,對應的是obs-studio 24.0

2.編譯環境軟件需求

obs-studio在WIndows平台編譯使用的是CMake,具體的內容在Wiki中也有說明:
Requirements for building OBS on windows
Development packages of FFmpeg, x264, and cURL.

3.編譯

  • Run cmake-gui, and set the following fields:
    • In "where is the source code", enter in the repo directory (example: D:/obs).
    • In "where to build the binaries", enter the repo directory path with the 'build' subdirectory (example: D:/obs/build).
    • 就是配置下圖的路徑
  • Set the following variables in cmake-gui (alternatively, you can set them as Windows Environment Variables):
    • DepsPath (Path to the include for all dependencies, not including Qt.).
      • An example path if you extracted the dependancies .zip to c:\obs-deps would be:
        • c:\obs-deps\win32\include
        • c:\obs-deps\win64\include
    • If you wish to specify both 32 and 64 bit dependencies (for multi-arch building), you can use DepsPath32 and DepsPath64 to their respective include folders.
    • 配置下cmke中的變量DepsPath,根據自己的路徑調整,如D:/obs-studio-24.0.0/dependencies2015/win32/include,要編譯32位的就選win32,編譯64的就選win64,想2種都編譯就增加DepsPath32和DepsPath64
  • QTDIR (Path to Qt build base directory. GUI is built by default. Set the cmake boolean variable DISABLE_UI to TRUE if you don't want the GUI and this is no longer required. Can be optionally suffixed with 32 or 64 to specify target arch).
    • NOTE: Make sure to download Qt 5.X.X prebuilt components for your version of MSVC (64 or 32 bit).
    • Example Qt directories you would use here if you installed Qt5 to D:\Qt would usually look something like this:
      • (32bit) QTDIR=D:\Qt\5.8\msvc2017
      • (64bit) QTDIR64=D:\Qt\5.8\msvc2017_64
    • 配置下cmke中的變量QTDIR,我用的是Qt5.9.8
  • 點 Cmake 程序 界面的Configure,選擇 Visual Studio 14 2015
  • 點 Generate,生成VS工程

4.生成結果


成功36個,失敗2個

切換到錯誤列表

  • KSAUDIO_SPEAKER_2POINT1這個宏,定義在其他文件中,復制過來到嚴重性win-wasapi.cpp 文件中即可#define KSAUDIO_SPEAKER_2POINT1 (KSAUDIO_SPEAKER_STEREO|SPEAKER_LOW_FREQUENCY)
  • obs-studio-24.0.0\UI\window-basic-preview.cpp(930): error C2719: “transform”: 要求 16 對齊的形參將不被對齊 ,將
    static bool IntersectBox(matrix4 transform, float x1, float x2, float y1,
    float y2)
    函數修改為
    static bool IntersectBox(matrix4& transform, float x1, float x2, float y1,
    float y2)

重新編譯

5.接下來研究下這個是什么,怎么實現的

6.

大致看了下,是D3D實現的或者openGL,這2個我都沒接觸過,還要先學習這個,這個效果應該叫多窗口疊加。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM