[android-developers] Re: media recorder error on start

2009-11-28 Thread wtzytrliil
bump.

On Nov 18, 4:39 pm, android_dev pankaj.i...@gmail.com wrote:
 when i add video source and video encoder, it gives error in
 recoreder.prepare() (prepare failed) while the same code is working
 only for audio.
 i am not finding what i am doing wrong.Please help

 setContentView(R.layout.camera);
 preview=(SurfaceView)findViewById(R.id.surface);
 previewHolder=preview.getHolder();
 previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
 recorder = newMediaRecorder();
 String url = /sdcard/dcim/test.3gp;
 camera = Camera.open();
 Camera.Parameters parameters = camera.getParameters();
 parameters.setPreviewSize(352, 288);
 parameters.set(orientation, portrait);
 camera.setParameters(parameters);
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setOutputFile(url);
 recorder.setVideoFrameRate(15);
 recorder.setVideoSize(480, 320);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
 recorder.prepare();
 recorder.start();
 Thread.sleep(10);
 recorder.stop();
 recorder.release();



 } catch (Exception e) {
 e.getMessage();
 }

 On Nov 18, 9:11 pm, Roman ( T-Mobile USA) roman.baumgaert...@t-

 mobile.com wrote:
  It might be helpful to attach your code.

  Have you called the prepare() method before starting the recording?

  --
  Roman Baumgaertner
  Sr. SW Engineer-OSDC
  ·T· · ·Mobile· stick together
  The views, opinions and statements in this email are those of the
  author solely in their individual capacity, and do not necessarily
  represent those of T-Mobile USA, Inc.

  On Nov 17, 5:55 am,android_devpankaj.i...@gmail.com wrote:

   Hi
   i am trying to record video and upload to web server. i created a temp
   file  but when i try to startrecorder.start(), it gives me
   java.lang.RuntimeException: start failed. i tried debugging it but i
   am not getting it working. can someone please give me sample code to
   record video and save. i am really stuck with this error

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: media recorder error on start

2009-11-18 Thread Roman ( T-Mobile USA)
It might be helpful to attach your code.

Have you called the prepare() method before starting the recording?

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Nov 17, 5:55 am, android_dev pankaj.i...@gmail.com wrote:
 Hi
 i am trying to record video and upload to web server. i created a temp
 file  but when i try to start recorder.start(), it gives me
 java.lang.RuntimeException: start failed. i tried debugging it but i
 am not getting it working. can someone please give me sample code to
 record video and save. i am really stuck with this error

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: media recorder error on start

2009-11-18 Thread android_dev
when i add video source and video encoder, it gives error in
recoreder.prepare while the same code is working for audio.
i am not finding what i am doing wrong.

setContentView(R.layout.camera);
preview=(SurfaceView)findViewById(R.id.surface);
previewHolder=preview.getHolder();
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
recorder = new MediaRecorder();
String url = /sdcard/dcim/test/3gp;
camera = Camera.open();
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(352, 288);
parameters.set(orientation, portrait);
camera.setParameters(parameters);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setOutputFile(url);
recorder.setVideoFrameRate(15);
recorder.setVideoSize(480, 320);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.prepare();
recorder.start();
Thread.sleep(10);
recorder.stop();
recorder.release();

} catch (Exception e) {
e.getMessage();
}



On Nov 18, 9:11 pm, Roman ( T-Mobile USA) roman.baumgaert...@t-
mobile.com wrote:
 It might be helpful to attach your code.

 Have you called the prepare() method before starting the recording?

 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.

 On Nov 17, 5:55 am,android_devpankaj.i...@gmail.com wrote:

  Hi
  i am trying to record video and upload to web server. i created a temp
  file  but when i try to startrecorder.start(), it gives me
  java.lang.RuntimeException: start failed. i tried debugging it but i
  am not getting it working. can someone please give me sample code to
  record video and save. i am really stuck with this error

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: media recorder error on start

2009-11-18 Thread android_dev
when i add video source and video encoder, it gives error in
recoreder.prepare() (prepare failed) while the same code is working
only for audio.
i am not finding what i am doing wrong.Please help

setContentView(R.layout.camera);
preview=(SurfaceView)findViewById(R.id.surface);
previewHolder=preview.getHolder();
previewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
recorder = new MediaRecorder();
String url = /sdcard/dcim/test.3gp;
camera = Camera.open();
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(352, 288);
parameters.set(orientation, portrait);
camera.setParameters(parameters);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setOutputFile(url);
recorder.setVideoFrameRate(15);
recorder.setVideoSize(480, 320);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.prepare();
recorder.start();
Thread.sleep(10);
recorder.stop();
recorder.release();

} catch (Exception e) {
e.getMessage();
}



On Nov 18, 9:11 pm, Roman ( T-Mobile USA) roman.baumgaert...@t-
mobile.com wrote:
 It might be helpful to attach your code.

 Have you called the prepare() method before starting the recording?

 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.

 On Nov 17, 5:55 am,android_devpankaj.i...@gmail.com wrote:

  Hi
  i am trying to record video and upload to web server. i created a temp
  file  but when i try to startrecorder.start(), it gives me
  java.lang.RuntimeException: start failed. i tried debugging it but i
  am not getting it working. can someone please give me sample code to
  record video and save. i am really stuck with this error

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en