I'm developing one live streaming android application. The app will record video in the background using MediaRecorder and I'm able to store that to sd card. I was trying Wowza Media engine to stream this recorded video but the video is not transferring.
surfaceView = new SurfaceView(this);
LayoutParams layoutParams = new WindowManager.LayoutParams(1, 1,
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
PixelFormat.TRANSLUCENT);
layoutParams.gravity = Gravity.LEFT | Gravity.TOP;
windowManager.addView(surfaceView, layoutParams);
surfaceView.getHolder().addCallback(this);
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
int numberOfCameras = Camera.getNumberOfCameras();
for (int i = 0; i < numberOfCameras; i++) {
Camera.getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
camera = Camera.open(i);
}
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
// camera = Camera.open();
}
}
mediaRecorder = new MediaRecorder();
camera.unlock();
mediaRecorder.setPreviewDisplay(surfaceHolder.getSurface());
mediaRecorder.setCamera(camera);
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mediaRecorder.setProfile(CamcorderProfile
.get(CamcorderProfile.QUALITY_HIGH));
mediaRecorder.setOutputFile(Environment.getExternalStorageDirectory()
+ "/video_recording.mp4");
mediaRecorder.setOrientationHint(270);
try {
mediaRecorder.prepare();
} catch (Exception e) {
}
mediaRecorder.start();
}
When i tried to stream this video using RtspClient mClient i got this error. Please help me to stream a video using Wowza that is been recording using the MediaRecoder. Here is a example program with Wowza http://www.androidhive.info/2014/06/android-streaming-live-camera-video-to-web-page/