Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: MediaRecorder @ Native code

Playing with the MediaRecorder Java code I have found the MediaRecorder class to be quite limited, there is no way to control the media before it is encoded/compressed, and, there is no way to control the result, file, socket, transport:MPEG2-TS, MP4 'moof' position, ...

With windows enviroment DirectShow/MediaFoundation provide fine access and control of the media pipeline.

I wonder, is there any LowLevel NDK API for the MediaRecorder that enable some of the above mentioned functionality?

I would really like to avoid implementing a native C++ MediaRecorder my-self...

Any Help will B appreciated.

~Nadav

like image 257
NadavRub Avatar asked Sep 11 '11 14:09

NadavRub


People also ask

What is Android MediaRecorder?

android.media.MediaRecorder. Used to record audio and video. The recording control is based on a simple state machine (see below).

How do I use MediaRecorder API?

To start with the MediaRecorder API, you need a MediaStream. You can either get one from a <video> or <audio> element or by calling getUserMedia to capture the user's camera and microphone. Once you have a stream you can initialise the MediaRecorder with it and you are ready to record.


1 Answers

Check out Android's openSL es. Look at this example app:

http://codesearch.google.com/#CRBM04-7BoA/ndk/platforms/android-9/samples/native-audio/

like image 167
hunterp Avatar answered Sep 27 '22 17:09

hunterp