-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Preset prop has no effect on Android #323
Comments
|
The format works, kinda, even if it's somewhat clunky to use. There is an issue with format though that no matter the resolution picked the recorded file size always ends up at ca 30MB. Also even though the preview seems to respect higher resolutions (gets that zoomed in effect if using 4:3 formats) the recording itself seems to be capped at FullHD (1920x1080). Using 30 fps and yuv in all of the tests. |
why?
I think that's an issue by the native CameraX library from Google, maybe the recording doesn't support changing resolution yet? You could play around with the following code: react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraView.kt Lines 359 to 362 in 1c32726
|
working on a fix here: #325 |
That actually works to unlock proper aspect ratios for recordings. Still this: format={
device?.formats?.filter(
format =>
format.videoWidth === 4032 &&
format.videoHeight === 3024 &&
format.colorSpaces.includes("yuv"),
)[0]
} records at 1600x1200 max so might indeed be CameraX issue. Still much better than it getting locked to 1920x1080. As for presets on android vs just only format, ease of use and sensible defaults are always compelling use cases🙂 |
|
I'll try to find out why CameraX is locked to 1920x1080 🤔 |
I was kinda afraid that is the case. Still it's not a showstopper or anything just a nice convenience feature. As for the other, it is not locked to 1920x1080 anymore. Just the upper range got capped to 1920x1080 previously (now the upper range at least follows aspect ratio of the given format, so 4032x3024 is 1600x 1200). You could still go lower (even before the proposed change) like 1280x720 and that would work. |
btw instead of Oh btw you're running VisionCamera from master right? Could you please go into |
I'm actually running vision camera on a feature branch of a production app and both the VisionCamera master. But will try asap. |
Because somehow I'm getting this error on Android since I've added wondering if you're seeing the same or if console.logging works for you |
wow, amazing. Think I can promote the I also think it's amazing that your camera says 60 FPS since I thought CameraX only supports 30 FPS? 🤨 |
oh yeah I see - that's because CameraX doesn't expose the video width/height in a format - everything's loosely coupled. I'll try to open a feature request for CameraX, but this is out of my hands |
Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3. I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here? Here's an instruction on how you can test that: #1674 (comment) If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉 Thank you! |
What were you trying to do?
Setting the preset has no effect on recording quality on Android. Whatever preset is chosen, recorded quality is always 19201080 FullHD. This also somewhat relatedly raises the question is the frameBuffer, surface(preview) and recording the same size. Sidenote, I remember being able to change each of those to be independent in Flutter with a library hack (preview on Android was capped to 1280720 max for whatever reason).
What happened instead?
Nothing happens :(
Relevant log output
No response
Device
Pixel 4a
VisionCamera Version
latest master
Additional information
The text was updated successfully, but these errors were encountered: