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. Clearing composing text in IME on switching fields?

I'm working on a custom keyboard implementation overriding an
InputMethodService. Our implementation creates composing text for
predictions within the text field, styled appropriately. For instance,
a user typing "pine" would have "pineapple" shown with the "apple"
showing as gray since the user hasn't committed it, using the
inputConnection.setComposingText(sbb,...) method. Everything works
very well unless there are multiple text fields on screen and the user
taps a different field. By the time my service is in onFinishInput()
before I ever call the super.onFinishInput() the composing text has
already had its SPAN_COMPOSING styling removed, but the completed text
is still there. I can find no way to reliably remove the unaccepted
"apple" to yield "pine". Thoughts?

-- 

2. Pure Data as your audio engine

Hello Android dev ppl,

Pure Data is a Free Software audio patching/programming language which allows
you to make wonderful sound machines by connecting boxes together with virtual
wires. http://pure-data.info/ There is now a way of getting your Pure Data
patches to work as the audio engine in your Android project (as well as your
Python project, Java project, C++ project, whatever). This is great if you are
making an app which does complex or interesting things with dynamic audio or
music or whatever. You can find the project for doing that here:

https://gitorious.org/pdlib/pd-for-android

I am giving a workshop in Los Angeles this Thursday if you are interested in
learning about this stuff. You can sign up here: http://mccrm.cx/l/la-2011

Hope to see you there!

Cheers,

Chris.

-------------------
http://mccormick.cx

-- 

3. 16 bit encoding

4. Error in building application

5. Getting the time of day from a cell site

6. why are images automatically scaled down on high density screens with BitmapDrawable(String filepath)

7. Need Help: Odin gagal