Videoplayer (skia) is stuttering

Hello,
if I use the videoplayer (skia) from Video.MediaFoundation in a little more complex sketch, the video is stuttering. The GStreamer Player is broken, I’m not even able to open the example patch, it just shows me an error log. So what can I do? CPU, GPU and storage run around 25% and 35%. Two VideoIns via decklink working fine.
The sketch is a videomixer (not ready until now).
Has anybody an idea to deal with that?
Thanks!
Matthias
videomixer.vl (299.3 KB)

Can you prepare the patch in a way so it also runs on a machine different than yours? In it’s current form it only throws exceptions and we can’t really see the issue you’re having.

However looking at your patch I see a lot of ToImage/FromImage conversion - why are those necessary? Especially when you already have an SKImage to begin with? Is the Crop node not working maybe? Could it be it only works with CPU based images (raster images) and fails to work for those which are GPU based (as the one from the video player) - maybe as an alternative try the Resize node and get rid of the ToImage/FromImage stuff. These are for sure performance killers.

I’d recommend a Stride based pipeline and use TextureFX nodes for image manipulation, so that everything is done on the GPU. Or is there a specific reason why you have to use skia?

Hello,
thanks for your request. The FromImage/ToImage stuff results from the fact, that the Crop-node is not working with the SKImage from the videoplayer (I opened another question in the forum for thhat issue). The removing of the FromImage/ToImage/Crop doesn’t change anything. I don’t know how to change the patch, so it runs on a different machine, because there’s nothing special in it. Maybe the exceptions a coming from the fact, that the videoplayer node does not get a proper Path on your machine.Please change it to a valid path of a videofile. I uploaded a version without FromImage/ToImage/Crop and without the Decklink-VideoIns. Maybe that helps.
videomixer-videoIn.vl (289.9 KB)

Thanks!
Matthias

Looks like the Elementa node is eating up all the precious ticks - something is changing all the time and Elementa thinks it needs to re-layout everything. Maybe get rid of those SetStyle nodes for a moment?

Hello,
→ Elias: I unpluged the SetStyle nodes and now the sketch’s working fine. So is it elemnta, which produces the trouble? Is there a way for me to use the style propertys however?
→ to tonfilm: I thougt that Skia is for 2D (elementa/ImGui is working with skia) and Stride for 3D. Is it not like that? is it better to work always with Stride?

Thanks!
Matthias

Hey! Which Elementa version are you using? I remember something regarding Styles eating lots of resources was fixed a while ago. Will check your patch tomo. Cheers!

Hey! I use vvvv gama 5.2, elementa is 2023.5.0
Matthias

Hey,
it’s really frustating, I did’nt change anything (the style property stuff is still unpluged) but today the videoplayer is stuttering again. The only thing that helps is to minimize the Mixerwindow (the elementa surface). But this is no solution for me. Is better to use the ImGui, or are similiar problems to exspect? Is there a general problem with the videoplayer and Skia, so it’s better to use Stride?
Matthias

Hey,
now I detect the difference tomorrow morning. The laptop was disconnected from the powersupply. Ok. That makes sense. Is element so resource-intensiv? I ve running the sketch on a HP Zbook 15 G3 with quadcore i7, Nvidia Quadro M2000, 32Gb Ram.
Matthias

Hey,

It looks like you’re using an old Elementa version (5.0.9). In a later version (5.0.13) there was a bug fix specifically about the LocalStyle node eating too much resources.

I would suggest updating to the very latest version of Elementa (5.1.2) and see if your issue persists.

Cheers

PS : also, be aware that Elementa widgets are fragmented, which implies that inputs that never change can be assigned to Create, thus saving resources.

Hey,
I updated elementa and now it works with the Locals styles. But it still needs much resources (stuttering if not on the powersupply). I’m a newbie to vvvv. Couls you explain me, what you mean with:

That would be great!
Thanks!

Matthias

You could check out chapter 24 of VL.ThePatchersGuide (Create & Update) for explanations on that, maybe that helps already?

1 Like

Great explanation! Thanks a lot for the tip!
Matthias