-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issues #18
Comments
Hi @VarLad, thanks for reporting. I'm not an expert to this actually, so I might be wrong. It depends on what kind of GPU you have. The backend used here is gstreamer.
If you are using Intel/AMD, I guess this should be the expected one:
From gstreamer documentation, it says
So, if the process has a high CPU usage, probably there is something wrong with your setup. Or the video you are trying to play is not HW acceleration supported by gstreamer. If your GPU use VA-API (Intel/AMD), then you should also check Some articles that might be helpful: |
That being said, it seems that I also couldn't get the HW acceleration working on my side. (High CPU usage when compare to other video player, for example Clapper which is also gstreamer-based AFAIK)... Need some investigation. Any advice is welcome! |
@jeffshee I think for gstreamer plugin for vaapi we have |
@VarLad This extension doesn't use anything from Flathub. It is not a Flatpak. So the HW acceleration setup on host must be done correctly. |
@jeffshee Sorry, I mistyped, but I quickly edited the issue :3 |
Yep, we should experiment with this first. Did installing |
Didn't work for me either :< |
Hi, somebody pinged me about this problem for help. The easiest way to check what your app exactly uses is to generate a pipeline dot file to some directory AFAIU from quick glance at your code, you use GTK media stream to play video in your app and set it as Shell background, right? GTK media stream is a very simple and basic example for testing video playback within GTK4, but in order to maximize performance and reduce CPU usage as much as possible, what you really should do is use custom GStreamer pipeline instead. This way you can for example not software decode audio at all instead just muting it, etc. |
The creator of Clapper themselves :D @Rafostar Any idea why hardware decoding is not working here? |
@Rafostar, wow thanks for the advice! (I'm a Clapper user too =3) TBH, Gstreamer stuff is currently outside of my expertise. I managed to generate the dot files but have no idea what info I should look for. I attached mine here if you don't mind taking a look =)
It's indeed very sad to know that GTK4's implementation sometimes lacks this and that. Is that mean I have to follow the path that Clapper is doing (Gstreamer -> OpenGL -> Gtk4)? How much work needs to be done, if all I need is just a simple window playing video in a loop, with HW acceleration? Any documentation suggestions? |
@jeffshee The problem here is that it does not go with There is no much control from user side over GTK media stream implementation "auto" behaviour as it doesn't have access to underlying GStreamer pipeline at all (BTW: I do not use it in Clapper either). But do you even need a GUI toolkit for anything here? AFAIK you just want to spawn a process that shows video only, no? |
@Rafostar
Yep, probably a process that allows some basic control over its spawned window, is enough. For the extension to work, the window needs to have a magic string |
@jeffshee An easy to do replacement here would be using |
@Rafostar
I'm not against the idea of introducing a Clapper dependency. If the player stuff can't fit in a simple GJS script, I would rather separate them from the extension part and package them into Flatpaks~ Users will have to install 2 separate components tho, which is... not too bad IMO. |
@jeffshee I can help you with this by doing a MR, so you won't have to reverse engineer how some parts in Clapper work 😄. Just let me know. I do work on some easy-to-use Clapper player API, its not ready yet, but since Clapper 0.5 the sink alone is installed and publicly available as first step. For now can be used with GStreamer provided Remember, that this is only my suggestion. I do not want to put a pressure/force you into this if you do not want to. |
That sounds great! I would appreciate it if you could help me out with Gstreamer stuff! 😆 About the Clapper player API that you mentioned, will that be a library like |
Something like |
Currently enabling this, the
gjs
process takes about 9-11% of my CPU.Any way to use hardware acceleration here?
The text was updated successfully, but these errors were encountered: