Take picture fails in dual camera mode - android

I'm having some issues when I'm in dual shot mode.
This is what I've got so far:
back camera mode - works perfectly
front camera mode - works perfectly
parallel camera mode (full back preview + small window front preview) - works perfectly on the devices that support accessing both cameras at the same time (like Samsung S4).
The problem is: while having both previews display, I call takePicture() method on BOTH cameras. It works perfectly on devices like Samsung S4 and HTC M8, but on LG G3 the takePicture() on the back camera just doesn't work. It doesn't even enter any of the callbacks. The front picture is taken correctly, but the back camera isn't, and then it freezes and I get a camera error 100, while the front camera keeps working fine.
I mention that all the above devices (S4, M8, and G3) support parallel cameras. The problem is only at G3 when I want to takePicture.
I've also tested on Nexus 5 which does not support and I've implemented a different approach which works great (basically, I take pictures one at a time).

Related

Android camera2 Samsung Galaxy S6 autofocus CONTROL_AF_MODE_CONTINUOUS_PICTURE not working as well as stock camera app

We are using the camera2 API and setting the preview auto-focus via previewCaptureRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE ); The phone we are using is a Samsung Galaxy S6 which has an excellent camera. The issue does not happen with an LG G4.
This mostly works. However, specially in poor lighting conditions and with text, it does not work as well as the stock camera app. The stock camera app always auto-focuses perfectly, but our app only auto-focuses well when there is good lighting and also better with textured surfaces such as wood than paper with text.
This video (from someone else a few years ago) demonstrates a similar outcome as with our app: https://www.youtube.com/watch?v=lnMoYZwVaFM

Android Camera 2 API problems with flash on Nougat 7.1

Following the Camera 2 sample I've created simple camera class to capture the images. When it's okay with capturing both flash/non-flash images on any device with Android < 7.0, on mine Nexus 5X with Android 7.1 the same config fire the flash only once on the preview. Pre-sequences are the next:
for the preview I'm using CameraDevice.TEMPLATE_PREVIEW with AE mode set to CameraMetadata.CONTROL_AE_MODE_ON_ALWAYS_FLASH
the same I use for the capture still picture, but with CameraDevice.TEMPLATE_STILL_CAPTURE
If someone can help me with this case - I'll be really appreciated.
This is just additional information on the above issue. I wish to draw some attention to this problem!
My application takes a photo every 5 seconds. I (1) select the camera, (2) acquirer a session and then with each loop I (3) create a Capture request in which I set the Flash Mode and call the capture method on the session.
I have no issues with my Samsung SM-G550T (Android version 6.01), but I was having some issues with the Flash Mode on my Moto G4 (Android version 7.0). I got both phones to Flash, but only with this setting:
CaptureRequest.Builder requestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
requestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_SINGLE);
I am presently having an issue with a LG device (M210N) (Android version 7.0). Using the settings I stated above I get the device to flash just once. If I completely re-initialize the camera (as described above) the device will flash again only once.
If I add the CONTROL_AE_MODE_ON_ALWAYS_FLASH setting to the above requestBuilder, then the LG does not flash at all. So I had to remove that flag.
I have tried many different additional settings and combination for settings and none of them have eliminated this issue. I wonder how many devices are affected by this issue.

Samsung S4 Video record using native camera issue

I am working on an application where user can capture a video using the phone's default camera. For that I have used the following intent
startActivityForResult(new Intent(MediaStore.ACTION_VIDEO_CAPTURE).putExtra(MediaStore.EXTRA_SIZE_LIMIT, maxLimit), Constants.INTENT_ID_RECORD_VIDEO);
It works fine in Samsung galaxy nexus, Lg nexus 4, Lenovo 260 etc. Upon launching the intent, in the above devices the camera opens in video mode and user can start recording the video directly, but in Samsung S4 device the camera opens in a mode where user has to again select video mode and then start recording.
Is there a way that it can be avoided.
Can any of you please provide any work around?
Please point me to any valid official documentation if this is an issue that can not be resolved.
Thanks in advance.

setRotation() does not work on Samsung devices; Solution without having to save the image to the phone

Okay so here's a problem I have.
setRotation() should rotate a captured JPEG image. It works fine on most phones, but somehow doesn't work on Samsung Galaxy S3 and S4.
Here's a question with a proposed soluton:
setRotation(90) to take picture in portrait mode does not work on samsung devices
It involves manipulating the EXIF data, however, the ExifInterface() being used, requires the image to be saved to the phone, and then it uses the absolute file path.
However, I don't want to save the image to the phone, that's one of my main criteria. Any idea, on how to go about this issue?

Galaxy Nexus Capture image without starting preview?

I don't have a Galaxy Nexus and it's impossible to buy one. Therefore I would like to know if anyone knows the answer to this question specifically targeted to Galaxy Nexus.
SurfaceView sf = new SurfaceView(this);
camera.setPreviewDisplay(sf.getHolder);
camera.startPreview()
Using this code I am able to take a picture without showing the camera preview. However, this code doesn't work on Galaxy Nexus. Even if I changed SurfaceView to SurfaceTexture.
Any idea how I can do it on a Galaxy Nexus?
You cannot use a dummy SurfaceView for this device. In documentation its specified that a SurfaceView (valid surface view) should be provided before start Preview, I also did try and it run over almost all devices except Galaxy Nexus

Categories

Resources