Bug 6677

Summary: Enable libopenh264 in rpmfusion ffmpeg package
Product: Fedora Reporter: P D <pizzadudedotca>
Component: ffmpegAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: RESOLVED FIXED    
Severity: enhancement CC: belegdol, geraldo.simiao.kutz, kwizart, leigh123linux, ngompa13, v.ondruch, xspielinbox+rpmfusion
Priority: P1    
Version: f38   
Hardware: All   
OS: GNU/Linux   
namespace:

Description P D 2023-05-09 02:04:18 CEST
Please enable libopenh264 in the rpmfusion ffmpeg package, which should apparently fix the OBS Studio fedora package crashing when clicking settings when coupled with the rpmfusion ffmpeg package.

Currently the problem doesn't happen with ffmpeg-free from Fedora repos, and I was told by the maintainer of the OBS Studio fedora package that the reason it doesn't work in rpmfusion is because libopenh264 isn't in the ffmpeg package from rpmfusion, hence this bug report. Also, installing ffmpeg-free is not a viable solution.
Comment 1 Neal Gompa 2023-05-09 03:25:50 CEST
For some extra context, it appears that OBS would like all fallback codecs to be available all the time for the simple view.

It's fairly straightforward to correct this in the RPM Fusion side by enabling the libopenh264 codec in ffmpeg.

Rathann, could you look into enabling this?

There are two possible paths for doing so:

1. Getting RPM Fusion to pull in the fedora-cisco-openh264 repo into the buildroot so it can be linked directly.
2. Taking the dlopen patch and openh264 headers tarball to enable it the same way here as a dynamically loaded one.

RPM Fusion isn't beholden to the same restriction that the Fedora Koji environment is, so it can pick either way.
Comment 2 Nicolas Chauvet 2023-05-09 12:06:23 CEST
@Neal

There is no mention of the actual crash, please report the full problem about why openh264 would still be relevant.

My POV is still that obs shouldn't crash if missing openh264 for the same reason that applications that will rightly assumes builtin H264/5 (decoder) support isn't in ffmpeg shouldn't crash.

Also that ffmpeg builtin H264 decoders should be used instead of the OpenH264 version.
Comment 3 Neal Gompa 2023-05-09 12:18:55 CEST
It's not about decoding, it's about encoding. In ffmpeg, when encoding, you have to select a _specific_ encoder. There's no auto-selection for that.
Comment 5 Nicolas Chauvet 2023-05-09 15:46:53 CEST
(In reply to Neal Gompa from comment #3)
> It's not about decoding, it's about encoding. In ffmpeg, when encoding, you
> have to select a _specific_ encoder. There's no auto-selection for that.

Decode/Encode either way, this doesn't change that the obs fedora package is crashing in fedora.

Also please stop pushing end-users to this bug as the only possible solution when you have introduced the problem by removing a perfectly working obs-studio packages from our repository across all releases.

Enforcing your view on others maintainers after the fact is to the least, totally unfair.


Now where is the upstream report.


I might re-introduce obs-studio-freeworld as a monolithic build if the problem cannot be fixed on the obs side "properly".
Comment 6 leigh scott 2023-05-10 21:45:36 CEST
(In reply to Neal Gompa from comment #3)
> It's not about decoding, it's about encoding. In ffmpeg, when encoding, you
> have to select a _specific_ encoder. There's no auto-selection for that.

Why don't you drop these patches?, that would fix the issue caused by them.


https://src.fedoraproject.org/rpms/obs-studio/blob/rawhide/f/obs-studio.spec#_44
Comment 7 leigh scott 2023-05-12 13:45:10 CEST
(In reply to Neal Gompa from comment #1)
> For some extra context, it appears that OBS would like all fallback codecs
> to be available all the time for the simple view.
> 
> It's fairly straightforward to correct this in the RPM Fusion side by
> enabling the libopenh264 codec in ffmpeg.
> 
> Rathann, could you look into enabling this?
> 
> There are two possible paths for doing so:
> 
> 1. Getting RPM Fusion to pull in the fedora-cisco-openh264 repo into the
> buildroot so it can be linked directly.

This is fine for fedora, what do you suggest for el9?

> 2. Taking the dlopen patch and openh264 headers tarball to enable it the
> same way here as a dynamically loaded one.

Using non-upstream patches isn't an acceptable solution.

> 
> RPM Fusion isn't beholden to the same restriction that the Fedora Koji
> environment is, so it can pick either way.
Comment 8 Neal Gompa 2023-05-12 13:57:50 CEST
(In reply to leigh scott from comment #7)
> (In reply to Neal Gompa from comment #1)
> > For some extra context, it appears that OBS would like all fallback codecs
> > to be available all the time for the simple view.
> > 
> > It's fairly straightforward to correct this in the RPM Fusion side by
> > enabling the libopenh264 codec in ffmpeg.
> > 
> > Rathann, could you look into enabling this?
> > 
> > There are two possible paths for doing so:
> > 
> > 1. Getting RPM Fusion to pull in the fedora-cisco-openh264 repo into the
> > buildroot so it can be linked directly.
> 
> This is fine for fedora, what do you suggest for el9?
> 

OpenH264 for EL9 is planned. The build tag was created a while ago in Fedora Koji, we just don't have a build made and submitted yet. It's being worked on.
Comment 9 xspielinbox+rpmfusion 2023-05-13 00:24:45 CEST
In my opinion the best solution would be if the Fedora Linux OBS Studio build would just work with both the Fedora Linux as well as the RPM Fusion ffmpeg packages.

If that should not be possible for some reason the next best solution would be that the Fedora Linux OBS Studio build works with the Fedora Linux ffmpeg and there is a RPM Fusion OBS Studio build that works with the RPM Fusion build of ffmpeg and that the packages handle the dependencies automatically.

All other solutions are just not usable for the end user.
Comment 10 xspielinbox+rpmfusion 2023-05-13 00:39:21 CEST
The settings dialog of the Fedora Linux OBS Studio build works now with ffmpeg and ffmpeg-libs installed. Thank you!
Comment 11 Geraldo Simiao 2023-05-14 05:55:55 CEST
Tested the new build here on my F37 swaped the fedora ffmpeg-free for ffmpeg-5.1.3-2.fc37  and indeed OBS now works just fine.

obs-studio-libs-29.1.0-2.fc37.x86_64
obs-studio-29.1.0-2.fc37.x86_64
ffmpeg-5.1.3-2.fc37

Excellent.
Comment 12 Vít Ondruch 2023-05-17 20:47:28 CEST
~~~
 Problem 1: cannot install the best update candidate for package ffmpeg-libs-6.0-8.fc39.x86_64
  - nothing provides libopenh264.so.7()(64bit) needed by ffmpeg-libs-6.0-11.fc39.x86_64
 Problem 2: package libavdevice-6.0-11.fc39.x86_64 requires ffmpeg-libs(x86-64) = 6.0-11.fc39, but none of the providers can be installed
  - cannot install the best update candidate for package libavdevice-6.0-8.fc39.x86_64
  - nothing provides libopenh264.so.7()(64bit) needed by ffmpeg-libs-6.0-11.fc39.x86_64
 Problem 3: package ffmpeg-6.0-11.fc39.x86_64 requires ffmpeg-libs(x86-64) = 6.0-11.fc39, but none of the providers can be installed
  - cannot install the best update candidate for package ffmpeg-6.0-8.fc39.x86_64
  - nothing provides libopenh264.so.7()(64bit) needed by ffmpeg-libs-6.0-11.fc39.x86_64
~~~

I don't have the openh264 repo enabled and I have never needed it, because I always have ffmpeg installed. Why it should be needed now? Don't the ffmpeg have its own h264 implementation?
Comment 13 Nicolas Chauvet 2023-05-17 21:21:46 CEST
(In reply to Vít Ondruch from comment #12)
> ~~~
...
> I don't have the openh264 repo enabled and I have never needed it, because I
> always have ffmpeg installed. Why it should be needed now? Don't the ffmpeg
> have its own h264 implementation?

See https://bugzilla.rpmfusion.org/show_bug.cgi?id=6677#c2

We tried to defend this sane assumption, but we cannot at the prize of breaking some end-users. obs-studio in fedora assumed ffmpeg with openh264 enabled and have a separate plugin for x264 encoding.
Comment 14 Vít Ondruch 2023-05-18 19:46:48 CEST
So make it soft dependency.
Comment 15 leigh scott 2023-05-19 08:46:34 CEST
(In reply to Vít Ondruch from comment #14)
> So make it soft dependency.

If you don't like it find another repo!
Comment 16 Vít Ondruch 2023-05-19 09:25:09 CEST
(In reply to leigh scott from comment #15)
> (In reply to Vít Ondruch from comment #14)
> > So make it soft dependency.
> 
> If you don't like it find another repo!

I hope there is no need for hostility. Because that could have been also the answer to the initial request.

My proposal was well meant and I believe it is reasonable. In my 12+ years using Fedora, I always used ffmpeg for h264 decoding and so far I have not needed libopenh264.

I believe that majority of users needs just decoding.

But if you insist, there is probably no other option the use Fedora ffmpeg + libopenh264, because why would I keep using RPMFusion ffmpeg if I'd need to install libopenh264 anyway?
Comment 17 leigh scott 2023-05-19 10:03:22 CEST
(In reply to Vít Ondruch from comment #16)
> (In reply to leigh scott from comment #15)
> > (In reply to Vít Ondruch from comment #14)
> > > So make it soft dependency.
> > 
> > If you don't like it find another repo!
> 
> I hope there is no need for hostility. Because that could have been also the
> answer to the initial request.

The fedora obs-studio and ffmpeg packages forced this change, using their non-upstream dlopen patches isn't an option.

> 
> My proposal was well meant and I believe it is reasonable. In my 12+ years
> using Fedora, I always used ffmpeg for h264 decoding and so far I have not
> needed libopenh264.

I'm not happy with the increased workload imposed on me by fedora moving packages to their repo.
They break stuff and we get the bug reports, there is no coordination on package updates.

> 
> I believe that majority of users needs just decoding.
> 
> But if you insist, there is probably no other option the use Fedora ffmpeg +
> libopenh264, because why would I keep using RPMFusion ffmpeg if I'd need to
> install libopenh264 anyway?


Feel free to use their crippled ffmpeg version, it has no x265 support and limited h264 support.