Git Product home page Git Product logo

Comments (6)

blueberry6401 avatar blueberry6401 commented on July 21, 2024 1

Thank you for your information, I'll consider it.
At the moment, I have a quick patch, so if anyone who needs a very simple use like me could try:

diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt
index 16d9aa5..4b48c31 100644
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/core/CameraSession.kt
@@ -305,7 +305,7 @@ class CameraSession(private val context: Context, private val callback: Callback
 
       val video = VideoCapture.Builder(recorder).also { video ->
         // Configure Video Output
-        video.setMirrorMode(MirrorMode.MIRROR_MODE_ON_FRONT_ONLY)
+        // video.setMirrorMode(MirrorMode.MIRROR_MODE_ON_FRONT_ONLY)
         if (configuration.videoStabilizationMode.isAtLeast(VideoStabilizationMode.STANDARD)) {
           assertFormatRequirement("videoStabilizationMode", format, InvalidVideoStabilizationMode(configuration.videoStabilizationMode)) {
             it.videoStabilizationModes.contains(configuration.videoStabilizationMode)
diff --git a/node_modules/react-native-vision-camera/ios/Core/CameraSession+Configuration.swift b/node_modules/react-native-vision-camera/ios/Core/CameraSession+Configuration.swift
index 882f4b3..9897d69 100644
--- a/node_modules/react-native-vision-camera/ios/Core/CameraSession+Configuration.swift
+++ b/node_modules/react-native-vision-camera/ios/Core/CameraSession+Configuration.swift
@@ -158,7 +158,7 @@ extension CameraSession {
   func configureOrientation(configuration: CameraConfiguration) {
     // Set up orientation and mirroring for all outputs.
     // Note: Photos are only rotated through EXIF tags, and Preview through view transforms
-    let isMirrored = videoDeviceInput?.device.position == .front
+    let isMirrored = false
     for output in captureSession.outputs {
       if isMirrored {
         output.mirror()

from react-native-vision-camera.

mrousavy avatar mrousavy commented on July 21, 2024

Mirroring is intentional. This is how VisionCamera works.

For Video files it just isn't really simple - what if you flip camera devices from front to back while recording? Is the video now mirrored or not?

from react-native-vision-camera.

blueberry6401 avatar blueberry6401 commented on July 21, 2024

Mirroring is intentional. This is how VisionCamera works.

For Video files it just isn't really simple - what if you flip camera devices from front to back while recording? Is the video now mirrored or not?

The back camera does not mirror the video, only the front-facing camera does. Typically on stock camera app (on my iphone), the camera preview appears mirrored, but when saving to a file, it is flipped back.
While I can manually flip the video, there is no indicator to determine if the video is mirrored, unlike PhotoFile which has an 'isMirrored' field.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on July 21, 2024

That's not what I said.

A video file cannot have an isMirrored flag because you could switch from back <-> front while recording. One stream is mirrored, one isn't.

from react-native-vision-camera.

blueberry6401 avatar blueberry6401 commented on July 21, 2024

That's not what I said.

A video file cannot have an isMirrored flag because you could switch from back <-> front while recording. One stream is mirrored, one isn't.

So what could you suggest? My usecase is quite simple, only need front camera.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on July 21, 2024

I think I could add a prop like isMirrored that controls mirroring for photos and videos. But this is a bit complex due to orientation, and I don't have the time to add that right now. If you want to sponsor this, I could add it. DM me for details.

from react-native-vision-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.