Video playback broken after upgrading to F39: libopenh264.so.7 is missing, openh264 support will be disabled

Got a notification that Fedora 39 is available, upgraded via gnome-software and now, VLC won’t play video files anymore:

VLC could not decode the format “h264” (H264 - MPEG-4 AVC (part 10))

What happened to VLC’s internal codecs? I’ve never had to install codecs for VLC.

$ file *MOV
20231220A.MOV: ISO Media, Apple QuickTime movie, Apple QuickTime (.MOV/QT)
$ ffmpeg -i 20231220A.MOV 20231220_test.mkv
[libopenh264 @ 0x5559a2efbe40] libopenh264.so.7: cannot open shared object file: No such file or directory: libopenh264.so.7 is missing, openh264 support will be disabled
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5559a2efaec0] Failed to open codec in avformat_find_stream_info
[libopenh264 @ 0x5559a2efbe40] libopenh264.so.7: cannot open shared object file: No such file or directory: libopenh264.so.7 is missing, openh264 support will be disabled

This is VLC media player 3.0.20 on Fedora 39. It used to work before the upgrade and the file can be played on another Fedora system which is still running F38, both have VLC installed from RPM Fusion.

The VLC app is now coming from fedora and it previously was installed from rpmfusion.

It seems some of the codecs it earlier required are no longer installed automatically because of the restrictions fedora has on what it may distribute.

Try installing ffmpeg and/or libavcodec-freeworld from rpmfusion while using dnf. The command would be something like sudo dnf install ffmpeg libavcodec-freeworld --allowerasing as long as you have the rpmfusion-free repo enabled.

I have both those installed though some seem to only use ffmpeg.

Interesting, but I thought the codec in question used to be included with the vlc package, meaning it was never necessary to install additional codec packages. Did the Fedora maintainers remove the codecs from the vlc package and if so, where have they documented that major breaking change?

Looks like the package maintainers have broken some dependencies:

Error: 
 Problem: conflicting requests
  - package ffmpeg-6.0-16.fc39.x86_64 from rpmfusion-free requires ffmpeg-libs(x86-64) = 6.0-16.fc39, but none of the providers can be installed
  - package ffmpeg-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates requires ffmpeg-libs(x86-64) = 6.0.1-3.fc39, but none of the providers can be installed
  - nothing provides libopenh264.so.7()(64bit) needed by ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free
  - nothing provides libopenh264.so.7()(64bit) needed by ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates

No, dependencies are not broken. That is why I showed the --allowerasing option.
The openh264 package comes from the fedora-cisco-openh264 repo which is one that can be enabled from the gnome software app. The repo file is installed by default but not enabled unless the user enables the 3rd party repos during the first boot setup or enables it later. It seems that most users automatically enable those repos but you may have not done so.

The fix – enable that repo and try again.

Yes, fedora stripped out some of the packaged codecs previously included by rpmfusion because of their limitations on distributing certain licensed, proprietary, or copyrighted software. Removal of those codecs is why you found this issue initially.

Multimedia issues with the limited codecs distributed by fedora seems common knowledge and has been a problem from the very beginning with fedora (about 20 years).

Here is one reference that may help as well, although with the recent change to vlc by fedora the last comment is invalid.

Don’t you think such a package dependency conflict counts as something broken?

I think there’s something seriously wrong if a package from a standard repository (vlc now being in Fedora’s repo apparently) has a dependency on something from a non-standard repository (Cisco). As of now, with Fedora 39, it seems like VLC does not work anymore as long as the user doesn’t manually enable that Cisco repository.

Thanks for the hint, this is what it looks like on the other system with F38 (not yet upgraded):

$ sudo rpm -qa | grep h264
openh264-2.3.1-2.fc38.x86_64
mozilla-openh264-2.3.1-2.fc38.x86_64

No
You are reading that wrong.
VLC from fedora works quite well as-is as long as the file being played works with the available codecs. VLC from fedora does not depend upon the openh264 package. ffmpeg from rpmfusion introduces that dependency as part of the additional codecs it makes available.

In order to play media with nonsupported codecs the user must install ffmpeg from rpmfusion (a 3rd party repo) which also requires that the user have openh264 available (from another 3rd party repo) so it is up to the user choice to install that package and its dependencies or not. Nothing is broken except the users expectations. The same applied earlier when VLC was installed on F38 – it also required the cisco repo to be enabled.

Run the command dnf list installed | grep h264. That should tell you from which repos those were installed.

Compare the output of dnf repolist on the F38 system and on the F39 system. I suspect the F38 system will have the fedora-cisco-openh264 repo enabled and the F39 system will not.

While I agree with the unexpected changes causing confusion, the technical details are that nothing is broken except the users perception.

Can you check dnf repolist and make sure the appropriate ones are enabled?

Yes, I got that. Maybe I judged too quickly. You do have a point, it does not seem to be the case that the vlc package itself has broken dependencies. This issue appears to be between RPM Fusion and Cisco.

I’ve already enabled the Cisco repository and ran dnf update openh264 which updated three packages from fedora-cisco-openh264, which is also shown by dnf list installed.

Again, thanks for the hint with the Cisco repo (and the ffmpeg package from rpmfusion-free).

After enabling the Cisco repository and updating, the error is gone, but h264 videos still won’t play - only audio with black video or first frame only. As suggested above, ffmpeg with ffmpeg-libs from rpmfusion had to be (re)installed, which removed (replaced) ffmpeg-free along with some dependencies from @updates.

Steps taken:

  1. Enable Cisco repository: # dnf config-manager --set-enabled fedora-cisco-openh264
  2. Update h264 codec package to fix the error: # dnf update openh264
  3. Install/update ffmpeg to fix video playback: # dnf install ffmpeg ffmpeg-libs libavcodec-freeworld --allowerasing

It was possible to decode H.264 with just the RPM Fusion repos on F38, but this is no longer possible on F39 because now it depends on the Fedora Cisco repo.

Just as a side remark, the cisco repository is now enabled by default since February 2020. From https://src.fedoraproject.org/rpms/fedora-repos.git

commit 7f050d24a624be37efd8e21f12087d27a77695bc
Author: Neal Gompa <ngompa13@gmail.com>
Date:   Sat Feb 22 18:49:06 2020 -0500

    Enable fedora-cisco-openh264 repo by default
    
    Signed-off-by: Neal Gompa <ngompa13@gmail.com>


I guess I had not paid attention. I always enable the 3rd party repos and guess I just assumed it was one of those.

That brings to mind the question of why installing ffmpeg from rpmfusion was not able to pull in openh264 for @basic6 in his post 3 above.

I guess without the results from dnf repolist we cannot tell, but it would appear his system did not access the fedora-cisco-openh264 repo at all when he ran that command.

I expect people have a tendency to disable it because it seems unnecessary.

The hard dependency on openh264 in RPM Fusion’s ffmpeg build is caused by an unfortunate combination of policies and circumstances. I’m hopeful that it will go away in F40 (thanks to noopenh264).

I have two machines running F39. One can get the cisco repo with no problem, the other gives a 404 error when it tries to get the repomd.xml from the repo. (IP: 85.236.55.6) I have done a clean all with dnf and I still get the error.

Is one of the mirrors broken?

Possibly.

Wait an hour and try again. Usually those are temporary problems and just waiting a bit allows the connection to then work.

I had the same problem (on a different computer) and found that there was an unused copy of the cisco repo config file suffixed “rpmnew”, apparently added by an update, which contains a different domain for the repository url: mirrors.fedoraproject.org instead of codecs.fedoraproject.org

TLDR; try this:

sudo cp --backup /etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew /etc/yum.repos.d/fedora-cisco-openh264.repo

And even though the old domain is still valid, it’s even an alias, it fails because the old address is missing “os/”.

$ sudo dnf update openh264
Fedora 39 openh264 (From Cisco) - x86_64                                                                                      338  B/s | 271  B     00:00    
Errors during downloading metadata for repository 'fedora-cisco-openh264':
  - Status code: 404 for https://codecs.fedoraproject.org/openh264/39/x86_64/repodata/repomd.xml

If I query the new repo address, I get sent to (note the difference after “x86_64/”):

https://codecs.fedoraproject.org/openh264/39/x86_64/os/repodata/repomd.xml

There was a new version of that config file (fedora-cisco-openh264.repo.rpmnew) but the old config file which contains the old repository address has not been replaced and is still in use:

$ grep -E baseurl\|metalink /etc/yum.repos.d/fedora-cisco-openh264.repo /etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew
/etc/yum.repos.d/fedora-cisco-openh264.repo:baseurl=https://codecs.fedoraproject.org/openh264/$releasever/$basearch/
/etc/yum.repos.d/fedora-cisco-openh264.repo:baseurl=https://codecs.fedoraproject.org/openh264/$releasever/$basearch/debug/
/etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew:metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch
/etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew:metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-debug-$releasever&arch=$basearch

So if you have that “rpmnew” file too, just copy it:

# cp -via /etc/yum.repos.d/fedora-cisco-openh264.repo /etc/yum.repos.d/fedora-cisco-openh264.repo.old
'/etc/yum.repos.d/fedora-cisco-openh264.repo' -> '/etc/yum.repos.d/fedora-cisco-openh264.repo.old'
# cp -vi /etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew /etc/yum.repos.d/fedora-cisco-openh264.repo
'/etc/yum.repos.d/fedora-cisco-openh264.repo.rpmnew' -> '/etc/yum.repos.d/fedora-cisco-openh264.repo'

If you don’t have that “.rpmnew” file, edit the “.repo” file and replace the “baseurl” line with the “metalink” line in the first section (after making a backup copy of the file, see command above).

The new repo file should look like this (/etc/yum.repos.d/fedora-cisco-openh264.repo):

[fedora-cisco-openh264]
name=Fedora $releasever openh264 (From Cisco) - $basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-$releasever&arch=$basearch
type=rpm
enabled=1
metadata_expire=14d
repo_gpgcheck=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=True

[fedora-cisco-openh264-debuginfo]
name=Fedora $releasever openh264 (From Cisco) - $basearch - Debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-cisco-openh264-debug-$releasever&arch=$basearch
type=rpm
enabled=0
metadata_expire=14d
repo_gpgcheck=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=True

That could explain a lot. F33 changed to the metalink, and apparently the repo url changed after that.

The file is marked %config(noreplace), so anyone who edited it on F32 or earlier would be in the same boat.

Ended up here when searching for solution why I couldn’t get H.264 decoder working in VLC. (Also I needed avidemux, which I think failed to install at first.) Freshly installed Fedora 39 to formatted disk.

When trying to install ie. x264 package or ffmpeg, it complained about conflicting packages. I had rpmfusion free and nonfree repositories enabled.

Removing libswscale-free (with packages depending on it) solved the problem.

In short, what I did to get ffmpeg installed and H.264 working in vlc:

dnf remove libswscale-free
dnf install ffmpeg vlc avidemux

Unfortunately it did not. After a fresh install of F40 I discovered no video codec support. I did notice this problem when testing the live os before doing the full install. All of the codecs I needed appeard to be installed. So I hoped in vain it was a limitation of running from a usb praying a full install would come with the codecs working. But alas… they did not. Very disappointed that I now have to spend time and effort getting something so basic to work as it should ‘out of the box’.

Why this should not be considered breakage is beyond me.

$ sudo dnf remove libswscale-free
Error:
Problem: The operation would result in removing the following protected packages: plasma-desktop
(try to add ‘–skip-broken’ to skip uninstallable packages)

Don’t use that command separately.
instead use the second command with the --allowerasing option and it will replace the needed files instead of removing them.
I used dnf install ffmpeg libavcodec-freeworld vlc --allowerasing which removed libswscale-free and others that were replaced with more codecs.

1 Like