- Download the entire gstreamer android studio tutorial directory (https://gitlab.freedesktop.org/gstreamer/gst-docs/)
2)Open Android Studio -> Open an existing Android Studio Project
- Open the entire android tutorial directory
examples/tutorials/androidas a project
4)Once the project is open change the view on the left side of the screen to
Right click near local.properties file -> New -> File
Create a new file called
In the new
gradle.propertiesfile copy and paste the below code.
# gstAndroidRoot can be set to point to the unpacked GStreamer android top-level directory # containing each architecture in subdirectories, or else set the GSTREAMER_ROOT_ANDROID # environment variable to that location gstAndroidRoot=/gstreamer_android_binaries
NOTE Change the gstAndroidRoot variable to your file path where you downloaded the gstreamer binaries and unzipped them. Gstreamer can be downloaded from here for Android (https://gstreamer.freedesktop.org/data/pkg/android/)
- Now we need to set up NDK directory. Make sure you download and have NDK enabled under SDK tools.
9)This will download the latest NDK version. However gstreamer currently will not build with the latest NDK. We need to download NDK Revision 18b (https://developer.android.com/ndk/downloads/older_releases)
If you do not use NDK version 18 you will likely get an error
Android NDK: Assertion failure: SYSROOT_LINK is not defined . Stop. Open File
Unzip the downloaded NDK 18b directory.
Take the unzipped
android-ndk-r18bdirectory and move it to where the ndk folder is under
You should now have two folders within
20.0.5594570 (or latest version)and
In android studio go to File -> project Structure
Under Android NDK location point to the NDK 18 directory. Example:
Connect a phone with USB debugging and run!
If you get an error on the phone stating it is for an older version of android. Go back to Android Studio and switch to
Android Viewon the left side of the screen. Under
Gradle Scriptsselect the
build.gradlefor the appropriate tutorial. Change the
minSDKVersion 15, and