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

🐛Flash not working when recording video

Open nica0012 opened this issue 2 years ago • 7 comments

What's happening?

After upgrading from v2 to v3, flash seems to not work anymore while recording a video.

Is anybody else running into this?

Reproduceable Code

(example app)

Relevant log output

n/a

Camera Device

n/a

Device

iPhone 13 Pro Max

VisionCamera Version

3.6.4

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

nica0012 avatar Nov 08 '23 01:11 nica0012

@mrousavy Downgrading to 3.3.1 resolves this along with audio for video. Maybe the issue is related.

nica0012 avatar Nov 10 '23 00:11 nica0012

I have same problem, downgrading to 3.3.1 didn't help either. 😕

prasan2421 avatar Nov 14 '23 23:11 prasan2421

@mrousavy I upgraded to 3.6.6 to give this a try, now when recording the flash starts for about a second or two, then turns off. I noticed in the version notes there was some bug fixes on the flash, but this might be lingering still.

nica0012 avatar Nov 15 '23 19:11 nica0012

Interesting - does audio work flawlessly now though? I should've fixed audio in https://github.com/mrousavy/react-native-vision-camera/pull/2144

mrousavy avatar Nov 15 '23 19:11 mrousavy

Might be that we need to delay this: https://github.com/mrousavy/react-native-vision-camera/blob/3dd56c3ba26e5f95fcea4871657b2ef0e7bcb3d8/package/ios/Core/CameraSession.swift#L164-L168

...to make torch work on initial mount, as reported by @metrix-hu in https://github.com/mrousavy/react-native-vision-camera/issues/2050.

That it's not working when recording is a bit weird though, I'll try to fix that.

As a workaround, you can just enable torch={true} when starting your recording, and setting it back to false when stopping on the JS side.

mrousavy avatar Nov 15 '23 19:11 mrousavy

Interesting - does audio work flawlessly now though? I should've fixed audio in #2144

Audio works great 👍

nica0012 avatar Nov 15 '23 19:11 nica0012

Might be that we need to delay this:

https://github.com/mrousavy/react-native-vision-camera/blob/3dd56c3ba26e5f95fcea4871657b2ef0e7bcb3d8/package/ios/Core/CameraSession.swift#L164-L168

...to make torch work on initial mount, as reported by @metrix-hu in #2050.

That it's not working when recording is a bit weird though, I'll try to fix that.

As a workaround, you can just enable torch={true} when starting your recording, and setting it back to false when stopping on the JS side.

Sounds great I'll give this workaround a go for now, thank you 💯

nica0012 avatar Nov 15 '23 19:11 nica0012

Hey I think I fixed this in a recent change! Flash in video is now handled on JS side (as torch)

mrousavy avatar Jan 15 '24 13:01 mrousavy