1
votes

does anybody know how to send a video data stream from one side written by java to another side written by flex and then display it? I just know that on flex one method is to use netstream class get the real-time video stream and bind with a videodisplay to display it. But which class I should use to send this video stream in java and which class I need to use in flex to receive this flow and pass it to the NetStream class?

Does anybody have any ideas about that?

Thanks!

1

1 Answers

0
votes

Check out Red5 - http://www.red5.org/

It's a free open source platform for streaming media to flash / flex. It's been around for years and quite mature.

Telling you how to implement it for your particular situation is out of scope of a Q&A format, but I can tell you from experience that red5 is an easy to implement solution relative to rolling your own or flash media server (which is pricey!)

More tutorials and examples here: http://trac.red5.org/wiki/Documentation

If you decide to write your own (why?) - check out Java Media Framework (JMF) - http://www.oracle.com/technetwork/java/javase/specdownload-136569.html

For android - you're going to want to take a look at :

android.hardware.Camera;
android.media.MediaRecorder;

then something along the lines of :

recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);    
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);   // might try MPEG_4_SP as well
recorder.start();

I specified in the above codecs that are in a format that is friendly to flash.