hi,
Thanks for your kind reply, I studied about MediaRecorder to capture video,
but i want to send video to my server (TCP socket) live. and save this video on
a file.
also i found that, the ParcelFileDescriptor.fromSocket(socket) can be use to
send the video but i don't know, how to recieve it on server side. if you have
any idea about please reply
me.
Thanks and Regards.
umer
> Date: Tue, 24 Jan 2012 00:22:10 -0800
> Subject: [android-developers] Re: How to Increase frame rate (fps) from
> onPreviewFrame??
> From: [email protected]
> To: [email protected]
>
>
>
> [email protected] wrote:
> > hi,
> > I am getting frames from onPreviewFrame, compress to jpeg image
> > with YUV and send over the network(TCP),
> > but the problem is, i want to increase the frame rate. Now it is 4fps
> > but i want 15fps and my image size is 4- 6 kb what can i do to
> > increase frame rate, here is my code
> >
> > public void onPreviewFrame(byte[] data, Camera camera) {
> >
> >
> > Camera.Parameters parameters = camera.getParameters();
> > int format = parameters.getPreviewFormat();
> >
> > //YUV formats require more conversion
> > if (format == ImageFormat.NV21 /*|| format ==
> > ImageFormat.YUY2 || format == ImageFormat.NV16*/)
> > {
> > int w = parameters.getPreviewSize().width;
> > int h = parameters.getPreviewSize().height;
> >
> > // Get the YuV image
> > YuvImage yuv_image = new YuvImage(data, format, w, h,
> > null);
> > // Convert YuV to Jpeg
> > Rect rect = new Rect(0, 0, 320, 240);
> > ByteArrayOutputStream output_stream = new
> > ByteArrayOutputStream();
> > yuv_image.compressToJpeg(rect, 30, output_stream);
> > byte[] byt=output_stream.toByteArray();
> >
> > try {
> >
> >
> > obj.writeObject(byt);
> > obj.flush();
> >
> >
> > // Log.d(TAG, "onPictureTaken - wrote bytes: " +
> > data.length);
> > } catch (FileNotFoundException e) {
> > e.printStackTrace();
> > } catch (IOException e) {
> > e.printStackTrace();
> > } finally {
> > }
> >
> > Preview.this.invalidate();
> > }
> > }
> >
> >
> > Thanks and Regards
> > umer
>
> why don't you use MediaRecorder for video capture?
>
> pskink
>
> --
> 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
--
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