0

I am streaming live video from my camera on my android phone to my computer using the MediaRecorder class.

recorder.setCamera(mCamera);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);          
recorder.setOutputFile(uav_UDP_Client.pfd.getFileDescriptor());                     
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);

That's the basic idea. So I would like to show this stream in real time. My plan is to use FFMpeg to turn the latest frame into a .bmp and show the .bmp on my C# program every time there is a new frame.

The problem is there is no header until I stop the recording. So I can not use FFMpeg unless there is a header. I've looked at spydroid and using RTP but I do not want to use this method for various reasons.

Any ideas on how I can do this easily?

Ricky Casavecchia
  • 560
  • 3
  • 9
  • 28

1 Answers1

0

You can consider streaming a MPEG2 TS and playing it back on your screen or you can also stream H.264 data over RTP and use a client to decode and display the same.

In Android, there is a sample executable which performs RTP packetization of H.264 stream and streams it over the network. You can find more details about the MyTransmitter from this file, which could serve as a good reference to your solution.

Additional Information In Android 4.2.0 release onwards, there is a similar feature supported by the framework called Miracast or Wi-Fi Display which is standardized by Wi-Fi forum, which is a slightly complex use-case.

Ganesh
  • 5,880
  • 2
  • 36
  • 54