rpmfusion


Qubes 4.0 with Fedora 26: Setup RPM Fusion and ffmpeg

Recently we wanted to process some media on a Fedora 26 running under a Qubes OS 4.0 installation, we decided to use ffmpeg which is not part of the default repositories but it can be found in the RPM Fusion repositories. To do so, first we updated our system and enabled the RPM Fusion repositories as follows:


sudo dnf update;

sudo dnf upgrade -y;

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;

sudo dnf config-manager --set-enabled rpmfusion-free rpmfusion-nonfree;

By default DNF on the template VM did not enable the rpmfusion repositories so we had to enable them manually with the last command above or else we would get the following error:

$ sudo dnf install ffmpeg;
Last metadata expiration check: 0:17:49 ago on Tue Oct 16 09:09:22 2018.
No match for argument: ffmpeg

Then, we updated the system once more so that the information from the new repositories would get downloaded to our system and then we performed the installation of ffmpeg. While installing ffmpeg, since it was the first time that we were using the new repositories we were asked to verify the keys that were imported. We were able to manually verify the keys from this page.

The commands used to install ffmpeg are the following:


sudo dnf update;

sudo dnf install ffmpeg;


		

Fedora 28: Setup RPM Fusion and ffmpeg 1

Recently we wanted to process some media on a Fedora 28, we decided to use ffmpeg which is not part of the default repositories but it can be found in the RPM Fusion repositories. To do so, first we updated our system and enabled the RPM Fusion repositories as follows:


sudo dnf update;

sudo dnf upgrade -y;

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;

Then, we updated the system once more so that the information from the new repositories would get downloaded to our system and then we performed the installation of ffmpeg. While installing ffmpeg, since it was the first time that we were using the new repositories we were asked to verify the keys that were imported. We were able to manually verify the keys from this page.

The commands used to install ffmpeg are the following:


sudo dnf update;

sudo dnf install ffmpeg;

Full Installation Log

[xeirwn@localhost ~]$ sudo dnf update
[sudo] password for xeirwn: 
Last metadata expiration check: 1:05:54 ago on Fri 28 Sep 2018 08:48:36 AM EEST.
Dependencies resolved.
Nothing to do.
Complete!
[xeirwn@localhost ~]$ sudo dnf upgrade -y
Last metadata expiration check: 1:06:13 ago on Fri 28 Sep 2018 08:48:36 AM EEST.
Dependencies resolved.
Nothing to do.
Complete!
[xeirwn@localhost ~]$ 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
Last metadata expiration check: 1:06:49 ago on Fri 28 Sep 2018 08:48:36 AM EEST.
rpmfusion-free-release-28.noarch.rpm                                      31 kB/s |  20 kB     00:00    
rpmfusion-nonfree-release-28.noarch.rpm                                   41 kB/s |  21 kB     00:00    
Dependencies resolved.
=========================================================================================================
 Package                              Arch              Version            Repository               Size
=========================================================================================================
Installing:
 rpmfusion-free-release               noarch            28-1               @commandline             20 k
 rpmfusion-nonfree-release            noarch            28-1               @commandline             21 k

Transaction Summary
=========================================================================================================
Install  2 Packages

Total size: 41 k
Installed size: 18 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                 1/1 
  Installing       : rpmfusion-nonfree-release-28-1.noarch                                           1/2 
  Installing       : rpmfusion-free-release-28-1.noarch                                              2/2 
  Verifying        : rpmfusion-free-release-28-1.noarch                                              1/2 
  Verifying        : rpmfusion-nonfree-release-28-1.noarch                                           2/2 

Installed:
  rpmfusion-free-release.noarch 28-1                rpmfusion-nonfree-release.noarch 28-1               

Complete!
[xeirwn@localhost ~]$ sudo dnf update
RPM Fusion for Fedora 28 - Free - Updates                                152 kB/s | 481 kB     00:03    
RPM Fusion for Fedora 28 - Free                                          195 kB/s | 754 kB     00:03    
RPM Fusion for Fedora 28 - Nonfree - Updates                              59 kB/s |  85 kB     00:01    
RPM Fusion for Fedora 28 - Nonfree                                        72 kB/s | 208 kB     00:02    
Last metadata expiration check: 0:00:00 ago on Fri 28 Sep 2018 09:56:01 AM EEST.
Dependencies resolved.
Nothing to do.
Complete!
[xeirwn@localhost ~]$ sudo dnf install ffmpeg
Last metadata expiration check: 0:01:01 ago on Fri 28 Sep 2018 09:56:01 AM EEST.
Dependencies resolved.
=========================================================================================================
 Package               Arch       Version                               Repository                  Size
=========================================================================================================
Installing:
 ffmpeg                x86_64     4.0.2-6.fc28                          rpmfusion-free-updates     1.3 M
Installing dependencies:
 clang5.0-libs         x86_64     5.0.1-3.fc28                          fedora                      12 M
 ffmpeg-libs           x86_64     4.0.2-6.fc28                          rpmfusion-free-updates     6.7 M
 hwloc-libs            x86_64     1.11.9-1.fc28                         fedora                     1.6 M
 libaom                x86_64     1.0.0-3.fc28                          updates                    1.2 M
 libass                x86_64     0.13.4-6.fc28                         updates                    104 k
 libavdevice           x86_64     4.0.2-6.fc28                          rpmfusion-free-updates      94 k
 libclc                x86_64     0.2.0-9.git1cb3fbf.fc27               fedora                     7.9 M
 libmfx                x86_64     1.23-3.fc28                           fedora                      35 k
 llvm5.0-libs          x86_64     5.0.1-7.fc28                          fedora                      15 M
 ocl-icd               x86_64     2.2.12-1.fc28                         fedora                      50 k
 opencl-filesystem     noarch     1.0-6.fc27                            fedora                     7.1 k
 opencore-amr          x86_64     0.1.5-3.fc28                          rpmfusion-free             180 k
 vid.stab              x86_64     1.1-4.20170830gitafc8ea9.fc28         fedora                      50 k
 vo-amrwbenc           x86_64     0.1.3-4.fc28                          rpmfusion-free              77 k
 x264-libs             x86_64     0.152-5.20171224gite9a5903.fc28       rpmfusion-free             575 k
 x265-libs             x86_64     2.7-3.fc28                            rpmfusion-free             1.7 M
 xvidcore              x86_64     1.3.5-1.fc28                          rpmfusion-free             268 k
 zvbi                  x86_64     0.2.35-5.fc28                         fedora                     423 k
Installing weak dependencies:
 beignet               x86_64     1.3.2-2.fc28                          fedora                     4.8 M
 mesa-libOpenCL        x86_64     18.0.5-4.fc28                         updates                    350 k
 pocl                  x86_64     1.1-4.fc28                            updates                     13 M

Transaction Summary
=========================================================================================================
Install  22 Packages

Total download size: 67 M
Installed size: 253 M
Is this ok [y/N]: y
Downloading Packages:
(1/22): libaom-1.0.0-3.fc28.x86_64.rpm                                   250 kB/s | 1.2 MB     00:05    
(2/22): libmfx-1.23-3.fc28.x86_64.rpm                                     63 kB/s |  35 kB     00:00    
(3/22): ocl-icd-2.2.12-1.fc28.x86_64.rpm                                 180 kB/s |  50 kB     00:00    
(4/22): vid.stab-1.1-4.20170830gitafc8ea9.fc28.x86_64.rpm                 58 kB/s |  50 kB     00:00    
(5/22): zvbi-0.2.35-5.fc28.x86_64.rpm                                    192 kB/s | 423 kB     00:02    
(6/22): ffmpeg-4.0.2-6.fc28.x86_64.rpm                                   140 kB/s | 1.3 MB     00:09    
(7/22): vo-amrwbenc-0.1.3-4.fc28.x86_64.rpm                               26 kB/s |  77 kB     00:02    
(8/22): opencore-amr-0.1.5-3.fc28.x86_64.rpm                              15 kB/s | 180 kB     00:12    
(9/22): x264-libs-0.152-5.20171224gite9a5903.fc28.x86_64.rpm              65 kB/s | 575 kB     00:08    
(10/22): xvidcore-1.3.5-1.fc28.x86_64.rpm                                 65 kB/s | 268 kB     00:04    
(11/22): libavdevice-4.0.2-6.fc28.x86_64.rpm                              53 kB/s |  94 kB     00:01    
(12/22): libass-0.13.4-6.fc28.x86_64.rpm                                 141 kB/s | 104 kB     00:00    
(13/22): beignet-1.3.2-2.fc28.x86_64.rpm                                 460 kB/s | 4.8 MB     00:10    
(14/22): x265-libs-2.7-3.fc28.x86_64.rpm                                  87 kB/s | 1.7 MB     00:20    
(15/22): clang5.0-libs-5.0.1-3.fc28.x86_64.rpm                           506 kB/s |  12 MB     00:23    
(16/22): opencl-filesystem-1.0-6.fc27.noarch.rpm                          54 kB/s | 7.1 kB     00:00    
(17/22): ffmpeg-libs-4.0.2-6.fc28.x86_64.rpm                             107 kB/s | 6.7 MB     01:04    
(18/22): hwloc-libs-1.11.9-1.fc28.x86_64.rpm                             343 kB/s | 1.6 MB     00:04    
(19/22): mesa-libOpenCL-18.0.5-4.fc28.x86_64.rpm                         225 kB/s | 350 kB     00:01    
(20/22): llvm5.0-libs-5.0.1-7.fc28.x86_64.rpm                            412 kB/s |  15 MB     00:36    
(21/22): libclc-0.2.0-9.git1cb3fbf.fc27.x86_64.rpm                       544 kB/s | 7.9 MB     00:14    
(22/22): pocl-1.1-4.fc28.x86_64.rpm                                      390 kB/s |  13 MB     00:34    
---------------------------------------------------------------------------------------------------------
Total                                                                    685 kB/s |  67 MB     01:39     
warning: /var/cache/dnf/rpmfusion-free-updates-18aab6236926d6fd/packages/ffmpeg-4.0.2-6.fc28.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 09eab3f2: NOKEY
Importing GPG key 0x09EAB3F2:
 Userid     : "RPM Fusion free repository for Fedora (28) <[email protected]>"
 Fingerprint: 3424 9D2C B375 8B55 48E2 874F C08D 3269 09EA B3F2
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-28
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                 1/1 
  Installing       : opencl-filesystem-1.0-6.fc27.noarch                                            1/22 
  Installing       : llvm5.0-libs-5.0.1-7.fc28.x86_64                                               2/22 
  Running scriptlet: llvm5.0-libs-5.0.1-7.fc28.x86_64                                               2/22 
  Installing       : clang5.0-libs-5.0.1-3.fc28.x86_64                                              3/22 
  Installing       : beignet-1.3.2-2.fc28.x86_64                                                    4/22 
  Installing       : libclc-0.2.0-9.git1cb3fbf.fc27.x86_64                                          5/22 
  Installing       : hwloc-libs-1.11.9-1.fc28.x86_64                                                6/22 
  Installing       : pocl-1.1-4.fc28.x86_64                                                         7/22 
  Installing       : mesa-libOpenCL-18.0.5-4.fc28.x86_64                                            8/22 
  Running scriptlet: mesa-libOpenCL-18.0.5-4.fc28.x86_64                                            8/22 
  Installing       : ocl-icd-2.2.12-1.fc28.x86_64                                                   9/22 
  Running scriptlet: ocl-icd-2.2.12-1.fc28.x86_64                                                   9/22 
  Installing       : libass-0.13.4-6.fc28.x86_64                                                   10/22 
  Installing       : xvidcore-1.3.5-1.fc28.x86_64                                                  11/22 
  Installing       : x265-libs-2.7-3.fc28.x86_64                                                   12/22 
  Installing       : x264-libs-0.152-5.20171224gite9a5903.fc28.x86_64                              13/22 
  Running scriptlet: x264-libs-0.152-5.20171224gite9a5903.fc28.x86_64                              13/22 
  Installing       : vo-amrwbenc-0.1.3-4.fc28.x86_64                                               14/22 
  Running scriptlet: vo-amrwbenc-0.1.3-4.fc28.x86_64                                               14/22 
  Installing       : opencore-amr-0.1.5-3.fc28.x86_64                                              15/22 
  Running scriptlet: opencore-amr-0.1.5-3.fc28.x86_64                                              15/22 
  Installing       : zvbi-0.2.35-5.fc28.x86_64                                                     16/22 
  Running scriptlet: zvbi-0.2.35-5.fc28.x86_64                                                     16/22 
  Installing       : vid.stab-1.1-4.20170830gitafc8ea9.fc28.x86_64                                 17/22 
  Running scriptlet: vid.stab-1.1-4.20170830gitafc8ea9.fc28.x86_64                                 17/22 
  Installing       : libmfx-1.23-3.fc28.x86_64                                                     18/22 
  Running scriptlet: libmfx-1.23-3.fc28.x86_64                                                     18/22 
  Installing       : libaom-1.0.0-3.fc28.x86_64                                                    19/22 
  Installing       : ffmpeg-libs-4.0.2-6.fc28.x86_64                                               20/22 
  Running scriptlet: ffmpeg-libs-4.0.2-6.fc28.x86_64                                               20/22 
  Installing       : libavdevice-4.0.2-6.fc28.x86_64                                               21/22 
  Running scriptlet: libavdevice-4.0.2-6.fc28.x86_64                                               21/22 
  Installing       : ffmpeg-4.0.2-6.fc28.x86_64                                                    22/22 
  Running scriptlet: ffmpeg-4.0.2-6.fc28.x86_64                                                    22/22 
  Verifying        : ffmpeg-4.0.2-6.fc28.x86_64                                                     1/22 
  Verifying        : ffmpeg-libs-4.0.2-6.fc28.x86_64                                                2/22 
  Verifying        : libaom-1.0.0-3.fc28.x86_64                                                     3/22 
  Verifying        : libmfx-1.23-3.fc28.x86_64                                                      4/22 
  Verifying        : ocl-icd-2.2.12-1.fc28.x86_64                                                   5/22 
  Verifying        : vid.stab-1.1-4.20170830gitafc8ea9.fc28.x86_64                                  6/22 
  Verifying        : zvbi-0.2.35-5.fc28.x86_64                                                      7/22 
  Verifying        : opencore-amr-0.1.5-3.fc28.x86_64                                               8/22 
  Verifying        : vo-amrwbenc-0.1.3-4.fc28.x86_64                                                9/22 
  Verifying        : x264-libs-0.152-5.20171224gite9a5903.fc28.x86_64                              10/22 
  Verifying        : x265-libs-2.7-3.fc28.x86_64                                                   11/22 
  Verifying        : xvidcore-1.3.5-1.fc28.x86_64                                                  12/22 
  Verifying        : libavdevice-4.0.2-6.fc28.x86_64                                               13/22 
  Verifying        : libass-0.13.4-6.fc28.x86_64                                                   14/22 
  Verifying        : beignet-1.3.2-2.fc28.x86_64                                                   15/22 
  Verifying        : clang5.0-libs-5.0.1-3.fc28.x86_64                                             16/22 
  Verifying        : llvm5.0-libs-5.0.1-7.fc28.x86_64                                              17/22 
  Verifying        : opencl-filesystem-1.0-6.fc27.noarch                                           18/22 
  Verifying        : pocl-1.1-4.fc28.x86_64                                                        19/22 
  Verifying        : hwloc-libs-1.11.9-1.fc28.x86_64                                               20/22 
  Verifying        : mesa-libOpenCL-18.0.5-4.fc28.x86_64                                           21/22 
  Verifying        : libclc-0.2.0-9.git1cb3fbf.fc27.x86_64                                         22/22 

Installed:
  ffmpeg.x86_64 4.0.2-6.fc28                                  beignet.x86_64 1.3.2-2.fc28                
  mesa-libOpenCL.x86_64 18.0.5-4.fc28                         pocl.x86_64 1.1-4.fc28                     
  clang5.0-libs.x86_64 5.0.1-3.fc28                           ffmpeg-libs.x86_64 4.0.2-6.fc28            
  hwloc-libs.x86_64 1.11.9-1.fc28                             libaom.x86_64 1.0.0-3.fc28                 
  libass.x86_64 0.13.4-6.fc28                                 libavdevice.x86_64 4.0.2-6.fc28            
  libclc.x86_64 0.2.0-9.git1cb3fbf.fc27                       libmfx.x86_64 1.23-3.fc28                  
  llvm5.0-libs.x86_64 5.0.1-7.fc28                            ocl-icd.x86_64 2.2.12-1.fc28               
  opencl-filesystem.noarch 1.0-6.fc27                         opencore-amr.x86_64 0.1.5-3.fc28           
  vid.stab.x86_64 1.1-4.20170830gitafc8ea9.fc28               vo-amrwbenc.x86_64 0.1.3-4.fc28            
  x264-libs.x86_64 0.152-5.20171224gite9a5903.fc28            x265-libs.x86_64 2.7-3.fc28                
  xvidcore.x86_64 1.3.5-1.fc28                                zvbi.x86_64 0.2.35-5.fc28                  

Complete!

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.