Bug 2035771 - To play h265/hevc video, totem asks to install codec already installed
Summary: To play h265/hevc video, totem asks to install codec already installed
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-software
Version: 35
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Milan Crha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-27 13:41 UTC by Ignacy Kuchciński
Modified: 2023-07-17 05:28 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-13 16:12:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ignacy Kuchciński 2021-12-27 13:41:16 UTC
User-Agent:       Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Build Identifier: 

When trying to play a x265 video with totem, it suggests me to find "H.265 (Main Profile) decoder", and the suggested package in gnome software is "GStreamer Mulitmedia Codecs - Extra", which in my case is already installed. The solution was to enable rpmfusion-free repository and install "GStreamer Multimedia Codecs - libav".

Reproducible: Always

Steps to Reproduce:
1. Fresh install of fedora 35 (enabled third party repositories during installation)
2. Download example h265/hevc video from here https://dl5.webmfiles.org/video-h265.mkv
3. Try to play the video in totem
Actual Results:  
User is suggested to install wrong package in gnome software.

Expected Results:  
The correct package should be already installed due to enabling third party repositories during installation or the user should be suggested the correct package in gnome-software or the situation should be explained to the user.

Comment 1 Bastien Nocera 2022-01-03 10:28:57 UTC
What's the error you get on the command-line when trying to play this file without the libav package installed?

the "bad-free" package (I have no idea where gnome-software gets its "GStreamer Mulitmedia Codecs - Extra" name from, but it's far from useful) only provides parsing support for h265:
$ repoquery --archlist=x86_64 --provides gstreamer1-plugins-bad-free | grep 265
Last metadata expiration check: 0:01:01 ago on Mon 03 Jan 2022 11:25:20 CET.
gstreamer1(decoder-video/x-h265)()(64bit)
gstreamer1(element-h265parse)()(64bit)

Reassigning to gnome-software as totem isn't responsible for this part of the UI, it just forwards its missing plugin info to gnome-software (which probably shouldn't be advising to install an already installed package).

Comment 2 Milan Crha 2022-01-03 11:26:11 UTC
Thanks for a bug report. Could you run from a terminal:

   $ fedora-third-party query
   $ fedora-third-party list

please?

The later doesn't offer rpmfusion-free repository to me, thus the gnome-software cannot know about the other package. It shows only what it could find. Being there two or more suggestions, it'll give you a choice to pick from, but when there's only one suggestion found, it shows its details immediately.

Comment 3 Ignacy Kuchciński 2022-01-03 15:25:53 UTC
(In reply to Bastien Nocera from comment #1)
> What's the error you get on the command-line when trying to play this file
> without the libav package installed?
> 
> the "bad-free" package (I have no idea where gnome-software gets its
> "GStreamer Mulitmedia Codecs - Extra" name from, but it's far from useful)
> only provides parsing support for h265:
> $ repoquery --archlist=x86_64 --provides gstreamer1-plugins-bad-free | grep
> 265
> Last metadata expiration check: 0:01:01 ago on Mon 03 Jan 2022 11:25:20 CET.
> gstreamer1(decoder-video/x-h265)()(64bit)
> gstreamer1(element-h265parse)()(64bit)
> 
> Reassigning to gnome-software as totem isn't responsible for this part of
> the UI, it just forwards its missing plugin info to gnome-software (which
> probably shouldn't be advising to install an already installed package).

```
[ignapk@fedora ~]$ totem video-h265.mkv
** Message: 15:55:15.511: Missing plugin: gstreamer|1.0|totem|H.265 (Main Profile) decoder|decoder-video/x-h265, level=(string)4, tier=(string)main, profile=(string)main, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)bt709 (H.265 (Main Profile) decoder)
 
(totem:4192): Gtk-WARNING **: 15:55:15.534: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node slider owner GtkScale)
** Message: 15:55:28.420: PackageKit: xid = 0
** Message: 15:55:28.421: PackageKit: desktop_id = org.gnome.Totem.desktop
** Message: 15:55:28.421: PackageKit: Codec nice name: H.265 (Main Profile) decoder
** Message: 15:55:28.421: PackageKit: ignoring field named level
** Message: 15:55:28.422: PackageKit: ignoring field named tier
** Message: 15:55:28.422: PackageKit: ignoring field named profile
** Message: 15:55:28.422: PackageKit: ignoring field named chroma-format
** Message: 15:55:28.422: PackageKit: ignoring field named bit-depth-luma
** Message: 15:55:28.422: PackageKit: ignoring field named bit-depth-chroma
** Message: 15:55:28.423: PackageKit: ignoring field named colorimetry
** Message: 15:55:28.423: PackageKit: structure: gstreamer1(decoder-video/x-h265)()(64bit)
 
(totem:4192): Grilo-CRITICAL **: 15:56:15.209: grl_log_valist: assertion 'domain' failed
```

```
[ignapk@fedora ~]$ repoquery --archlist=x86_64 --provides gstreamer1-libav
Last metadata expiration check: 0:01:08 ago on Mon 03 Jan 2022 04:14:27 PM CET.
gstreamer1-libav = 1:1.19.1-2.fc35
gstreamer1-libav = 1:1.19.3-1.fc35
gstreamer1-libav(x86-64) = 1:1.19.1-2.fc35
gstreamer1-libav(x86-64) = 1:1.19.3-1.fc35
libgstlibav.so()(64bit)
```

Thank you for reply and for reassinging it to correct place.

Comment 4 Ignacy Kuchciński 2022-01-03 15:28:26 UTC
(In reply to Milan Crha from comment #2)
> Thanks for a bug report. Could you run from a terminal:
> 
>    $ fedora-third-party query
>    $ fedora-third-party list
> 
> please?
> 
> The later doesn't offer rpmfusion-free repository to me, thus the
> gnome-software cannot know about the other package. It shows only what it
> could find. Being there two or more suggestions, it'll give you a choice to
> pick from, but when there's only one suggestion found, it shows its details
> immediately.

```
[ignapk@fedora ~]$ fedora-third-party query
Third-party repositories are enabled.
[ignapk@fedora ~]$ fedora-third-party list
Name                            Type
------------------------------- -------
flathub                         flatpak
google-chrome                   dnf
phracek-PyCharm                 dnf
rpmfusion-nonfree-nvidia-driver dnf
rpmfusion-nonfree-steam         dnf
```

However, after enabling rpmfusion-free repository, output of above command doesn't change and I can still reproduce the unwanted behaviour.

Comment 5 Bastien Nocera 2022-01-03 15:53:25 UTC
There's 2 problems:

- /usr/lib64/gstreamer-1.0/libgstvideoparsersbad.so in gstreamer1-plugins-bad-free says it can decode H265 video. It cannot.

This will be something to figure out in gstreamer1 which ships the patch to print that plugin installation information:
https://src.fedoraproject.org/rpms/gstreamer1/blob/rawhide/f/gstreamer-inspect-rpm-format.patch

gnome-software will also need to not ignore some of the fields that gstreamer will pass on, so that the codecs are unique enough.

- "repoquery --archlist=x86_64 --provides gstreamer1-libav" shows that the gstreamer.prov probably didn't work,
  and it doesn't export any metadata that would make it automatically installable. That's a bug for rpmfusion to figure out.

Comment 6 Milan Crha 2022-01-04 14:08:38 UTC
The gnome-software currently does not receive notifications on the PacakgeKit repository changes. Even there's a rejected change at [1], the upstream decided to have this done better in 42. That means, when a user adds the rpmfusion free repository he/she should also `gnome-software --quit` to have the changes propagated there as well.

There's no other problem on the gnome-software side, from my point of view.

[1] https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1070

Comment 7 Milan Crha 2022-01-04 14:29:32 UTC
(In reply to Bastien Nocera from comment #5)
> gnome-software will also need to not ignore some of the fields that
> gstreamer will pass on, so that the codecs are unique enough.

Could you elaborate on this a bit more, please?

I see that totem calls:

   method call time=1641305426.235393 sender=:1.86 -> destination=:1.80 serial=5 path=/org/freedesktop/PackageKit;
   interface=org.freedesktop.PackageKit.Modify2; member=InstallGStreamerResources
      array [
         string "H.265 (Main Profile) decoder|gstreamer1(decoder-video/x-h265)()(64bit)"
      ]
      string "hide-confirm-search"
      string "org.gnome.Totem.desktop"
      array [
         dict entry(
            string "desktop-startup-id"
            variant             string "_TIME50033"
         )
      ]

When I debug it on the gnome-software side, then I see it calls pk_client_what_provides() with a search term:

   "gstreamer1(decoder-video/x-h265)()(64bit)"

and the PackageKit returns "gstreamer1-plugins-bad-free;1.19.3-1.fc35;x86_64;installed:updates" for it, the same as the:

   $ pkcon what-provides "gstreamer1(decoder-video/x-h265)()(64bit)"

Comment 8 Ben Cotton 2022-11-29 17:33:36 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 9 Ben Cotton 2022-12-13 16:12:00 UTC
Fedora Linux 35 entered end-of-life (EOL) status on 2022-12-13.

Fedora Linux 35 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 10 Matti Pulkkinen 2023-07-10 01:01:20 UTC
This is still a problem today in Fedora 38. Trying to play an H.265-encoded file with Totem from the command-line prints this:

** Message: 03:52:46.633: Missing plugin: gstreamer|1.0|totem|H.265 (Main Profile) decoder|decoder-video/x-h265, level=(string)4.1, tier=(string)main, profile=(string)main, colorimetry=(string)bt709, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8 (H.265 (Main Profile) decoder)

whereas I'm able to play the file just fine with MPV. This wouldn't be an issue because I can just use MPV instead of Totem, except for the fact that the Totem thumbnailer can't generate thumbnails for H.265-encoded files either. The problem goes away after installing the gstreamer1-plugin-libav package, but doesn't seem as though it should be required, given that I can already decode H.265 videos without it.

`fedora-third-party query`:
Third-party repositories are enabled.

`fedora-third-party list`:
Name                                           Type
---------------------------------------------- ----
copr:copr.fedorainfracloud.org:phracek:PyCharm dnf
google-chrome                                  dnf
rpmfusion-nonfree-nvidia-driver                dnf
rpmfusion-nonfree-steam                        dnf

`dnf list installed '*gstreamer*'`:
Installed Packages
PackageKit-gstreamer-plugin.x86_64    1.2.6-6.fc38       @fedora                
gstreamer1.i686                       1.22.4-1.fc38      @updates               
gstreamer1.x86_64                     1.22.4-1.fc38      @updates               
gstreamer1-plugin-libav.x86_64        1.22.3-1.fc38      @updates               
gstreamer1-plugin-openh264.x86_64     1.22.1-1.fc38      @fedora-cisco-openh264 
gstreamer1-plugins-bad-free.x86_64    1.22.3-1.fc38      @updates               
gstreamer1-plugins-base.i686          1.22.3-1.fc38      @updates               
gstreamer1-plugins-base.x86_64        1.22.3-1.fc38      @updates               
gstreamer1-plugins-good.i686          1.22.3-1.fc38      @updates               
gstreamer1-plugins-good.x86_64        1.22.3-1.fc38      @updates               
gstreamer1-plugins-good-gtk.x86_64    1.22.3-1.fc38      @updates               
gstreamer1-plugins-good-qt.x86_64     1.22.3-1.fc38      @updates               
gstreamer1-plugins-ugly.x86_64        1:1.22.3-1.fc38    @rpmfusion-free-updates
gstreamer1-plugins-ugly-free.x86_64   1.22.3-1.fc38      @updates               
pipewire-gstreamer.x86_64             0.3.73-1.fc38      @updates

Comment 11 Milan Crha 2023-07-10 08:24:51 UTC
I think the best will be to open an upstream bug against the gnome-software [1], but the above also suggests there are issues in the package meta data, which should be handled first, before asking changes on the gnome-software side which cannot be done due to the meta data issues.

[1] https://gitlab.gnome.org/GNOME/gnome-software/-/issues/

Comment 12 Matti Pulkkinen 2023-07-14 18:04:47 UTC
(In reply to Milan Crha from comment #11)
>the above also suggests there are issues in the package meta data,
> which should be handled first
> 

Could you advise on how, if at all, I could help to move that along?

Comment 13 Milan Crha 2023-07-17 05:28:41 UTC
According to comment #10 the Totem asks for a package providing "decoder-video/x-h265". The package which provides it should advertise it.

Looking into the Provides section of the gstreamer1-plugin-libav ( https://koji.fedoraproject.org/koji/rpminfo?rpmID=34600824 ), it doesn't have this "decoder-video/x-h265" in the list. If it's really needed for the H265 videos decoding, then it should claim so. You can open a bug against the gstreamer1-plugin-libav and ask whether it can decode H265 or not. It can be only a coincidence the playback started to work, as the install of the libav plugin could bring in something related, as a side effect.


Note You need to log in before you can comment on or make changes to this bug.