Code Monkey home page Code Monkey logo

Comments (4)

Dingenis avatar Dingenis commented on May 25, 2024

Hey @jackylu0124, maybe you could see what kind of device and format you get on V2 and compare that to the ones you get on V3 (just by logging them). The format filter you use on V3 only maximises the resolution of the photo and video (preview). That is not the best format necessarily, it depends on your use case.

Futhermore, I think enabling HDR and setting qualityPrioritization for taking photos to quality could also help boost the results you see.

from react-native-vision-camera.

jackylu0124 avatar jackylu0124 commented on May 25, 2024

Hi @Dingenis, thank you for your reply and insight! Would you mind sharing how I can log/print out the device format when I am using preset="photo"? I have tried logging out the various props of the ref object that's passed into <Camera>, but I could not find the ones that are currently being used for the preset="photo" setting. Thanks for your help in advance!

from react-native-vision-camera.

Dingenis avatar Dingenis commented on May 25, 2024

Hi @jackylu0124, good point, it's hard to log that way. It seems that preset only does something on iOS and is determined by Apple, so it's a bit hard to see what it actually does. What you could try is to alter the source code to log the format that is being used.

After this line, you could add something like this:

guard let f = device.activeFormat else { return }
let formatDict = f.toDictionary()

do {
  let jsonData = try JSONSerialization.data(withJSONObject: formatDict, options: .prettyPrinted)
  let jsonText = String(data: jsonData, encoding: .ascii)
  ReactLogger.log(level: .info, message: "Format: \(jsonText)")
} catch { 
  ReactLogger.log(level: .error, message: "Error occured while serializing format to JSON")
}

I didn't test this code so there could be error in it, but I think it points you to the right direction. You could just add something like this in your node_modules/react-native-vision-camera/ios/CameraView+AVCaptureSession.swift

from react-native-vision-camera.

mrousavy avatar mrousavy commented on May 25, 2024

Hey - you could try to use useCameraFormat(device, Templates.Photo) for example. But by default, photo is already high quality.

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.