windows編譯 obs-studio


github下載源碼 https://github.com/jp9000/obs-studio

還需要一個開發包 http://code.fosshub.com/OBS/download/dependencies.zip

環境:windows 7 64位系統

工具:cmake 2.8.12,vs2013最新版,qt5.3.2(msvc2013_opengl版本)

編譯說明:https://github.com/jp9000/obs-studio/wiki/Install-Instructions#windows

 

開始編譯-----------------------------------------------------------------

· cmake-gui中,填寫源碼路徑,生成路徑

· 點擊configure,編譯器選擇vs 12(相當於vs2013),其它選項默認

·  如果出現此框(本文以下稱error框),請注意cmake中的輸出窗口錯誤,會有相應的錯誤信息

  目前為止,還沒有配置過相關路徑,出現error框是正常的

· 配置各種參數:

  解壓dependencies.zip,到當前目錄。

  cmake-gui中點擊Add Entry按鈕。name項填寫 DepsPath,type選項為PATH,value項為dependencies文件夾的全路徑

  

  添加如上路徑

  另外,有個zlib庫,需要額外添加一下(github上沒有提到)。

  

  重新configure,

  沒有意外的話,輸出框提示“Configuring done”,代表configure成功

· 點擊Generate按鈕,生成工程。出現"generate done",代表生成完畢。

· 生成路徑中,出現一個obs-studio.sln。vs2013打開並編譯該sln,搞定。

 

 

 

 

  • Clone the repository and submodules:

     git clone --recursive https://github.com/jp9000/obs-studio.git
    
  • NOTE: OBS on windows currently requires VS2013 with the latest update, as obs-studio uses both C99 and C++11. Express might not be supported at this time (though if not, then it'll be fixed it at some point). You can always just get VS2013 Community Edition for free. In case you want to try with VS2015, this hint might be useful regarding a linking error (LNK2001 : unresolved external symbol _sprintf) in the text-freetype2 project.

  • Download (or build) development packages of FFmpeg, x264, Qt5, cURL. Pre-built windows dependencies (excluding Qt) for VS2013 can be found here:http://code.fosshub.com/OBS/downloads

  • Download windows version of cmake from: http://www.cmake.org/

  • The following variables must be used to specify dependencies, these variables can either be specified via a windows environment variable, or through a cmake variable (optionally suffixed with '32' or '64' to specify architecture):

    • DepsPath (path to the include for all dependencies, not including Qt)
    • FFmpegPath (path to just FFmpeg include directory)
    • x264Path (path to just x264 include directory)
    • curlPath (path to just cURL include directory)
  • NOTE: Search paths and search order for base dependency library/binary files, relative to their include directories:

    Library files

    • ../lib
    • ../lib32 (if 32bit)
    • ../lib64 (if 64bit)
    • ./lib
    • ./lib32 (if 32bit)
    • ./lib64 (if 64bit)

    Binary files:

    • ../bin
    • ../bin32 (if 32bit)
    • ../bin64 (if 64bit)
    • ./bin
    • ./bin32 (if 32bit)
    • ./bin64 (if 64bit)
  • If you're building the GUI, the following cmake or windows environment variable must be used separately from the other dependencies to specify Qt5's location. Like the other environment variables, append 32 or 64 if you wish to build both architectures:

    QTDIR (path to Qt build base directory)

  • NOTE: The GUI builds by default. If you don't want to build the GUI, add a cmake boolean variable DISABLE_UI, set to true.

  • NOTE: An example Qt directory you would use here if you installed Qt5 to D:\Qt would usually look something like this:

    (32bit) D:\Qt\5.3\msvc2013
    (64bit) D:\Qt\5.3\msvc2013_64

  • Run cmake-gui. 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).

  • NOTE: You should create one or more of the following subdirectories within the repository for building: release, debug, and build (suffixed with or without 32/64 to specify architecture). They are excluded from the repo in .gitignore for the sake of building, so they are safe to create an use within the repository base directory.

  • Press 'Configure', then enable the COPY_DEPENDENCIES option, then press 'Configure' again, and then press 'Generate' to generate visual studio project files in the 'build' subdirectory.

  • Open obs-studio.sln from the 'build' subdirectory, and it should run and be good to go. All required dependencies should be copied on compile and it should be a fully fuctional build environment. The output is built in the 'rundir/[build type]' directory of your 'build' subdirectory.


免責聲明!

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



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