CoSMoSoftware / OBS-studio-webrtc

This is a fork of OBS-studio with generic support for webrtc. It leverages the same webrtc implementation most browsers use.
http://www.cosmosoftware.io
GNU General Public License v2.0
587 stars 131 forks source link

wrong packaging of dependencies on MacOS #34

Closed agouaillard-cosmo closed 5 years ago

agouaillard-cosmo commented 6 years ago

The macOS binary has some incorrect links to libraries in the compiled version and will crash before startup. For example, it expects the end-user to have QT5 and ffmpeg installed locally:

Dyld Error Message: Library not loaded: /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets Referenced from: /Volumes/VOLUME/*/OBS.app/Contents/Resources/bin/obs Reason: image not found You get this error message if QT5 is already installed:

Dyld Error Message: Library not loaded: /usr/local/opt/ffmpeg/lib/libavcodec.58.dylib Referenced from: /Volumes/VOLUME/*/OBS.app/Contents/Resources/bin/obs Reason: image not found (full error log for ffmpeg)

agouaillard-cosmo commented 6 years ago

Romain, make sure to add the Qt libs and whatever other lib to the package, so it s installed correctly. Be carefull, on macOS, it s not directly relocatable, and there is a little trick to package and distribute qt dll with cmake. see the other private projects using Qt and you should find the corresponding cmake scripts.

skastr0 commented 6 years ago

Hi, this has become a blocking issue for us at Evercast. I've tested with a package and even though it opens with Qt and ffmpeg installed locally, when starting a stream it still seems to be missing some .dylibs, causing it to fail.

otool -L gives me the following results, which I believe can shed some light on the missing libs:

Latest OBS studio
/Applications/OBS.app/Contents/Resources/bin/obs:
    @rpath/QtWidgets (compatibility version 5.10.0, current version 5.10.1)
    @rpath/libobs-frontend-api.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/libavcodec.57.dylib (compatibility version 57.0.0, current version 57.64.101)
    @rpath/libavutil.55.dylib (compatibility version 55.0.0, current version 55.34.100)
    @rpath/libavformat.57.dylib (compatibility version 57.0.0, current version 57.56.100)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1504.82.104)
    @loader_path/../../Frameworks/Sparkle.framework/Versions/A/Sparkle (compatibility version 1.6.0, current version 1.16.0)
    @rpath/QtMacExtras (compatibility version 5.10.0, current version 5.10.1)
    @rpath/libobs.0.dylib (compatibility version 0.0.0, current version 0.0.0)
    @rpath/QtGui (compatibility version 5.10.0, current version 5.10.1)
    @rpath/QtCore (compatibility version 5.10.0, current version 5.10.1)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1349.64.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1349.63.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
OBS webrtc
OBS.app/Contents/Resources/bin/obs:
    /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.11.0, current version 5.11.1)
    @rpath/libobs-frontend-api.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/ffmpeg/lib/libavcodec.58.dylib (compatibility version 58.0.0, current version 58.18.100)
    /usr/local/opt/ffmpeg/lib/libavutil.56.dylib (compatibility version 56.0.0, current version 56.14.100)
    /usr/local/opt/ffmpeg/lib/libavformat.58.dylib (compatibility version 58.0.0, current version 58.12.100)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1561.40.112)
    /usr/local/opt/qt/lib/QtMacExtras.framework/Versions/5/QtMacExtras (compatibility version 5.11.0, current version 5.11.1)
    @rpath/libobs.0.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.11.0, current version 5.11.1)
    /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.11.0, current version 5.11.1)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1452.23.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1452.23.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

I am available for helping / testing in this issue. I'll continue trying to find more information too.

agouaillard-cosmo commented 6 years ago

Hi skastr0,

We do not distribute macOS pre-compiled packaged ops-studio-webrtc for now. We do not know when we will resume providing them. All the code is open source, we recommend and encourage you to compile it by yourself. Please refer to the README and the references within for the compilation process.

chadfurman commented 6 years ago

Not expecting a pre-compiled package. Looking for tips on how to package it ourselves. Given that your readme states:

Packaging
cd build
cpack

which produces a .dmg that cannot be installed / run effectively, I advised @skastr0 to reach out here for further suggestions. Looks like we have to fix the cpack build process? I guess by README you mean the cpack readme?

agouaillard-cosmo commented 6 years ago

You are correct, we made a mistake.

The packaging is part of the original OBS-Studio code, and was not made by us. It is thus covered in the original OBS-Studio code at https://github.com/obsproject/obs-studio and more specifically i believe their installation instructions: "Build Instructions: https://github.com/obsproject/obs-studio/wiki/Install-Instructions"

We have rectified the error and removed this information from our README.

Thanks again for your feedback.

chadfurman commented 6 years ago

ah, great thanks...

ruddell commented 6 years ago

The build/install instructions provided by OBS don't work for me, but I was able to get it packaged correctly by using OBS's Mac CI scripts with a few modifications (skip packaging CEF, fixed some paths that had a reference to a cosmo home directory). Changes and explanation are available in the mac-build branch here

agouaillard-cosmo commented 6 years ago

@ruddell I see you re printing out whenever you find a path with CoSMo in. Would you mind to aopen a new ticket and gand be us the list, we will clean that. Also, it looks like you assume you have libwebrtc already installed on your system, right?

ruddell commented 6 years ago

Correct, this assumes you have libwebrtc already installed. I opened a new ticket with the path issues #40.

agouaillard-cosmo commented 6 years ago

thanks.