android-camera

Can't configure Camera2 API for a preview

与世无争的帅哥 提交于 2020-01-14 05:30:10
问题 I need to set a preview for camera, to use it to scan a QR code, using Camera2 API. My problem is to configure camera. This is my code: //setting the preview surface layout file <?xml version="1.0" encoding="utf-8"?> <SurfaceView android:layout_width="250dp" android:layout_height="250dp" android:id="@+id/surfaceView" android:layout_gravity="center" android:layout_centerVertical="true" android:layout_centerHorizontal="true" /> <TextView android:layout_width="wrap_content" android:layout_height

Images from Custom Camera are blurry on Galaxy Nexus

ε祈祈猫儿з 提交于 2020-01-13 19:07:50
问题 I have a custom camera in the app and the images that are taken on most of the devices look good but on galaxy nexus the story is different. Images are blurry in Galaxy nexus. I see grainy lines on Motorola Atrix as well. But Droid X, Droid Razr, HTC Evo, HTC incredible are showing good results. Any idea why it would happpen? This is what I have so far. P.S.: I am using Auto focus in the activity. public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private

Inconsistent video rotation when using MediaCodec

左心房为你撑大大i 提交于 2020-01-13 06:46:45
问题 I have two devices, a Nexus 7 (Android 5) and a Galaxy S3 (4.3). On both devices I recorded a video in portrait mode and saved it with rotation hint 90 degrees. This is the correct orientation hint cause when played using the default media player the orientation is fine on both devices. I can even copy the video from the Nexus to the Galaxy and the orientation is still fine when I play the video file. However, when I decode the video using the MediaCodec api I get some problems with the video

how can i set the camera function that anti-shake(image Stabilizer) at android

落爺英雄遲暮 提交于 2020-01-13 02:54:09
问题 I've made a Camera App. I want to add the functionality of anti-shake. But I could not find the setting for anti-shake(image Stabilizer). Plz Help me!! 回答1: Usually Image Stabilizer is a built-in camera feature, while OIS (Optical-Image-Stabilization) is a built-in hardware feature; by now really few devices support them. If device hasn't a built-in feature, i think you cannot do anything. Android doesn't provide a direct API to manage image stabilization, but you may try: if android.hardware

Android Low picture quality after shot

微笑、不失礼 提交于 2020-01-11 14:22:31
问题 I have a button that triggers an image capture : private void capturePicture() { if(ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED){ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // Tiến hành gọi Capture Image intent startActivityForResult(intent, 100); } else ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.CAMERA}, 200); } Right after I take the shot, I see the capture and the

Captured Image Resolution is too big

青春壹個敷衍的年華 提交于 2020-01-11 13:06:35
问题 What I am Doing ? I am allowing user to capture image, storing it into SD Card and uploading to server. But getting resolution of Captured image as Width: 4608 pixels and Height: 2592 pixels Now What I Want ? How do I get small resolution images without any compromising with quality, like minimum resolution i can get or set captured image resolution 25% of original image resolution.. (Device Specific) CameraCaptureActivity.java: public class CameraCaptureActivity extends Activity implements

Capture image automatically like 360 Panorama

和自甴很熟 提交于 2020-01-11 09:14:11
问题 I am working on the application which is similar to Panorama app.I want to capture the image automatically when device moved from left to right like 360 panorama app works.After few research,I came to know that Sensor and thread can be useful for that and I have seen some examples of sensor here.But I couldn't understand about how to use sensor for my purpose.I also could not find any tutorial related to sensor with camera for auto capturing image.If anybody have any idea or example regarding

Android - cam.setPreviewDisplay(holder) running into IOError

故事扮演 提交于 2020-01-10 20:17:09
问题 I am trying to use the camera's image as part of live wallpaper. In the Engine that I declared, I have this code: public class Class extends WallpaperService { Camera cam; @Override public void onCreate() { super.onCreate(); cam = Camera.open(); } //... @Override public Engine onCreateEngine() { return new CubeEngine(cam); } class CubeEngine extends Engine { Camera cam; CubeEngine(Camera cam) { this.cam=cam; } //... @Override public void onDestroy() { if (cam != null) { cam.stopPreview(); cam

[android Side By Side Camera

半腔热情 提交于 2020-01-10 20:11:21
问题 Hi i want to show a live camera preview side by side on my Android Phone. Like this: https://lh6.googleusercontent.com/-Ngo4tD4AvWY/U8JOHxxQ9KI/AAAAAAAACK8/NZjnw1Yqg8A/w384-h287/2.jpg It works if just the left half screen shows the live preview or just the right side, but if i want to show the left and the rigth side simultaneously i just get a black screen And i dont know why. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"

Video recording and onPreviewFrame callback at the same time

落花浮王杯 提交于 2020-01-10 04:34:10
问题 I'm trying to record video using MediaRecorder and get raw frames (byte arrays) from onPreviewFrame callback method Seems it's not that easy, mb it's not even possible, I don't know... But I found some answers (for similar questions) and people say that you should reconnect camera instance ( Camera.reconnect() ) after calling MediaRecorder.start() and set preview callback again I tried something like this but it doesn't work (recording works but onPreviewFrame is never called) I also tried to