ofGstVideoUtils android


is ofGstVideoUtils available for of on android ?


it’s not officially supported but there’s an android version of gstreamer so it should be possible to use it, never tried it though.

could you just point me in the right direction on how to use it ? then I can go an experiment an report back if I get somewhere.



I’ve seen it work but haven’t myself. However it required messing up with OF’s makefiles a lot. It might be better to use this approach and OF as a shared lib. Then use Gstreamer’s android libs, either from freedesktop or the gstreamer-sdk. This way you can even add gstreamer to an empty android project prior to any other lib, and then add OF, so that you can check it actually works.

Other than that you need to remove this definition and you should be good to go, it might not be as simple as it sounds though :smiley:

I hope I’m pointing you in the right direction, at least that’s what I’d do after seeing the first makefile alchemy approach.

Good luck!!

Hi all!

First of all, thank you all for the great contributions on this forum. I’m a bit late in the game joining in the conversation but I’ve come across project-saving discussions here a countless amount of times! :slight_smile:

I’m waking this thread up after a while, because I’ve just had to do exactly that: get oF GST utilities to work on Android, so as to have a video player taking HTTP video URLs as input on an Android tablet.

Following your advices, we managed to get it to compile and link nicely with oF 0.11.0, with Android Studio 4.1.2 and Android NDK r15c, for arm64-v8a. My approach has been to download this version of Gstreamer, adding those dependencies to @arturo’s addon_config.mk file and remove the definitions as suggested by @chuckleplant. The config file is very dirty at the moment, but I’d be glad to share it.

This brings me to my question. I’m using the ofVideoPlayer container with custom GST player:

video.setPlayer( ofPtr<ofGstVideoPlayer>( new ofGstVideoPlayer ) );
video.load( "http://server.ip.address/video.mp4" );

This works smoothly on MacOS and Win10 but the video does not show up on Android. I traced it back to the fact that the pipeline doesn’t seem to initialise properly. In ofGstUtils::startPipeline(), it returns the GST_STATE_CHANGE_FAILURE to the auto ret = gst_element_set_state(GST_ELEMENT(gstPipeline), GST_STATE_PAUSED) call that is part of the initialisation (right after setting up the sink callback).

I know Gstreamer is a bit tricky with how it handles library paths and so on but I have no idea how this works on Android (second Android project for me actually). If anybody has an idea on this, I’d be glad. I’d be happy to make these searches and tweaks part of ofxGstreamer, if anybody is interested.