I'm having trouble too and it seems to revolve around the prepare()
when it is trying to load up the file location.  I get a
FileNotFoundException during prepare().  The exception says it can't
find /external/video/media/5 which is the URI path.  I'm guessing it
wants a more physical path but even hard coding a path and giving a
filename results in another FileNotFoundException for that path /
sdcard/video/file.3gp.

I'm guessing if you look through your log you will see a warning with
the same FileNotFoundException.

On May 29, 5:31 am, zeeshan <[email protected]> wrote:
> is anybody come across the same problem or anyone have a working video
> capture example.
>
> your help is appreciated
>
> waiting for the help
>
> On May 29, 9:17 am, zeeshan <[email protected]> wrote:
>
> > Activity just close at recorder.prepare();
> > dont see any exception
>
> > On May 28, 5:30 pm, Marco Nelissen <[email protected]> wrote:
>
> > > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to