Asynchronous Concepts: AVFoundationPlayer vs. ofGstVideoPlayer


Hi all,

with the new AVFoundationPlayer sequential loads of Movies work pretty well. Due to its asynchronous concept the load time is around 10ms-30ms on my not-so-new MBP. This means: flicker free loads in the background and switching the movie on-screen without a threaded video loading extension.

LoadMovie in the GStreamer Implementation is quite a lot slower, from 100ms up to 300ms. It could be also super fast, since gStreamer is also asynchronous. If there would be a possibility to change only the file uri for the play bin element without recreating the whole gStreamer stuff during sequential LoadMovie calls, the gStreamer implementation could possibly reach the same speed as the AVFoundationPlayer.

Is there a existing approach? An easy access to the pipeline? Can it be done with

GstElement 	* getGstElementByName(const string & name) const;

in ofGstVideoUtils? How could this function be accessed?



i’ve managed to implement this in master, the default is now much faster than before but you can also call:


which will make the load even faster by not waiting till the player gets to the paused state to return, the pixels won’t be initialized right away but that’s fine if you just want to draw the video or are careful to check that they are allocated. with that call i’m getting around 5-7ms on the load call


Wow - awesome! I’ll check it out. Meanwhile, I used the threadedVideo class for Linux but it would be more lightweight without, which could be possible now. As far as OSX and the AVFoundationPlayer is concerned, with the little modification posted here, loads are done immediately:



Hello @arturo, does this function still exist?


it’s now in ofVideoPlayer thorugh loadAsync