I am developing an Android hardware accelerated video decoder for decoding real time H264 Annex B stream. After a bit research, it seems I need to get my hands dirty to do this. I came over several keywords like OMXCodec
, Android's OS stagefright
and ffmpeg's stagefright
, MediaCodec
API, GStreamer
. Also I came to know that - there is no way for hardware agnostic implementation to support all vendor's hardware. At this stage, all these are making too much confusing to me as I didn't find any straight-forward resources to go forward any one of them. My requirements are -
I tried to get some hints from Android's stagefright's AwesomePlayer.cpp, SimplePlayer.cpp and ffmpeg stagefright's command line executables code. But nothing is making much sense to me to choose and proceed any of this stuff.
How can I approach? Is there any helpful resources to get clear intuition?
Thanks in advance!
I have implemented such a system recently using the MediaCodec API. Unfortunately this API is not exposed in the NDK so it is only accessible from the Java layer.
The best resource I found was this set of guides:
http://bigflake.com/mediacodec/
Since you have a hard requirement to implement this in the NDK then I guess you need to write a thin Java library which does the interaction with the MediaCodec API and then call through to it via the JNI from your C++ layer.
If you go down the FFMPEG route be mindful of its license, it is quite restrictive for distributed software.
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With