GStreamer on Meta Quest 3 with Unreal

Hello - I’m trying to use GStreamer inside of an Unreal app that is being deployed to a Meta Quest 3 headset. I am working off of this existing Unreal-GStreamer plugin which works well for Unreal apps deployed on Windows.

I have successfully built the GStreamer Android tutorials in Android Studio, and have loaded those APKs onto the Quest headset to verify that they work (they do). I have also been able to build my Unreal app with the static GStreamer libraries to the point where I can verify that gst_init is working on the headset when the app is loaded.

However, when the app tries to build a pipeline using gst_parse_launch with the config string “videotestsrc pattern=snow ! video/x-raw,width=(int)512,height=(int)512,format=(string)RGBA,framerate=(fraction)30/1 ! appsink name=sink” I am getting the error that gst_parse_launch failed and that it can’t find element videotestsrc.

Does this error mean that it can’t find the shared library file libgstreamer_android.so? Other than this shared library file, do any other GStreamer files needed to be copied to the headset alongside the APK? Forgive my lack of Android knowledge, but I’m unclear on why gst_parse_launch can’t find the videotestsrc element. I have copied libgstreamer_android.so onto the headset and it was built with all of the gstreamer plugins included using the GSTREAMER_PLUGINS section of the in the Android.mk file.

Any advice on what specific gstreamer files are needed to be deployed alongside the APK (built with Unreal) would be much appreciated!

2 Likes

In your app do you call GStreamer.init(context); after loading gstreamer_android?

See also this sample player app

videotestsrc is reported as not found possibly because the GStreamer library wasn’t initialized beforehand. If it was and you still get the error, check the logs by setting the env var GST_DEBUG=5 that might provide some clues.

I haven’t worked on Android recently, not sure I can help further :slight_smile:

Thanks for the reply @philn

With Unreal, it looks like all of the Java code is automatically generated by the build system, so while I don’t know if GStreamer.init(context) is called in Java, I am able to #include gst.h and use gst_init(&argc, &argv) in my C++ code and when I call gst_is_initialized() I get true.

I’ve actually made some progress and no longer get ‘videotestsrc not found’ and I believe that was due to Unreal’s build system not copying libgstreamer_android.so into the APK.

Now, however, I’m getting some lower level memory errors that I believe are due to libgstreamer_android.so depending on libc++_shared.so instead of static libc++ (which is what Unreal wants), so I’m working on rebuilding libgstreamer_android.so with libc++ static instead of shared.

We’ll see how that goes! Just changing APP_STL to c++_static in Application.mk doesn’t seem to be working for me, so I’d love the help if anyone has any advice.

Thanks!

Hi bsyzek,

Did you get it any progress on the topic?

Cause, I am looking for a similar solution to stream Unreal Engine content with alpha channel to an Oculus Quest3 app. So the Quests passthrough is not sent back and forth over the quest link

Hey man, I ran into the same problems lmao and found this post. Have you made progress? Would you like to team up? Ya know, with our powers combined…