Hello, I’m trying to build a Gtk4 based app using gtkmm-4.0 through MSYS2. I was trying to display an animated icon using gif files but found gtk4 doesn’t support gif images so I thought of converting the gif file to webm and displaying it as a video. I tried using gtk4.Video to play it but it doesn’t work. The video widget shows up but it doesn’t let me play the video. Here is a pic.
I also get this warning
GStreamer-Play-WARNING **: 21:55:21.600: GstPlay: scaletempo element not available. Audio pitch will not be preserved during trick modes
This is how I set up the video
Glib::RefPtr< Gtk::MediaFile > mf = Gtk::MediaFile::create_for_filename("./xyz.mp4");
mf->set_loop(true);
mf->set_playing(true);
Gtk::Video vid(mf);
I thought I was missing the gstreamer library perhaps so I also included the gstreamer library through cmake and installed the binaries from the website for windows but it still doesn’t work. Here is a screencap of my cmakeLists.txt
lb90
August 30, 2023, 5:26pm
2
Hello @gallickgunner ! Will take a look
What’s the output of:
gst-inspect-1.0 -a
pacman -Q | grep gst
Thanks. The first command throws a bunch of info which is very long to post here. Here is the link to text file containing the output.
The output of the second command is this.
I also tried installing gst-plugins-bad
but didn’t work so I uninstalled it. Hence you don’t see it in the above picture
I think the problem is the gtkmm-4.0 package on msys2 site lists gtk4 as the dependency instead of gtk4-media-gstreamer
Gtk4 unlike gtk4-media-gstreamer
includes the gst-plugin-bad-libs
as its “build” dependency instead of the normal dependency.
https://packages.msys2.org/package/mingw-w64-ucrt-x86_64-gtk4-media-gstreamer?repo=ucrt64
https://packages.msys2.org/package/mingw-w64-ucrt-x86_64-gtk4
Perhaps this is causing the issue? Found a relevant issue on MSYS github regarding splitting of the gtk4 core and the media backend.
opened 04:19PM - 17 Jun 23 UTC
closed 12:37PM - 22 Jun 23 UTC
package-request
### Package name
gtk4-media-gstreamer
### Brief description of package
Packag… e `gtk4` provides a media backend based on GStreamer.
Problem: it brings around 2 GB of multimedia dependencies (through `gst-plugins-bad-libs`) which are absolutely useless for most gtk4 clients.
Would it be possible to split the `gtk4` package and provide files `/ucrt64/lib/gtk-4.0/4.0.0/media/libmedia-gstreamer.*` in a separate optional package like `gtk4-media-gstreamer`?
`gtk4-media-gstreamer` will be the one that depends on the `gst-plugins-bad-libs` bloat.
For information, Ubuntu already does that (apt package: "libgtk-4-media-gstreamer")
Note: if media backend is missing, gtk4 will gracefully show placeholders for embedded videos, so I don't expect that change will break existing installations. Users can install `gtk4-media-gstreamer` manually if they need media features.
### URL for package's homepage
same as gtk4: https://www.gtk.org
### Provide a basic test case to validate the package's functionality.
`gtk4` provides the `gtk4-widget-factory` tool, that's a demo which includes a video widget example.
When `gtk4-media-gstreamer` is absent, the video widget example shall display a placeholder.
When `gtk4-media-gstreamer` is present, the video widget example shall display short animated clip.
### MINGW environments where you need the package
- [ ] MINGW64
- [ ] MINGW32
- [X] UCRT64
- [ ] CLANG64
- [ ] CLANG32
- [ ] CLANGARM64
### Are you willing to submit a PR?
_No response_
If that’s the case what’s the workaround? How do I tell gtkmm
to use gtk4-media-gstreamer
instead of plain gtk4
?
lb90
August 30, 2023, 8:11pm
5
It’s a runtime library, so you only have to install it with pacman, no need to recompile
Also try running gtk4-widget-factory
(t’s part of the gtk4 package). It should display a video as in File:Gtk4-widget-factory demos.png - Wikipedia
It doesn’t show the video in the example as well. I tried installing gtk4-media-gstreamer
but it says there is a conflict with the files installed by the simple gtk4
and installation aborts.
EDIT:- So I just checked the msys2 site and these are the only 2 files that get installed and I already had them somehow. I tried deleting them and installing the gtk4-media-gstreamer
package and it got installed successfully but the video still isn’t playing.
EDIT2: In order to better isolate the issue I uninstalled everything and installed gtk4
only. The video doesn’t play as expected since gstreamer is missing. I installed gtk4-media-gstreamer
but the video still doesn’t play even though the gstreamer dlls are now present in the right directory.
Issue solved. It seems I needed to add gst-plugins-good
as well. Link to github issue on msys2 repo
opened 07:42AM - 31 Aug 23 UTC
bug
I'm trying to develop an application with gtk4 and want to display a video. Foun… d out that the gstreamer media backend was separated into a separate package `gtk4-media-gstreamer`. I installed it but the video still shows a placeholder image and doesn't play. Is this perhaps related to any missing packages?
1) Install `gtk4-media-gstreamer` by doing `pacman -Syu mingw-w64-ucrt-x86_64-gtk4-media-gstreamer`
2) Run `gtk4-widget-factory`
3) The video in the demo doesn't play
### Expected behavior
I should be seeing a video here like so
[https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Gtk4-widget-factory_demos.png/1200px-Gtk4-widget-factory_demos.png](url)
### Actual behavior
The video only shows a placeholder which should be happening when you only install `gtk4` instead of `gtk4-media-gstreamer`
![image](https://github.com/msys2/MINGW-packages/assets/40718428/3c50314c-47e5-4129-a4c6-1fca34aa4c2c)
### Verification
- [X] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)
### Windows Version
MINGW64_NT-10.0-19045
### MINGW environments affected
- [ ] MINGW64
- [ ] MINGW32
- [X] UCRT64
- [ ] CLANG64
- [ ] CLANG32
- [ ] CLANGARM64
2 Likes
system
(system)
Closed
October 1, 2023, 3:31am
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.