Android MediaRecorder streaming

Is it possible to execute a โ€œstreamโ€ of MediaRecorder result?

The only method I can see is mediaRecorder.setOutputFile, which receives a FileDescriptor. Therefore, I can write the result to a file or send via socket to the recipient.

I tried the second solution, but the video result is corrupted because it is not โ€œsearchableโ€ in the stream.

The idea is to use the camera of an Android device to publish the result to Red5.

+8
android stream mediarecorder red5
source share
2 answers

Yes, perhaps there are many examples for this. You can check the sipdroid example. Or even an Android IP camera , which is much simpler.

Luck

+2
source share

Yes it is possible. Here is sample code with FileDescriptor and socket:

socket = new Scoket("192.168.1.234",8888); ParcelFileDescriptor fileDescriptor = PercelFileDescriptor.fromSocket(socket); mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mRecorder.setOutputFile(fileDescriptor.getFileDescriptor); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); try { mRecorder.prepare(); } catch (IOException e) { Log.e(LOG_TAG, "prepare() failed"); } mRecorder.start(); 
+1
source share

All Articles