# Trying to build OBS on Windows. Cmake gets "Could NOT find FFmpeg (missing: FFMPEG_AVCODEC_LIBRARIES..."



## John Hartman (Jul 17, 2021)

I am following the instructions at https://obsproject.com/wiki/Install-Instructions#windows to build OBS. Running CMake Configure gives:

CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find FFmpeg (missing: FFMPEG_AVCODEC_LIBRARIES
FFMPEG_AVCODEC_INCLUDE_DIRS avcodec avdevice avutil avformat)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindFFmpeg.cmake:151 (find_package_handle_standard_args)
  deps/media-playback/CMakeLists.txt:3 (find_package)

I am using the "Pre-built Windows dependencies for VS2019". Looking in the directory tree I see libraries for x264, curl, and mbedTLS but not FFmpeg. There are some include files that begin with FFMPEGxxx

Did I uck something fup, or is FFmpeg missing from the instructions or the pre-build?

I looked at https://ffmpeg.org/download.html, but I hate to embark on yet another adventure in building. The pre-built sites offer a number of options, and I don't know which might be appropriate


----------



## Jim (Jul 17, 2021)

FFmpeg libraries don't begin with "FFmpeg". They're avutil, avformat, avcodec, swscale, etc. My guess is that you did not quite follow the instructions exactly; likely you just misunderstood some step, it happens sometimes. If this is your first time building a project like this or using cmake, you need to be careful to follow the instructions. If you don't understand any part of the instructions, let us know where you got stuck and we'll try to explain it so there isn't any confusion.

Basically, you need to unzip the deps zip, somewhere/anywhere (preferably somewhere other than the source directory). Then you need to add a cmake variable when generating your cmake files: that variable is "DepsPath". If you unzipped your deps to C:\deps, it should have C:\deps\win32 and C:\deps\win64. ou're building 64bit. Set the cmake variable DepsPath to C:\deps\win64. Then regenerate and you should be good. If you somehow or another mess up these steps, you can always clear your cmake cache by deleting it and then trying again (the cache directory is where you set "Where to build the binaries", which should always be different than "Where is the source code").


----------



## John Hartman (Jul 18, 2021)

Thanks for the help. I had managed to mangle the definition of DepsPath when pasting the path. (and I put a copy in my notes, so I re-pasted the bad path when I tried again...)

Configuration now completes, but I still get the warning. Is this a problem?

CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (Python)
does not match the name of the calling package (PythonDeps). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
cmake/Modules/FindPythonDeps.cmake:61 (find_package_handle_standard_args)
deps/obs-scripting/CMakeLists.txt:47 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

In any case, I can do Debug builds of 48 or 52 projects (mostly due to lack of pdb files on dependencies), and Release builds of 50 of 52 projects (only PACKAGE and INSTALL fail), and both Debug and Release obs64.exe run, though I can't yet start them in the Visual Studio debugger.  But a lot further than I was yesterday. Thanks!


----------

