private boolean prepareMediaRecorder(){
myCamera = getCameraInstance();
// set the orientation here to enable portrait recording.
setCameraDisplayOrientation(this,0,myCamera);
mediaRecorder = new MediaRecorder();
myCamera.unlock();
mediaRecorder.setCamera(myCamera);
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
String pathh=Environment.getExternalStorageDirectory().getPath();
Toast.makeText(getApplicationContext(), "Path is "+pathh,Toast.LENGTH_LONG).show();
mediaRecorder.setOutputFile("/sdcard/myvideo1.mp4");
//mediaRecorder.setOutputFile("/storage/sdcard0/myvideo1.mp4");
mediaRecorder.setMaxDuration(60000); // Set max duration 60 sec.
mediaRecorder.setMaxFileSize(50000000); // Set max file size 50Mb
mediaRecorder.setPreviewDisplay(myCameraSurfaceView.getHolder().getSurface());
mediaRecorder.setOrientationHint(MainActivity.orientation);
try {
mediaRecorder.prepare();
} catch (IllegalStateException e) {
releaseMediaRecorder();
return false;
} catch (IOException e) {
releaseMediaRecorder();
return false;
}
return true;
}
My task is to capture video using surface view and send that to server. I found 1st solution to capture video in surface and save it in memory using some stack overflow link. One is below.
Switch To Front Camera and Back Camera Android SurfaceView
At first the app starts and worked perfectly saved the video also. Then I deleted the video and then tried video was not saving in memory. I tried with renaming the file also not worked.
"lrwxrwxrwx" what is this code value mean in android. I find this in DDMS