Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBS Configure Fails Due to FFmpeg extra-version #11827

Closed
w0nd3r365 opened this issue Feb 4, 2025 · 6 comments · Fixed by #11554
Closed

OBS Configure Fails Due to FFmpeg extra-version #11827

w0nd3r365 opened this issue Feb 4, 2025 · 6 comments · Fixed by #11554

Comments

@w0nd3r365
Copy link

Operating System Info

Other

Other OS

Kali GNU/Linux Rolling 2024.4

OBS Studio Version

Other

OBS Studio Version (Other)

OBS 31.0.0-89-g265239d41 (from master branch)

OBS Studio Log URL

None required.

OBS Studio Crash Log URL

No response

Expected Behavior

FFmpeg extra-version should not affect the detection of ffmpeg development libraries by cmake. Thus OBS build configuration should succeed when ffmpeg has extra-version configured. By extra-version I mean the user-defined string appended to MAJOR.MINOR version after a dash. For instance in 7.1-MyBuild, -MyBuild is the extra-version. This is added to ffmpeg during configure stage using --extra-version=<string> parameter.

Current Behavior

My systemwide FFmpeg from repos is version 7.1-3+b2. My custom FFmpeg instance at /opt/ffmpeg_ev is version 7.1-wonder+04.02.2025. When FFmpeg build has extra-version configured, like my custom instance, cmake configuration of OBS build fails to detect FFmpeg libraries with the error below. Trying to configure OBS with the FFmpeg instance from my distro repo fails with a similar error. I've tried to configure various versions in the git tree, and I think this only affects OBS 31+.

CMake Error at /usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find FFmpeg: (Required is at least version "6.1") (found
  /opt/ffmpeg_ev/lib/libavformat.so;/opt/ffmpeg_ev/lib/libavutil.so;/opt/ffmpeg_ev/lib/libswscale.so;/opt/ffmpeg_ev/lib/libswresample.so;/opt/ffmpeg_ev/lib/libavcodec.so,
  found components: avformat avutil swscale swresample avcodec)

      Reason given by package: Ensure that required FFmpeg libraries are installed on the system.

Call Stack (most recent call first):
  /usr/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:601 (_FPHSA_FAILURE_MESSAGE)
  cmake/finders/FindFFmpeg.cmake:313 (find_package_handle_standard_args)
  libobs/CMakeLists.txt:12 (find_package)

Steps to Reproduce

Attempt to configure OBS build using cmake preset kali

cmake --preset kali

Anything else we should know?

I built FFmpeg 7.1 twice and installed them. One instance of FFmpeg 7.1 was configured without --extra-version parameter and installed at /opt/ffmpeg. The other instance of FFmpeg 7.1 was configured with --extra-version parameter and installed at /opt/ffmpeg_ev. I proceeded to modify repo packages by building ffmpeg from source -- enabled deb-src, apt build-dep, dpkg-buildpackage, etc. The ONLY change I made to the ffmpeg source was at ffmpeg-7.1/debian/rules where I just deleted one line --extra-version="$(DEB_REVISION)" \ from the ffmpeg configuration options. After installing the modified packages, cmake configure for OBS build succeeds. cmake configure also succeeds when I use FFmpeg instance without extra-version at /opt/ffmpeg

My cmake configure preset when using custom FFmpeg is:

{
  "name": "kali",
  "displayName": "Wonder's OBS build (Release)",
  "description": "Configure OBS Studio for my Kali Linux",
  "inherits": [
    "environmentVars"
  ],
  "condition": {
    "type": "equals",
    "lhs": "${hostSystemName}",
    "rhs": "Linux"
  },
  "binaryDir": "${sourceDir}/build",
  "generator": "Ninja",
  "warnings": {
    "dev": false,
    "deprecated": true
  },
  "cacheVariables": {
    "CMAKE_BUILD_TYPE": "Release",
    "ENABLE_AJA": false,
    "ENABLE_VLC": true,
    "ENABLE_WAYLAND": false,
    "ENABLE_BROWSER": false,
    "ENABLE_FFMPEG_LOGGING": false,
    "ENABLE_WEBRTC": true,
    "ENABLE_LIBFDK": true,
    "ENABLE_SNDIO": true,
    "ENABLE_JACK": true,
    "ENABLE_VST": true,
    "ENABLE_RTMPS": true,
    "CMAKE_PREFIX_PATH": "/opt/ffmpeg",
    "CMAKE_INSTALL_PREFIX": "/usr"
  }
}

My cmake build preset is:

{
  "name": "kali",
  "displayName": "Wonder's OBS build (Release)",
  "description": "Build OBS Studio for my Kali Linux",
  "configurePreset": "kali",
  "configuration": "Release",
  "targets": [
    "package"
  ]
}

FFmpeg extra-version makes cmake err in detecting ffmpeg libraries. Perhaps you need to refine how ffmpeg version is parsed?

@w0nd3r365
Copy link
Author

@Fenrirthviti In this bug, OBS builds successfully with ffmpeg 7.1 in my case. The issue is that cmake configure fails and the workaround is to rebuild ffmpeg without extra-version. This is actually a regression because IIRC about a month ago I could build OBS 31+ using my system ffmpeg 7.1 and there were no configure issues. But now I can only configure upto version 30.2.3 successfully if extra-version is present.

Thus, I think it's incorrect to mark this as a duplicate of #11491.

@w0nd3r365
Copy link
Author

So, I think a patch to fix how cmake resolves ffmpeg version during configure stage may be needed to fix this issue if I'm not wrong. I'm just grasping at straws here as to the needed fix.

@Fenrirthviti
Copy link
Member

Ah, yes, you're right this is slightly different. I can reopen.

@Fenrirthviti Fenrirthviti reopened this Feb 5, 2025
@RytoEX
Copy link
Member

RytoEX commented Feb 5, 2025

Please provide the line in your custom ffversion.h that starts with #define FFMPEG_VERSION.

@w0nd3r365
Copy link
Author

When I omit the --extra-version parameter, it's #define FFMPEG_VERSION "7.1"
When I add --extra-version=wonder+$(date +'%d.%m.%Y') it's #define FFMPEG_VERSION "7.1-wonder+05.02.2025"
My system ffmpeg version has the line as #define FFMPEG_VERSION "7.1-3+b2"

@RytoEX
Copy link
Member

RytoEX commented Feb 5, 2025

When I omit the --extra-version parameter, it's #define FFMPEG_VERSION "7.1" When I add --extra-version=wonder+$(date +'%d.%m.%Y') it's #define FFMPEG_VERSION "7.1-wonder+05.02.2025" My system ffmpeg version has the line as #define FFMPEG_VERSION "7.1-3+b2"

Will be fixed by #11554.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants