android-camera

Samsung galaxy S4 image capture Issue

久未见 提交于 2019-12-30 07:15:10
问题 I am developing an Android Application. I created a custom camera class to capture images. It is working fine in som many devices but when i Tried it with Samsung Galaxy S4 it returns image with gray lins as shown. My Code is : ![`*public void surfaceCreated(SurfaceHolder holder) { frontCam = SharedUserPrefs.getSharedPrefData(AutoCapture.this, Constants.IS_FRONT_CAMERA); if (frontCam.equals(Constants.VALUE_ON)) { for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); camIdx++) { Camera

Camera.Parameters.setRecordingHint and aspect ratio

雨燕双飞 提交于 2019-12-30 06:33:28
问题 I've found some odd behavior around Camera.Parameters.setRecordingHint that I'd like to understand better. If I set it to true , the size of the preview image can come back different from what I pass to setPreviewSize. It depends on what size I set it to-- some aspect ratios work and some don't. See the screenshots below-- setPreviewSize has been set to 640x480 for both, but one has setRecordingHint to true and the other to false . I have the code that produces this effect on GitHub. Is this

Webcam in Android emulator: “Cannot start camera” and “Result too large”

杀马特。学长 韩版系。学妹 提交于 2019-12-29 07:47:25
问题 I have an Android 4.1.2 AVD that needs to use the camera. I tried using my webcam as a substitute in the emulator, but I get this error: [2012-11-16 10:35:37 - Emulator] emulator: ERROR: _camera_client_query_start: Cannot start camera 'AndroidEmulatorVC0' for NV21[640x480]: Result too large How do I fix this error? 回答1: Goto window -> AVD Manager -> select your AVD name ->click Edit button -> Abstracted LCD density click value drop down value select 160. To enable Camera in your Android

Webcam in Android emulator: “Cannot start camera” and “Result too large”

久未见 提交于 2019-12-29 07:47:10
问题 I have an Android 4.1.2 AVD that needs to use the camera. I tried using my webcam as a substitute in the emulator, but I get this error: [2012-11-16 10:35:37 - Emulator] emulator: ERROR: _camera_client_query_start: Cannot start camera 'AndroidEmulatorVC0' for NV21[640x480]: Result too large How do I fix this error? 回答1: Goto window -> AVD Manager -> select your AVD name ->click Edit button -> Abstracted LCD density click value drop down value select 160. To enable Camera in your Android

problem with taking pictures using the android camera

自闭症网瘾萝莉.ら 提交于 2019-12-29 07:16:25
问题 I have an app where I'm using the android camera to take pictures.I have built my own android camera.And pictures are taken by pressing a button. Something like this: public void onClick(View arg0) { mCamera.takePicture(null, mPictureCallback, mPictureCallback); } Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] imageData, Camera c) { if (imageData != null) { Intent mIntent = new Intent(); Bundle b = new Bundle(); b.putByteArray(

open camera using intent

纵然是瞬间 提交于 2019-12-29 01:35:11
问题 I want to use intent to open camera in Android . I used the following code but when i press the button (whose action is onclick() function the app closes on itself . public void onclick(int actionCode){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(takePictureIntent, actionCode); } public static boolean isIntentAvailable(Context context, String action) { final PackageManager packageManager = context.getPackageManager(); final Intent intent =

OnPreviewFrame data image to imageView

元气小坏坏 提交于 2019-12-28 12:44:13
问题 i'm trying to get the byte[] from the preview of the camera, convert it to bitmap and display it on a imageview with imageView.setImageBitmap() i've managed to start the preview and display it on a surfaceView, but i don't know how to convert the byte[] data (that comes in Yuv format i think) in a RGB bitmap to display it on a imageView. the code i'm trying is the following: camera = camera.open(); parameters = camera.getParameters(); camera.setParameters(parameters); surfaceHolder =

OnPreviewFrame data image to imageView

最后都变了- 提交于 2019-12-28 12:43:12
问题 i'm trying to get the byte[] from the preview of the camera, convert it to bitmap and display it on a imageview with imageView.setImageBitmap() i've managed to start the preview and display it on a surfaceView, but i don't know how to convert the byte[] data (that comes in Yuv format i think) in a RGB bitmap to display it on a imageView. the code i'm trying is the following: camera = camera.open(); parameters = camera.getParameters(); camera.setParameters(parameters); surfaceHolder =

Convert NV21 byte array into bitmap readable format [duplicate]

风格不统一 提交于 2019-12-28 06:47:26
问题 This question already has answers here : How to use ScriptIntrinsicYuvToRGB (converting byte[] yuv to byte[] rgba) (5 answers) Closed last year . Hey I'm creating small camera app I have implemented every things but I have one problem which is converting NV21 byte array into jpeg format I have found many way but all of them even not working or work on some devices firstly i tried this snippet and it work on Xperia z2 5.2 but on galaxy s4 4.4.4 bitmap = BitmapFactory.decodeByteArray(data, 0,

Android record video without audio

自闭症网瘾萝莉.ら 提交于 2019-12-28 06:31:17
问题 Is it possible in Android to record video from Camera without audio stream? Goal: to reduce the output file size. 回答1: You can use a MediaRecorder without calling setAudio* on it. This is my first time using MediaRecorder, but this example seems to work: public class CamcorderView extends SurfaceView implements SurfaceHolder.Callback { private SurfaceHolder mHolder; private Camera mCamera; private MediaRecorder mRecorder; public CamcorderView(Context context, AttributeSet attrs) { super