video recording issue

by android_dev » Wed, 18 Nov 2009 01:33:02 GMT


Sponsored Links
 HI,
i am trying to record video and upload to web, i have given my best
effort but no luck, i am not sure if it is possible with android 1.6.
Please help me to figure out the solution. is it possible to do
that.its really urgent

--



video recording issue

by android_dev » Thu, 19 Nov 2009 08:42:12 GMT


 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(100000);
recorder.stop();
recorder.release();

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




--


Sponsored Links


video recording issue

by Greivin Lopez » Thu, 19 Nov 2009 22:38:58 GMT


 I think you don't have to open and set parameters for the camera when
recording video, at least it never work for me, try to remove this
code:
"camera = Camera.open();
Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(352, 288);
parameters.set("orientation", "portrait");
camera.setParameters(parameters);"

Also you need to be sure that you are setting the correct permissions
in the Manifest file, I suggest you these ones:

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

I see no other problems but as a matter of fact I was not able to use
the media recorder in a portrait layout... it just stay landscape. I
don't know if it was just me or what.

I hope you could fix your problem.

--



video recording issue

by WrVishnu » Sun, 29 Nov 2009 04:21:06 GMT


 Hi

Did u able to record a video in android emulator , could you please
help to share the code for recording the video

I am new to android development , from the snippet here i dont know
what package to import.

CAn u please send the source for the video record

BTW i am newbi to the android development

Thanks and Regards
Vish




--



Other Threads

1. Old apps

How do you remove old versions of apps on the emulator? I suspect the old
version of the Notepadv1 is running rather than the one I fixed.

-- 

2. Error::while building the SDK open source project

This question is better suited for the Android Developers group.  The
beginners group is for questions relating to SDK application development,
not Android source.

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------





> 

3. aosp/caf/ohd

4. Info required on call to onLocationChanged() functionality.

5. Android Market Anti-Piracy

6. Is Android backwards compatible?

7. G! vs G2 Phone - Opinions ???