Detecting front facing camera and capturing image, android? - android

I want to capture image from the front facing camera.
Is there a way to detect front facing camera?
I searched a lot and the all the answers I found are quite old 2-3 yrs old.
Do I have to make a custom camera for it or is there any other way?

With the help of these links I was able to create my own front camera to take pictures
Android using front facing camera to take a picture
Access front camera
Android developer camera
Here is the link to final project
Custom Front Camera

Related

CameraX preview is showing FRONT camera, taken picture is BACK camera

I'm trying to take selfie picture using cameraX.
Preview works fine and show the front camera, but the actual captured image is from the back camera.
How to fix that problem?
Have anyone faced the same problem before?
Every UseCase config need to be defined with
setLensFacing(CameraX.LensFacing.FRONT)
Setting it to the preview only won't help for face recognition or image capture.

Unity3D - Using phone's camera for two packages in the same project [duplicate]

This question already has answers here:
Using both front and back cameras simultaneously android
(3 answers)
Closed 5 years ago.
I want to use front and back Camera of device both at same time. In my app, first half of the screen will display preview of back camera and next half of the screen will display front camera preview.
I have tried this with setting two different camera previews but when I open my app, first half of the screen(which displays back camera preview) does not display the preview. And second half of the screen(which displays front facing Camera) displays back facing Camera(strange).
According to Camera.open(int) documentation:
Your application should only have one Camera object active at a time
for a particular hardware camera.
This means if both camera hardware (front and back) are different and can be opened at same time.
In my application, I am using the same above api. This does not give any exception or error when I open and call Camera.startPreview(); for both cameras at same time. But still it is not working. I can see only one camera preview at a time.
Is there anything which I am missing here to use both cameras at same time?
I got simultaneous dual camera access working on the HTC ONE M8
Video: http://youtu.be/lt8N1Lpa9Zw
Feel free to use my code from here: https://bitbucket.org/jens_grubert/androiddualcameracapture/
Same as a single camera... Just double.
Two SurfaceHolders, and two Camera instances.
http://developer.android.com/reference/android/hardware/Camera.html
https://stackoverflow.com/a/4591023/1602230
http://developer.sprint.com/show_thread.do?forumId=528&threadid=26999&messageId=78914
Using both cameras on android: "Fail to connect to camera service"
Refered from https://stackoverflow.com/a/8411122/1602230
No
Your application should only have one Camera object active at a time for a particular hardware camera.
look at this http://developer.android.com/reference/android/hardware/Camera.html#open(int)

Android front camera video capture mirroring

I am making an application using front camera and recently came up with this issue that outcomes of captured image and video are different(left-right inverted) from what I've seen through the display.
So for the image I could process it right after taking the picture because the size of the image wasn't too big - I used matrix preScale to mirror the image.
However, I have no idea how to do that with video capture. I already know that Android default camera does not mirror the front camera video output and lots of famous applications have compromised with default setting. But at the same time there are some camera related applications such as Instagram, Snow Camera, and B612 that do exactly what I want.
So my questions are,
Is it possible to mirror the front camera video output using Android MediaRecorder and Camera class? (That's what I've been using so far)
Or do you have to process the video after you take it? And if so, is there any nice and fast way of doing it?
It would be nice if any of you can answer it specifically. Thank you in advance!

Is there a way to record what is displayed in Android's Camera Preview?

There are already plenty of threads about the android's front camera mirror flip issue but non of them answered my concern.
I just wanted to know if its possible to record what the Camera Preview is currently displaying instead of the media recorder's?
This way, I can be sure that the mirror image is what is going to be written to disk.

Use front camera with built in camera app

In my app, I'm using the built-in camera app to take pictures.
The thing is that this interface has a button to change camera ( to front) and when I take a picture with front picture, it is not working anymore.
So, Is there a way to take picture fromt front camera with built-in camera app.
If it is not posible, is there a way to remove the icon from built in app???
Any suggestion will be appreciated!

Categories

Resources