I've fixed the out of memory error, however, at the moment I can't
record picture properly. My app does record audio, but the pictures
gets corrupted, when played from a desktop player it appers the same
way as when a player doesn't know how to properly decode a video
signal.

Here's a more detailed description of what I've done:

I call this within my first init() block of code.

MediaRecorder recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
recorder.setVideoSize(480, 320);
recorder.setVideoFrameRate(15);
recorder.setMaxDuration(10000);

Then from surfaceCreated(), I do the following:

try {
     recorder.setOutputFile(outputFilePath);
     recorder.setPreviewDisplay(sh.getSurface());
     recorder.prepare();
} catch (Exception e) {
     e.printStackTrace();
}

, where outputFilePath is something like "/sdcard/DCIM/Camera/" +
timeStampFormat.format(new Date()), and sh is the passed in
SurfaceHolder.

Recorder.start() / recorder.stop() are called from OnClickListeners.

Any thoughts of how to fix the picture? Thanks.



--~--~---------~--~----~------------~-------~--~----~
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