How can I get gstreamer-plugins into it's Android SDK? - android

I need gstreamer for decoding H.264 video on rtp, so I used the SDK from gstreamer.com. But I found that something I need is not included, such as 264depay, x264dec, etc.. I found gst-plugins on http://cgit.freedesktop.org/gstreamer/gst-plugins-good/, I think I need to compile it in Android form, and it has Android.mk inside. What should I do to deal with it? Tried execute ndk-build, but failed.
Many thanks.

Related

Using FFMPEG library for video compression on Android

I am trying to use FFMPEG library for Video compression on Android.
I've compiled the library using : http://bambuser.com/opensource and https://www.quora.com/What-are-the-steps-for-integrating-FFMPEG-on-Android
Now next step is NDK build of this. But I am not sure what all will go as LOCAL_SRC_FILES, LOCAL_LDLIBS and LOCAL_C_INCLUDES.
Apart from that what function should be called for compression in this library.
Please suggest.
For ffmpeg use on Android (or other platforms) there are a number of common approachs you can take:
invoke the command line from your program via EXEC command (has some limitations and drawbacks)
use a wrapper around the ffmpeg command line C program
Directly use the ffmpeg libraries, or more accurately the libraries that ffmpeg uses
The wrapper approach may be the easiest is you simply want to get the functionality working quickly.
There are several fairly well used wrappers available on GitHub - the ones below are particularly well featured and documented (note, I have not used these as they were not so mature when I was looking at this previously, but if I was doing something like this again now I would definitely build on one of these):
http://writingminds.github.io/ffmpeg-android-java/
https://github.com/guardianproject/android-ffmpeg
Using one of the well supported and used libraries will take care of some common issues that you might otherwise encounter - having to load different binaries for different processor types, and some tricky issues with native library reloading to avoid crashes on subsequent invocations of the wrapper.
Because this approach uses the standard ffmpeg cmd line syntax for commands it also means you should be able to search and find help easily on multiple different operations (as anyone using ffmpeg in 'normal' model will use the same syntax for the ffmpeg command itself).

Mix two audio files using ffmpeg on android platform

I am trying to mix two sound files(1. a background music 2.a recording file or a mp3 file) into a single one in android platform.
I setup the Android NDK platform for my project and done with compiling the ffmpeg library and generated the required SO file, now i want to use the amerge function( http://ffmpeg.org/ffmpeg-filters.html#amerge )in android but i don't know how to implement this command in android,I am having not much idea on Android NDK level coding. So any help, any idea will be appreciated.
Note: If you require more info to answer or any doubt in understanding this question feel free to ask, i'll be happy to share more info.
If you are not familiar with FFMPEG, you can compile a binary 'ffmpeg' and use standard command line by Runtime.getRuntime().exec("...");

How can I make 3gp video with mp3 audio file and images?

I am trying to create a 3gp video file by combining an mp3 audio clip and an image for my android application. That is:
mp3 + image = 3gp video clip.
I did so much research on this but found that help available was limited.
Please let me know how to do this.
If you are looking to do that outside of your application then check out this post which gives ffmpeg command that can be used to achieve the same.
Also ffmpeg can also be compiled for android and used using the JNI as discussed in this post.
copying the best answer for quick reference:
Here are the steps I went through in getting ffmpeg to work on Android:
Build static libraries of ffmpeg for Android. This was achieved by
building olvaffe's ffmpeg android port (libffmpeg) using the Android
Build System. Simply place the sources under /external and make
away. You'll need to extract bionic(libc) and zlib(libz) from the
Android build as well, as ffmpeg libraries depend on them.
Create a dynamic library wrapping ffmpeg functionality using the
Android NDK. There's a lot of documentation out there on how to work with the
NDK. Basically you'll need to write some C/C++ code to export the
functionality you need out of ffmpeg into a library java can
interact with through JNI. The NDK allows you to easily link against
the static libraries you've generated in step 1, just add a line
similar to this to Android.mk: LOCAL_STATIC_LIBRARIES := libavcodec
libavformat libavutil libc libz
Use the ffmpeg-wrapping dynamic library from your java sources. There's enough documentation on JNI out there, you should be fine.
Regarding using ffmpeg for playback, there are many examples (the ffmpeg binary itself is a good example), here's a basic tutorial. The best documentation can be found in the headers.
The process is called transcoding. Pointers:
convert avi to 3gp using ffmpeg
FFMPEG on Android
Compile a port of ffmpeg to android. You'll get an ffmpeg executable file, put in your app. Setup you app to extract it in its data directory and mark it as executable. Then use it with ffmpeg command line options.
Build a wrapper JNI class, if you need to call it from java code only.

How can I get Vorbis libraries on Android?

OK, i've spent most of the day trying to do this, and I figure I've got to be missing something fairly obvious.
Vorbis files are apparently natively supported on the Android SDK. Is there any way to access these libraries as a developer.
Situation: I've got a project that uses the libvorbis and libogg libraries, to load an ogg file. The whole thing compiles and works fine on OSX, linux, iOS etc. and i was trying to port it to android.
Using the NDK to compile the project, i get the error:
fatal error: vorbis/codec.h: No such file or directory
compilation terminated.
(I assume it would carry on to say that it can't find vorbisfile.h)
Question 1: Can access the vorbis API in C on Android? Or indeed, is there any Vorbis API?
Without too much effort, i stumbled across Tremor and Tremolo - ARM vorbis libraries, but I can't find any information on how to get them to compile using the Android SDK.
Question 2: Can someone offer any help with this?
Let me know if i can provide any other information to help.
You might look at android/ffmpeg/x264 project as an example. x264 is not ogg/vorbis, but it is a clear example of linking ffmpeg with adjunct libs in android build and link scenario.
Note: this will take quite a bit of time to work thru.
If you understand the example of building with x264, then you should be able to swap in obb/vorbis libs in place of x264 and get it all to link on an android build.
This assumes you are good with the NDK and cross toolchains and with git projects and sub-modules (x264 , ogg, vorbis)
maybe you can use the vorbis-java-1.0.0-beta of Xiph.org, this is a java package, you can port it to Android.

How do i include <bluetooth/bluetooth.h> for NDK toolchain's gcc

first of all, i got into a problem last time when trying to compile a c program to linux- arm architecture, for using it in an android app later. I succeeded in doing so, and i'll write later a post on how to use the NDK standalone toolchain.
Now that i've finally got that working, I'm trying to compile a .c file, which has a line "include bluetooth/bluetooth.h" in it. When I try to compile the file, i get a: "no such file or directory" error on it. My makefile includes the word "-libbluetooth".
The standart NDK gcc library does'nt have a bluetooth support, so i've downloaded "libbluetooth.so" from my device, which is what i needed to make it work, according to the brief research on the subject over the internet. I still get the same error.
I'll be glad to know if anyone has encountered the same problem.
thank u
Dekel
You need the bluetooth library to link your program; but to compile it, you need the appropriate headers. libbluetooth.so is not part of Android official API, but luckily you can find it sources and the include files that declare its public (but unofficial) API, if you download the AOSP source tree, according to Google's instructions. Actually, you are interested in a small part of the tree: ./external/bluetooth/bluez/lib. There you will find the bluetooth/bluetooth.h include file. In your Android.mk, you will have a line similar to:
LOCAL_C_INCLUDES += $(AOSP_ROOT)/external/bluetooth/bluez/lib

Categories

Resources