You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On an Android device, while taking a video recording with the Back camera started, if user switches to Front camera during the same recording the Front video recording becomes inverted -- it looks okay during the recording session but the saved video recording of the Front camera is inverted (upside-down).
Interestingly, if I start the recording using the Front camera then switch to Back camera the recording of the Front video is fine.
What does inverted mean? Please attach a sample video.
mrousavy
changed the title
馃悰 [V4] Front camera recording is inverted when going from Back to Front camera during recording on Android
馃悰 Front camera recording is inverted when going from Back to Front camera during recording on Android
May 8, 2024
Okay, this is a CameraX bug then, nothing I am doing explicitly - could you create a bug report in the Google CameraX issue tracker about this?
Thanks!
@mrousavy I think I figured out the issue -- at least doing this change fixes it for me:
In this file:
node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt
I commented out line 308:
val video = VideoCapture.Builder(recorder).also { video ->
// Configure Video Output
// video.setMirrorMode(MirrorMode.MIRROR_MODE_ON_FRONT_ONLY)
And the issue was resolved. I think this is because in my use case, the recording starts using the back camera and the CameraX must set a certain orientation, and when I switch to Front camera during the same recording the orientation is not updated to relative to Front camera, so mirrorMode causes the inversion.
I'm not sure if there is a way to adjust the code to check if the orientation is correct before applying the setMirrorMode or maybe this is the desired behavior just an issue with CameraX as you say.
What's happening?
On an Android device, while taking a video recording with the Back camera started, if user switches to Front camera during the same recording the Front video recording becomes inverted -- it looks okay during the recording session but the saved video recording of the Front camera is inverted (upside-down).
Interestingly, if I start the recording using the Front camera then switch to Back camera the recording of the Front video is fine.
Reproduceable Code
Relevant log output
Camera Device
Device
Android Pixel 6 Pro API 34 (emulator), Pixel 5 API 34 (physical device)
VisionCamera Version
4.0.3
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
The text was updated successfully, but these errors were encountered: