I’m working on a project where I need to display videos with gapless playback triggered over the net. Whereas on OSX this can be done easily with AVFoundation and the nice work of @armadillu (http://github.com/armadillu/ofxThreadedVideoPlayer)
I would really like to get the same thing running under linux.I therefore made an application using OF only as the build system, displaying the videos in a GTK+ Window. Gstreamer 1.x is multithreaded, so parallel loading of videos works well there.
My problem is, that the OSX concept and the Linux Version are two complete different approaches.
The Question now:
- What is the fastest, most accelerated way of showing videos under Linux in OpenFrameworks without changing the whole core of OF? OpenGL Textures are slow on some older machines, i.e. Apple TVs (1st gen) with Ubuntu installed. That’s why I’m using GTK+ to show the gStreamer Output directly.
- Are there alternatives in OF on Linux to display Videos (i.e. add ons)?
Thanks for any ideas,
Fastest way would be to get one of the hardware accelerated APIs working with OF. You might need to sacrifice downloading pixels to a texture in order to get the right speed. Either VA-API or VDPAU is probably what you’d need. I’ve never tried this, it is probably non-trivial, although setting up the right GStreamer pipeline might be the easiest. If you get anything working please share. Otherwise, if you want an easier approach, maybe scripting vlc or one of the other media players might get you what you want, although that would involve multiple apps.
i’ve been looking into this and it won’t be possible until gstreamer 1.4 becomes the standard, it’s already there in arch linux and will be the default in ubuntu 14.10. i’ll look into it once it’s in ubuntu. by now the fastest we have is drawing yuv directly without color conversion: https://github.com/openframeworks/openFrameworks/pull/2190 which can really make a big difference.
btw, http://github.com/armadillu/ofxThreadedVideoPlayer latest branch is not really threaded anymore, and it’s too messy for general consumption. Hopefully I’ll clean it up soon.
Unless you care about the time it takes to load/unload a video, you are better off using ofxAVFVideoPlayer directly
gStreamer 1.4 sounds indeed very promising.
In my case, I’ve implemented a player based on gStreamer and multiple pipelines to achieve gapless playback. To make the playback as fast as possible i use gtk in openframeworks which is not cross-platform.
I’ll try the same thing with the 1.4 openGL sink and push the texture back to OF. Like this I can work around GTK.