# How to build gstreamer for Android?

**URL:** https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815
**Category:** General Discussion
**Created:** [January 12, 2024, 2:41pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815 "2024-01-12T14:41:48Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 12, 2024, 2:41pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/1 "2024-01-12T14:41:49Z")

</div>

I need to build gstreamer for android as a single dynamic lib with some specific libs.

I found some info

> <https://gist.github.com/wonchulee/8814915fe7f34fba6bb0>

this seems to build the whole thing.

Do I have to build cerbero or use cross build? Any more info for the build of gstreamer for Android? It is a bit hard to find related info online.

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 12, 2024, 2:51pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/2 "2024-01-12T14:51:57Z")

</div>

It seems that cerbero is the right choice.  
[https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c](https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c)

---

<div class="post-metadata">

### Author: ![ndufresne](https://discourse.gstreamer.org/user_avatar/discourse.gstreamer.org/ndufresne/32/10_2.png) [@ndufresne](https://discourse.gstreamer.org/u/ndufresne)
#### Post date: [January 12, 2024, 8:31pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/3 "2024-01-12T20:31:15Z")

</div>

Correct, use cerbero, and follow the general instructions, be attentive to that section:

[https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c#cross-compilation](https://gstreamer.freedesktop.org/documentation/installing/building-from-source-using-cerbero.html?gi-language=c#cross-compilation)

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 12, 2024, 9:37pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/4 "2024-01-12T21:37:25Z")

</div>

Thanks, Nicolas. I am trying to build gstreamer with some specific libs and plugins for Android from the source. My command is as follows:

```auto
meson setup --cross-file android_arm64_api.txt \
            build-gst-full \
            --buildtype=release \
            --strip \
            --default-library=static \
            --wrap-mode=forcefallback \
            --prefix=path/thirdparties/gstreamer \
            -Dauto_features=disabled \
            -Dgst-full-libraries=app,video,player -Dbase=enabled -Dgood=enabled -Dbad=enabled -Dqt5=enabled \
.....

```

to build a single dynamic lib.

I have managed to add quite a few libs and plugins successfully. How to enable  
libs gstcodesparsers-1.0, gstandroidmedia and gstopensles? I am not familiar with meson.

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 15, 2024, 2:49pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/5 "2024-01-15T14:49:48Z")

</div>

I also need to add orc and libav. I added them as follows:

```auto
meson setup --cross-file android_arm64_api.txt \
            build-gst-full \
            --buildtype=release \
            --strip \
            --default-library=static \
            --wrap-mode=forcefallback \
            --prefix=path/thirdparties/gstreamer \
            -Dauto_features=disabled \
            -Dgst-full-libraries=app,video,player -Dbase=enabled -Dgood=enabled -Dbad=enabled -Dqt5=enabled \ 
            -Dorc=enabled -Dlibav=enabled \

```

These two libs are built. But they are not added to the single dynamic lib. Why?

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 15, 2024, 9:57pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/7 "2024-01-15T21:57:15Z")

</div>

Added  
-Dgst-plugins-bad:opensles=enabled  
and solved the issue of gstopensles

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 16, 2024, 3:10pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/8 "2024-01-16T15:10:04Z")

</div>

trying to add lib gstandroidmedia which needs opengl. But meson set-up shows GL/gl.h can not be found. How to enable opengl?

I added the following options to the meson set-up  
-Dgst-plugins-base:gl\_api=opengl   
-Dgst-plugins-base:gl=enabled   
-Dgst-plugins-base:gl\_platform=egl   
-Dgst-plugins-base:gl\_winsys=android   
-Dgst-plugins-base:gl-graphene=enabled   
-Dgst-plugins-base:gl-jpeg=enabled   
-Dgst-plugins-base:gl-png=enabled \

Got the following messages:  
gst-plugins-base| Dependency (anonymous) from subproject subprojects/gl-headers found: YES 2019.1.0  
gst-plugins-base| Run-time dependency opengl found: NO (tried pkgconfig)  
gst-plugins-base| Run-time dependency gl found: NO (tried pkgconfig)  
gst-plugins-base| Library GL found: NO

gst-plugins-base| Has header “GL/gl.h” : NO

subprojects/gst-plugins-base/gst-libs/gst/gl/meson.build:349:6: ERROR: Problem encountered: Could not find requested OpenGL library

I looked through gstreamer source code and could not find GL/gl.h

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 16, 2024, 3:54pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/9 "2024-01-16T15:54:24Z")

</div>

replacing -Dgst-plugins-base:gl\_api=opengl with  
-Dgst-plugins-bad:gl=enabled  
solves the problem

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 16, 2024, 4:44pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/10 "2024-01-16T16:44:21Z")

</div>

last puzzle:  
libav is needed as well. Added -Dlibav=enabled. libav seems to be built into the single dynamic lib. If I remove static libs of libav in my app, video streaming disappears although there are no build errors.

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 17, 2024, 12:16am UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/11 "2024-01-17T00:16:56Z")

</div>

Anyone knows what could affect libav build?

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 17, 2024, 10:24pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/12 "2024-01-17T22:24:50Z")

</div>

video codecs are not available. Need to figure out which option is required to build codecs.

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [January 17, 2024, 10:41pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/13 "2024-01-17T22:41:45Z")

</div>

-DFFmpeg:h264\_decoder=enabled solved the problem.

---

<div class="post-metadata">

### Author: ![lovro](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lovro](https://discourse.gstreamer.org/u/lovro)
#### Post date: [July 9, 2025, 11:44am UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/14 "2025-07-09T11:44:09Z")

</div>

Hi, guys. Can someone please explane it to me.  
I want to build GStreamer Android app, I miss some plugins, okay.

When I build them with Cerbero (or Msson, I don’t know which one), static od dynamic? What to do with them. Copy and paste it where?

Thank you

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [July 9, 2025, 12:21pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/15 "2025-07-09T12:21:22Z")

</div>

If your app is not commercial, static build of gstreamer is good enough. Simply download the static build and use it.

I built gstreamer libs and plugins my app needs into one single dynamic lib. I can not use static build of gstreamer in my app.

---

<div class="post-metadata">

### Author: ![lovro](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lovro](https://discourse.gstreamer.org/u/lovro)
#### Post date: [July 9, 2025, 12:35pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/16 "2025-07-09T12:35:04Z")

</div>

Thanks. So I don’t have to use Cerberus and build anything? I just have to download the Android binaries from the official GStreamer site and use them (I don’t have to link anything?)?

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [July 9, 2025, 12:39pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/17 "2025-07-09T12:39:50Z")

</div>

Yes. You can check out open source project QGroundcontrol to find out how to add static build of gstreamer to a C++ project for Android.

---

<div class="post-metadata">

### Author: ![lovro](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@lovro](https://discourse.gstreamer.org/u/lovro)
#### Post date: [July 9, 2025, 12:44pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/18 "2025-07-09T12:44:02Z")

</div>

Thank you. But I still got error like:  
gst/parse/grammar.y:665:gst\_parse\_element\_make no element “multifilesrc”  
gst/parse/grammar.y:665:gst\_parse\_element\_make no element “jpegdec”  
gst/parse/grammar.y:665:gst\_parse\_element\_make no element “x264enc”  
gst/parse/grammar.y:665:gst\_parse\_element\_make no element “mp4mux”

but in arm64/lib I have all of them

---

<div class="post-metadata">

### Author: ![Joe](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@Joe](https://discourse.gstreamer.org/u/Joe)
#### Post date: [July 9, 2025, 12:57pm UTC](https://discourse.gstreamer.org/t/how-to-build-gstreamer-for-android/815/19 "2025-07-09T12:57:39Z")

</div>

> [@lovro](#):
>
> gst/parse/grammar.y:665:gst\_parse\_element\_make no element “multifilesrc”  
> gst/parse/grammar.y:665:gst\_parse\_element\_make no element “jpegdec”  
> gst/parse/grammar.y:665:gst\_parse\_element\_make no element “x264enc”  
> gst/parse/grammar.y:665:gst\_parse\_element\_make no element “mp4mux”

- **multifilesrc** : Part of the multifile plugin in gst-plugins-good.
- **jpegdec** : Part of the jpeg plugin in gst-plugins-good.
- **x264enc** : Part of the x264 plugin in gst-plugins-ugly.
- **mp4mux** : Part of the mp4 plugin in gst-plugins-good.

Make sure these plugins are added into your project. Find out where and how static gstreamer libs and plugins are added in QGroundControl.
