Using both front and back cameras simultaneously a

2019-01-01 15:56发布

问题:

I know this question has been asked many times before. I had looked for it over a year ago but didn\'t find anything so posting this question again to gather if there are any new thoughts/ approaches or hacks.

I want to be able to capture video from both cameras (front and back) in an android device.

My only thought as of now is to some how switch between front and back every 0.1 sec, however I have never been able to code this. Any help from anyone on this, please.

Also another thought is - videos are generally captured at 15 or 30 frames per second. Assume it is at 30 frames per second. What if there is a way to alternate these frames to front and back, then we could have 15 frames per second of front and 15 frames per second of back video. Is this possible? If yes then how? Please suggest. What happens to the audio? Maybe we could restrict audio to only one of the video recordings (front or back).

回答1:

It\'s possible on the HTC m8, the OnePlusOne and the Motorola Nexus 6, as far as I have tested. Many more phones might support it, but you just have to test on the phones and see if the app crashes or not.

You create a camera object for each available camera and have each attach to the preview callback.

-edit- So far I\'ve found that this works on Snapdragon 801 based phones. Dunno if all of them do it or what other SOCs support it, but that\'s what I\'ve found so far.



回答2:

It is possible but so far, only with the upcoming Samsung Galaxy S4.

It has a dual-camera feature but who knows whether it\'s hardware-dependant or a software-modification by Samsung, at this stage.

\"Dual

Hopefully it can be ported to other phones, if it\'s just software.



回答3:

You can\'t use both simultaneously and switching between each camera every 0.1 seconds is not going to work well. Acquiring and releasing the camera object is pretty expensive and this just isn\'t going to pan out well.