3

For some reason, I need to open front and back cameras at the same time and I tried the new Camera2 API and get ERROR_MAX_CAMERAS_IN_USE error when I tried to open the second Camera on my Nexus 4. And the document shows it may depend on the devices.

So are there any devices can reach this by the public API? Or can any method like OpenCV can do it?

GhostFlying
  • 809
  • 1
  • 7
  • 17
  • 1
    i don't think you can simultaneously open both cameras – Sarthak Mittal Dec 03 '14 at 16:16
  • 1
    As you said yourself, the standard `android.hardware.camera2` API throws an `ERROR_MAX_CAMERAS_IN_USE` in such a case. So NO, you cannot achieve what you want with Android API. However some manufacturer might have layers that provide such APIs. – shkschneider Dec 03 '14 at 16:22
  • But I found the unit test from aosp, it contains the test use front and back camera at the same time, it showed it may only a limitation of device not API. – GhostFlying Dec 04 '14 at 05:24

2 Answers2

2

The Samsung Galaxy S4 and Samsung Galaxy S5 are two devices which can use a front and a rear camera simultaneously

I'm not sure about public apis, but Samsung offers Samsung specific SDKs you may want to check there on Samsung Developers

CQM
  • 42,592
  • 75
  • 224
  • 366
  • How does it do that..?split screen into 2 to show both the views...? – Psypher Dec 03 '14 at 16:18
  • @Ranjith One camera's preview will take the whole screen, and the second camera preview is floating in a smaller area, which you can change the shape of (such as a bubble, or square), move around, add to different effects (such as a postcard stamp, in a postcard border, with the other camera preview taking up the postcard itself), all live. – CQM Dec 03 '14 at 16:41
  • Samsung Camera SDK does not expose the 'dual camera' feature to public :( – Alex Cohn Aug 07 '17 at 11:49
1

I know this is way late but here are two post I made on this to help anyone who runs into this:

https://stackoverflow.com/a/28811277/1138878

https://stackoverflow.com/a/43445052/1138878

Short answer: it's possible but depends on hardware/chipset (Snapdragon 801 and higher level hardware).

Community
  • 1
  • 1
MacD
  • 783
  • 7
  • 23