Xaymar/obs-StreamFX

MacOSX version no longer builds after AMF handlers were added #400

markallenmobi posted onGitHub

Description

The new AMF handler stops the MacOSX version from building with a linker error.

make[1]: *** [UI/frontend-plugins/streamfx/CMakeFiles/StreamFX.dir/all] Error 2
make: *** [all] Error 2
  + ERROR during build step: cmake

The build error can be fixed by removing AMF from the build process.

This is done by removing the following two lines from source/encoders/encoder-ffmpeg.cpp

register_handler("h264_amf", ::std::make_shared<handler::amf_h264_handler>());
register_handler("hevc_amf", ::std::make_shared<handler::amf_hevc_handler>());

And then removing these build steps from the CMakeList.txt file

"source/encoders/handlers/amf_shared.hpp"
"source/encoders/handlers/amf_shared.cpp"
"source/encoders/handlers/amf_h264_handler.hpp"
"source/encoders/handlers/amf_h264_handler.cpp"
"source/encoders/handlers/amf_hevc_handler.hpp"
"source/encoders/handlers/amf_hevc_handler.cpp"

Hope that's enough information - it's my first ever issue raise in GitHub, let alone this project!


Do you mind showing the full compiler output? This is unfortunately not enough to fix the issue.

posted by Xaymar over 4 years ago

I'd love to. I am building with

CI/full-build-macos.sh

Will that be enough to go on? Or is there a way to get a more verbose output (sorry - not a CMake user)

posted by markallenmobi over 4 years ago

Most likely that will be enough. Unfortunately I do not officially support MacOS, and don't own any of the Apple machines either.

posted by Xaymar over 4 years ago

Okay, have found an error in the log:

/Users/mark/Development/OBS/obs-studio/UI/frontend-plugins/streamfx/source/encoders/handlers/amf_shared.cpp:120:23: error: use of undeclared identifier 'lib_name'
                util::library::load(lib_name);

Looking at the code, lib_name is defined for D_PLATFORM_WINDOWS and D_PLATFORM_LINUX. But not for the OSX platform. If you still want the whole build log I do have it saved and can provide. However this looks like the culpret.

Today is the first time I have looks at the OBS or the StreamFX source (and the CMake build tool) so I am still getting my head around this, otherwise I would have hoped to be more prgressed with a solution to help. I completely understand you don't have the mac hardware to hand. So if I can help, shoot over suggestions and I can take a look. I have already set the CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 and to c++17 (coded into OBS's full-build-macos.sh script)

posted by markallenmobi over 4 years ago

I can confirm that changing:

#elif defined(D_PLATFORM_LINUX )

to

#elif defined(D_PLATFORM_LINUX ) || defined(D_PLATFORM_MAC)

On line 112 of source/encoders/handlers/amf_shared.cpp will allow the Mac version to build.

I cannot (as I dont know how) confirm that AMF functions on a Mac.

posted by markallenmobi over 4 years ago

Ah, that would certainly explain it. Technically the FFmpeg encoder integration shouldn't be built for Mac anyway, as AMD and NVIDIA both don't provide any loadable libraries for it - afaik there's some system API that is used instead. I should adjust this so that FFmpeg Encoders are forcefully disabled on Mac.

posted by Xaymar over 4 years ago

afaik there's some system API that is used instead. I should adjust this so that FFmpeg Encoders are forcefully disabled on Mac.

If you're referring to hardware encoders, that would be the Apple Video Toolbox, or AppleVT; It determines which forms of hardware encoding are available and compatible, based on your drivers and macOS version, and uses what it deems best, accordingly.

posted by MisutaaUrufu over 4 years ago

You can disable FFmpeg encoders for now with -DDISABLE_ENCODER_FFMPE=TRUE on the cmake command line. This is actually how the other platforms are intended to build as by default everything is on and you need to turn off features that aren't supported or working.

posted by Xaymar about 4 years ago

I tried disabling the encoders using cmake with -DDISABLE_ENCODER_FFMPE=TRUE, but I was given this warning:

CMake Warning:
  Manually-specified variables were not used by the project:

    DISABLE_ENCODER_FFMPE

I then tried -DISABLE_ENCODER_FFMPEG=TRUE (added "G") in case the first was a typo, but received the same "not used" warning.

posted by mattbisme about 4 years ago

It's StreamFX_DISABLE_ENCODER_FFMPEG when building with OBS Studio, DISABLE_ENCODER_FFMPEG in standalone. Sorry, I was on mobile at the time.

posted by Xaymar about 4 years ago

@markallenmobi I built everything and the filters show up but none actually work. Do you have any of them working on osx on your end?

posted by e-desouza about 4 years ago

Will be fixed by #413.

posted by Xaymar about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests