android-camera

Android camera supported picture sizes

吃可爱长大的小学妹 提交于 2019-12-17 23:19:57
问题 I am trying to retrieve the available camera image sizes, so I able to adjust the camera to my preferred image resolution. To retrieve the Android camera size I've used the following code: camera=Camera.open(); Parameters params = camera.getParameters(); List sizes = params.getSupportedPictureSizes(); for (int i=0;i<sizes.size();i++){ Log.i("PictureSize", "Supported Size: " +sizes.get(i)); } This gives me the following output, which I am not sure how to translate into a size. "Supported size:

Android Camera Capture using FFmpeg

情到浓时终转凉″ 提交于 2019-12-17 22:53:27
问题 Am tryin' to take the preview frame generated by the android camera and pass the data[] to ffmpeg input pipe to generate a flv video. The command that I used was : ffmpeg -f image2pipe -i pipe: -f flv -vcodec libx264 out.flv I've also tried to force the input format to yuv4mpegpipe and rawvideo but with no success... The default format of the preview frame generated by android-camera is NV21 . The way am invokin' ffmpeg is through the Process API and writing the preview frames data[] to the

How to capture both front and back cameras in Galaxy S4 simultaneously?

烂漫一生 提交于 2019-12-17 22:38:05
问题 As you may know Samsung Galaxy s4 has the capability to capture both front and back cameras at the same time. Now I need to capture both of them in my application. Should I download something? I tried to open both of them but It wasn't successful! I'm using API level 17. 回答1: As far as I know, this is the only phone which supports both the cameras working. This being said, your application may be applicable to this phone only by far. Unfortunatelly I don't know of any API which is released so

capturing image from camera and overlaying another bitmap before we save it

回眸只為那壹抹淺笑 提交于 2019-12-17 21:35:28
问题 here tempdata is the data captured from camera, savephoto(Bitmap) is a method am using to save the image taken from camera, and it is executing accurately ,, BUt on [2] i am overlaying another bitmap ,, and when i am calling the savephoto(p) it is creating an empty file in the memorycard ... not saving any image. how can i overlay the two bitmap on top of each other [1]File Imgname = Environment.getExternalStorageDirectory(); Bitmap bmp = BitmapFactory.decodeByteArray(tempdata,0,tempdata

Android Smart TV box having Rockchip-cs968a Camera Issue

﹥>﹥吖頭↗ 提交于 2019-12-17 21:25:51
问题 I am Using Android Smart TV box having Rockchip-cs968a. I am not able to capture image. It throws an error with this device at runtime Here is the code I am using: package com.android.camerarecorder; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.Camera; import

How to resolve the ANR error while invoking the Camera?

我只是一个虾纸丫 提交于 2019-12-17 21:06:16
问题 I have two button's in the main menu. I invoking the camera when I press the 1st button. Here I didn't get any issue. Camera working properly. After taking the picture, I come back in to main menu and again I press the 1st button. Here I got the issue. Camera invoking properly. But I got ANR error (Reason: keyDispatchingTimedOut) while i'm taking the picture. How to resolve this issue? Edit:: I'm using following code, Button Listener , Button imageButton = (Button) findViewById(R.id.button1);

How to ask runtime permissions for Camera

此生再无相见时 提交于 2019-12-17 19:22:20
问题 I am doing an application to scan barcodes on a button click and it was working fine up to Lollipop versions. When I came to Marshmallow it stopped working. This is the error: camerabase an error occurred while connecting to camera 0 It forces me to turn on permission by: Settings --> application --> my app --> camera. My question is how to allow camera permission to my app automatically in Marshmallow or by asking the user to turn on camera at runtime. A screen shot: 回答1: Below I have

Camera2 API Set Custom White Balance & Temperature Color

三世轮回 提交于 2019-12-17 19:11:52
问题 I'm trying to set a custom value for the White Balance & temperature color in my camera app. I'm using camera2 API and I'm trying different ways to set this value. I found a method from a excel file to get the right RGB Temperature matrix [Red,Green,Blue] from the White Balance Value between 100 and 100.000. I attached this method to a Seekbar and its working fine, my problem appear when I try to focus something white, then it becomes pink. Any kind of light looks like a pink torch in the

Android: Jpeg saved from camera looks corrupted

那年仲夏 提交于 2019-12-17 19:09:37
问题 I'm writing an Android application that saves a JPEG snapshot from the camera when the user clicks a button. Unfortunately, when I look at the JPEG file my code is saving looks corrupted. It appears to be caused by my call to parameters.setPreviewSize (see code snippet below) - if I remove that then the image saves fine; however without it I can't set the preview size and setDisplayOrientation also appears to have no effect without it. My app is targeting API Level 8 (Android 2.2), and I'm

Android Turn on/off Camera Flash Programmatically with Camera2

一笑奈何 提交于 2019-12-17 18:55:32
问题 I am making a simple application that acts as a flashlight. I need to be able to turn on and off the flash from a button in the application with the Camera2 API, as I get errors with the old camera API. I would like to use a "torch" flashlight, where the camera doesn't have to open in order for the flash to turn on. I know it's possible, as lots of phones have a flash on/off in the quick settings menu, but I can't find any code or tutorials about how to do this. Code: Camera cam = Camera.open