Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 717002 - media-video/obs-studio-25.0.3: Add use flag for browser source
Summary: media-video/obs-studio-25.0.3: Add use flag for browser source
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 4 votes (vote)
Assignee: Chiitoo
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 529604
Blocks:
  Show dependency tree
 
Reported: 2020-04-10 23:33 UTC by Skruppy
Modified: 2021-06-07 02:06 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Skruppy 2020-04-10 23:33:18 UTC
Since version 25, OBS ships with an Browser Source plug-in [1] (normally used for donation alerts and chat widgets). To enable it, cmake needs to options set and depends on the Chromium Embedded Framework [2]. It would be nice to have this in the ebuild.

[1] https://github.com/bazukas/obs-linuxbrowser
[2] https://github.com/obsproject/obs-studio/wiki/Install-Instructions#linux-portable-mode-all-distros


Reproducible: Always
Comment 1 Chiitoo gentoo-dev 2020-04-11 17:59:18 UTC
Yep, been meaning to get to this, just haven't yet.

Thanks!
Comment 2 kkartaltepe 2020-04-25 18:58:32 UTC
The browser source has been removed due to instability, consider waiting until the next release before adding it to packaging.
Comment 3 François Périchon 2020-07-11 07:39:15 UTC
It's seems the problem is related too a conflict between CEF and the browser when using gtk+ (glib) [1].

I am not sure it affects the gentoo build which rely on Qt.

On another thread [2], the browser plugin seems to work fine with Qt.

[1] https://github.com/obsproject/obs-browser/issues/219
[2] https://github.com/obsproject/obs-studio/issues/2644#issuecomment-623168704
Comment 4 Adrian Bassett 2020-07-12 13:58:10 UTC
(In reply to François Périchon from comment #3)
> It's seems the problem is related too a conflict between CEF and the browser
> when using gtk+ (glib) [1].
> 
> I am not sure it affects the gentoo build which rely on Qt.
> 
> On another thread [2], the browser plugin seems to work fine with Qt.
> 
> [1] https://github.com/obsproject/obs-browser/issues/219
> [2]
> https://github.com/obsproject/obs-studio/issues/2644#issuecomment-623168704

So, has anyone tried any of this and got anywhere?

My experience, having altered the ebuild to include -DBUILD_BROWSER=ON, and with QT_QPA_PLATFORMTHEME="qt5ct" exported to the environment before the 'ebuild ... configure' stage (x11-misc/qt5ct is installed), is that:

1/ The downloaded obs-studio tarball does not contain the obs-browser source code so the obs-browser plugin directory is empty.

2/ Installing the obs-browser plugin source code to the correct location doesn't help.  The subsequent 'ebuild ... configure' diagnostic is '-- CEF Not found -- obs-browser plugin disabled.', so it would seem a) that the plugin is now being taken into account and b) that CEF is not being ignored in favour of QT.

Interestingly, I've done a recursive grep on the OBS and browser plugin code-bases and git logs and couldn't find any reference to QT_QPA_PLATFORMTHEME, which is a bit surprising although I haven't currently explored further.

Perhaps I've missed something obvious - I don't pretend to know anything about CMake (or QT) - but it is a problem not having the browser plugin available in Linux OBS.

Thanks
Comment 5 François Périchon 2020-07-13 07:18:09 UTC
(In reply to Adrian Bassett from comment #4)
> 
> So, has anyone tried any of this and got anywhere?
> 
> My experience, having altered the ebuild to include -DBUILD_BROWSER=ON, and
> with QT_QPA_PLATFORMTHEME="qt5ct" exported to the environment before the
> 'ebuild ... configure' stage (x11-misc/qt5ct is installed), is that:
> 
> 1/ The downloaded obs-studio tarball does not contain the obs-browser source
> code so the obs-browser plugin directory is empty.
> 
> 2/ Installing the obs-browser plugin source code to the correct location
> doesn't help.  The subsequent 'ebuild ... configure' diagnostic is '-- CEF
> Not found -- obs-browser plugin disabled.', so it would seem a) that the
> plugin is now being taken into account and b) that CEF is not being ignored
> in favour of QT.
> 
> Interestingly, I've done a recursive grep on the OBS and browser plugin
> code-bases and git logs and couldn't find any reference to
> QT_QPA_PLATFORMTHEME, which is a bit surprising although I haven't currently
> explored further.
> 
> Perhaps I've missed something obvious - I don't pretend to know anything
> about CMake (or QT) - but it is a problem not having the browser plugin
> available in Linux OBS.
> 
> Thanks

You'll need the CEF even if you use QT.
There's a link to the 3770 branch used to build their binary release [1]

You should clone the git repository and the clone the obs-browser in the plugin directory if you want to build it.

[1] https://obsproject.com/wiki/install-instructions#linux-portable-mode-all-distros
Comment 6 Adrian Bassett 2020-07-13 10:32:29 UTC
> You'll need the CEF even if you use QT.
> There's a link to the 3770 branch used to build their binary release [1]
> 
> You should clone the git repository and the clone the obs-browser in the
> plugin directory if you want to build it.
> 
> [1]
> https://obsproject.com/wiki/install-instructions#linux-portable-mode-all-
> distros

Thanks for this.  It did occur to me finally - once I had realised that QT_QPA_PLATFORMTHEME="qt5ct" is a _runtime_ requirement (rather than a build-time fix) to avoid obs crashing - that the plugin requires cef).

So, with the help of your comments, I now have a working obs-studio with browser source enabled:

Adding to my previous procedures.

1/ I downloaded and unpacked the cef binary from the supplied link and referenced the location in a modified ebuild:

@@ -99,6 +99,8 @@
 		-DOBS_MULTIARCH_SUFFIX=${libdir#lib}
 		-DUNIX_STRUCTURE=1
 		-DWITH_RTMPS=$(usex ssl)
+		-DBUILD_BROWSER=ON
+		-DCEF_ROOT_DIR="/usr/local/src/www-misc/cef/cef_binary_3770_linux64"
 	)
2/ ebuild ... unpack, configure (with the obs-browser plugin code copied in before this stage), compile, install, package

3/ emerge -K <package>

4/ obs-studio now has a browser source capability (which definitely crashes if QT_QPA_PLATFORMTHEME="qt5ct" is not set in the runtime environment)

(If you don't have GPU hardware acceleration you will also need LIBGL_ALWAYS_SOFTWARE=1)


Thanks for the help.
Comment 7 ngg 2020-11-06 17:33:53 UTC
I've created a PR https://github.com/gentoo/gentoo/pull/18156 which adds browser source support, it works for me for both the 25.0.8 and 9999 versions.
Comment 8 l33tlinuxh4x0r 2021-06-07 02:06:32 UTC
(In reply to ngg from comment #7)
> I've created a PR https://github.com/gentoo/gentoo/pull/18156 which adds
> browser source support, it works for me for both the 25.0.8 and 9999
> versions.

I can confirm that this fix works.