obs-studio


How we accidentally fixed the black screen issue of OBS studio on Fedora 27 x64 3

As mentioned in a previous post, we installed OBS studio on our machine in order to make some desktop recordings.
What that post did not mention are two issues that we had:

  1. when recording using the Screen Capture (XSHM) source, the recording would only show a black screen and it would actually record the mouse only!
  2. when trying to record a LibreOffice application like Calc through the Window Capture (XComposite) source, Calc would not show in the properties dialog under the Window dropdown menu

The way we fixed these issues is not something that is always guaranteed to work but it is worth a try!
Initially we thought it would be a good idea to install the NVidia driver since we had a GeForce GTX 660M on the machine.
We hoped that the OBS studio black screen issue was a driver issue so we decided to follow the RPM Fusion guide on installing NVidia drivers.

We installed the NVidia driver, added the CUDA support and updated the system using these two commands:


dnf install xorg-x11-drv-nvidia akmod-nvidia xorg-x11-drv-nvidia-cuda;
dnf update -y;

and then we did a full reboot of the machine.

After the machine booted and the graphical interface came up, we noticed that the machine was too slow and there was 100% CPU utilization for over 15 minutes.
After some very efficient Google-Fu, we realised that this was some bug that we were not willing to deal with and so we had to remove the newly installed NVidia driver.
Again following the RPM Fusion guide, we executed the following command to remove the driver from our system:


dnf remove xorg-x11-drv-nvidia\*

Please note that we DID NOT execute the last step of the guide on how to Recover from NVIDIA installer.
As it is mentioned in the guide: the NVidia binary driver installer overwrites some configuration and libraries.
Since having a clean state did not work for us, we decided to give a go of this hybrid setup that we had.
Following another full restart we were able to see that OBS Studio was working as expected and it the black screen issue was no more!!
Also, we could choose LibreOffice from the Window dropdown and we could record that as well!

As implied, this guide is a hack, it could work for you as well or not.
Our opinion is that, it is worth to give it a go!
As a synopsis, what we did was to install the NVidia driver and uninstall it, the libraries that got overwritten by this process fixed the black screen issue of OBS studio.

Bonus: to find the model of your graphics card, execute the following


lspci |grep -E "VGA|3D";

In our machine we got the following output: 01:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GTX 660M] (rev a1)


Fedora 27: Install OBS Studio

In order to record a few desktop sessions on our Fedora GNU/Linux machine, we decided to use the OBS Studio as it appeared to be a very powerful tool.
Unfortunately, this software does not ship with the official repositories so we had to install it from the  rpmfusion.org repository using the following commands.

#Enable access to both the free and the nonfree repository
#free repository: for Open Source Software (as defined by the Fedora Licensing Guidelines) which the Fedora project cannot ship due to other reasons
#nonfree repository: for redistributable software that is not Open Source Software (as defined by the Fedora Licensing Guidelines); this includes software with publicly available source-code that has "no commercial use"-like restrictions 
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm;

#Perform the installation
sudo dnf install obs-studio;

Background:

RPM Fusion provides software that the Fedora Project or Red Hat don’t want to ship. That software is provided as precompiled RPMs.

Codecs in Fedora

By default Fedora does not ship with several codecs whose license is not free.
So we had to install a few packages manually and be able to playback or process sever multimedia formats.

Specifically we installed the following plugins and libraries for GStreamer (needed for the Totem Movie Player):

  1. gstreamer1-libav: This package provides libav-based GStreamer plug-ins.
    Libav is a free software project, forked from FFmpeg in 2011, that produces libraries and programs for handling multimedia data.
  2. gstreamer1-plugins-good: GStreamer Good Plugins is a collection of well-supported plugins of good quality and under the LGPL license.
  3. gstreamer-ffmpeg: This package provides FFmpeg-based GStreamer plug-ins.

GStreamer is a streaming media framework, based on graphs of filters which operate on media data. Applications using this library can do anything from real-time sound processing to playing videos, and just about anything else media-related. Its plugin-based architecture means that new data types or processing capabilities can be added simply by installing new plugins.

The command to install these packages was:


sudo dnf install gstreamer1-plugins-good gstreamer-ffmpeg gstreamer1-libav;

Additional h264 – h.264 Codec – Optional

Following, we decided to install the OpenH264 codec implementation and its extensions for Firefox and gstreamer.

Cisco provides an OpenH264 codec (as a source and a binary), which is their of implementation H.264 codec, and they cover all licensing fees for all parties using their binary. This codec allows you to use H.264 in WebRTC with gstreamer and Firefox. It does not enable generic H.264 playback, only WebRTC.

The code source is available at https://github.com/cisco/openh264 under a BSD license. The binary is released under this agreement from Cisco: http://www.openh264.org/BINARY_LICENSE.txt

Upstream Firefox versions download and install the OpenH264 plugin by default automatically. Due to it’s binary nature, Fedora disables this automatic download.

From: https://fedoraproject.org/wiki/OpenH264

To install the codec we performed the three following steps:


sudo dnf config-manager --set-enabled fedora-cisco-openh264;

sudo dnf upgrade;

sudo dnf install gstreamer1-plugin-openh264 mozilla-openh264;

# Afterwards you need open Firefox, go to menu -> Add-ons -> Plugins and enable OpenH264 plugin.

Bonus: Black Screen Issue

If you are having issues with the OBS Studio black screen bug, have a look at this post, it may be able to help you.