What do you mean by "no luck"? Does something crash? Do you get an exception? Does it create the recording file? Is there any data in it?
On Thu, May 28, 2009 at 9:25 AM, zeeshan <[email protected]> wrote: > > Hi dear, > > i am trying to capture video since a week but still no luck. > can anybody help me to figure out what i am missing in the code below: > > final MediaRecorder recorder = new MediaRecorder(); > ContentValues values = new > ContentValues(3); > > > values.put(MediaStore.MediaColumns.TITLE, > "Recorded video"); > values.put > (MediaStore.MediaColumns.DATE_ADDED, System.currentTimeMillis()); > // values.put > (MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType()); > > Uri newUri = getContentResolver().insert > (Media.EXTERNAL_CONTENT_URI, values); > //String path = getContentResolver() > getDataFilePath(newUri); > //final String filePath=newUri.toString > (); > > > final String > filePath="/sdcard/lion-seul.3gp"; > recorder.setAudioSource > (MediaRecorder.AudioSource.MIC); > recorder.setVideoSource > (MediaRecorder.VideoSource.CAMERA); > recorder.setOutputFormat > (MediaRecorder.OutputFormat.THREE_GPP); > recorder.setAudioEncoder > (MediaRecorder.AudioEncoder.AMR_NB); > > //recorder.setVideoSize(176, 144); > // QCIF > > //recorder.setOutputFormat > (MediaRecorder.OutputFormat.MPEG_4); > recorder.setVideoEncoder > (MediaRecorder.VideoEncoder.MPEG_4_SP); > recorder.setOutputFile(filePath); > // > CameraView.thisCameraView.setRequestedOrientation > > //(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); > SurfaceHolder holder; > > videosurface.setVisibility(View.VISIBLE); > holder = videosurface.getHolder(); > > > recorder.setPreviewDisplay(holder.getSurface > ()); > > try { > > recorder.prepare(); > } catch > (IllegalStateException e) { > // > TODO Auto-generated catch block > > e.printStackTrace(); > } catch > (IOException e) { > // > TODO Auto-generated catch block > > e.printStackTrace(); > } > catch > (Exception e) { > // > TODO Auto-generated catch block > > e.printStackTrace(); > } > recorder.start(); > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

