react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

❓ Simultaneously record video or take photos from both rear and front cameras

Open Skipperlla opened this issue 2 years ago • 4 comments

Question

My goal is to have both rear and ten cameras recording or taking photos at the same time, just like in the bereal app

What I tried

No response

VisionCamera Version

3.6.6

Additional information

Skipperlla avatar Nov 16 '23 12:11 Skipperlla

Hey - I'm not sure if this is currently possible, but you can try to just render two <Camera> Views and see what happens:

<Camera device={backCamera} ... />
<Camera device={frontCamera} ... />

mrousavy avatar Nov 18 '23 11:11 mrousavy

Hey - I'm not sure if this is currently possible, but you can try to just render two <Camera> Views and see what happens:


<Camera device={backCamera} ... />

<Camera device={frontCamera} ... />

I tried this but one worked and the other didn't

Skipperlla avatar Nov 18 '23 13:11 Skipperlla

Well then yea this does not currently work and is quite complex to implement. Did you test on both iOS and Android? I thought it would work

mrousavy avatar Nov 19 '23 14:11 mrousavy

Well then yea this does not currently work and is quite complex to implement. Did you test on both iOS and Android? I thought it would work

Honestly, I didn't try the android part after I saw that it didn't work on the ios part because it was necessary for me on both sides.

Skipperlla avatar Nov 20 '23 05:11 Skipperlla

Well yea, I think this is currently not possible. It would require quite a large refactor of the codebase as on iOS I would need to use a single AVCaptureSession and attach two input Cameras to that - quite a complex thing to do.

Might significantly change the API as well:

const device = useCameraDevice('back')
const camera = useCamera(device)

return <Camera camera={camera} isActive={true} />

and for multi:

const front = useCameraDevice('front')
const back = useCameraDevice('back')
const camera = useCamera([back, front])

return <Camera camera={camera} isActive={true} />

If you want this, consider contacting me thru my agency to figure out a way to collaborate on this.

mrousavy avatar Jan 15 '24 13:01 mrousavy

in theory, could you use 2 libraries to record? For example, use this one for back camera and another one for front camera? Or do they basically use the same iOS API and would conflict with each other?

johhansantana avatar Jul 31 '24 17:07 johhansantana

No it is the same iOS API.

mrousavy avatar Jul 31 '24 20:07 mrousavy