Forum

AsyncLoop with MediaFoundation VideoPlayer

Hi out there,

I have a mediafoundation VideoPlayer running in a AsyncLoop Region. but still, if I load new videofiles the Framerate of vvvv goes down.
Am I doing something wrong?

To my understanding all the video decoding is already done in a separate thread by MediaFoundation itself, so there should be no need to put it into an async region. You could also run into threading issues there, so I’d strongly advice against it.

Seemless playback of multiple video files is sadly not possible with one video player. We tried a few things internally but sadly the engine itself simply lacks support for that. However you should be able to use multiple video players - one per file you wanna play.

Attached is a little example patch. It keeps a video player per file, with an index you select the one to play.

HowTo Play multiple video files with Skia.vl (32.1 KB)

Thanks for your help. Now I have 176 4k Videos. Will that be to many, if I have a videoPlayer running for each video? May be a cache region in the foreach loop, which acitvates only the playing video?

I don’t think a Cache will safe much - 175 out your 176 players should be in pause and therefor not doing anything really.

So does the proposed solution work you?

Gamma freazes, if I connect 176 pathes. Even when all players are set to not playing. Same with half of them

using only one player works for now. I fade out the texture for changing the video, but I have framedrops while loading the video, which is bad for the overlaying animation

This seems to work for me (only tried with smallish videos):

For some reason creating the player-spread inside a Cache region didn’t work and caused exceptions.

It’s only a fast & hacky POC and would need some more work.
Added a rather stupid method to VideoPlayer.cs.

VL.Video.MediaFoundation.1.0.5.7z (1.0 MB)

Download, extract and open SpreadedPlayer.vl

Thanks for the patch. It crashes, when I load a directory

Does it throw an exception? If so what does it say.
Don’t know but maybe try removing other instances of VL.Mediafoundation from your nuget folder.
Have you tried lowering the count (using the getspread)?
If it works for a smaller number, slowly increase it and check vvvv’s memory usage in the taskmanager. Maybe you “just” don’t have enough RAM to load all the videos at once.