Skip to content
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

🐛 Camera Preview does not align with taken picture #2853

Open
4 of 5 tasks
Zoxive opened this issue May 7, 2024 · 5 comments
Open
4 of 5 tasks

🐛 Camera Preview does not align with taken picture #2853

Zoxive opened this issue May 7, 2024 · 5 comments
Labels
🐛 bug Something isn't working

Comments

@Zoxive
Copy link

Zoxive commented May 7, 2024

What's happening?

After upgrading to v4 (from v3) the preview with resizeMode='contain' is not respecting the cameraFormats aspect ratios.

In my use-case for react-native-vision-camera, I need to allow my users to align fairly precisely with the Preview view so when they do take a picture its aligned.
I am using ML models for object detection, but at the moment after the picture is taken. (I've already dabbled with frame processors to do the ML, but I have some improvements in my ML model to do first)

In the Example App, resizeMode is not used. Is the resizeMode prop mostly dead with v4?

Example Reproduction Code: https://github.com/Zoxive/ReactNativeVisionCamera_PreviewBug

Video Recordings Examples

using resizeMode = 'contain'

visioncamera_contain.mp4
  • Viewport is specified in ReactNative to be 16:9, but there are still blackbars on the Preview, and my image & video aspect ratio is also 16:9 specified via the cameraFormat
  • After taking the picture lots of cropping is done, thus making it very difficult to take pictures that need some sort of alignments

using resizeMode = 'cover'

visioncamera_cover.mp4
  • Cover is closer to what is desired, but still not perfect
  • Cover feels like the preview is zoomed in to fit.

Possibly Similar Issue: #2843

Reproduceable Code

const targetFps = 30;
const cameraFormat: FormatFilter[] = [{ fps: targetFps }, { photoAspectRatio: 16 / 9 }, { videoAspectRatio: 16 / 9 }];

function ViewPort() {
	const device = useCameraDevice("back");
	const format = useCameraFormat(device, cameraFormat);
	const fps = Math.min(format?.maxFps ?? 1, targetFps);

	const child =
		device != null ? (
			<Camera
				device={device}
				format={format}
				photo={true}
				fps={fps}
				isActive={true}
				style={styles.camera}
				resizeMode="contain"
			/>
		) : null;

	return <View style={styles.viewPort}>{child}</View>;
}

const styles = StyleSheet.create({
	container: {
		flex: 1,
		backgroundColor: "#fff",
		flexDirection: "column",
	},
	viewPort: {
		aspectRatio: 9 / 16,
		backgroundColor: "red",
	},
});

Relevant log output

2024-05-07 12:30:52.512 12630-12630 nativeloader            com.waschlogic.visioncamerapreview   D  Configuring clns-5 for other apk /data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/lib/arm64:/data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.waschlogic.visioncamerapreview
2024-05-07 12:30:52.525 12630-12630 GraphicsEnvironment     com.waschlogic.visioncamerapreview   V  Currently set values for:
2024-05-07 12:30:52.525 12630-12630 GraphicsEnvironment     com.waschlogic.visioncamerapreview   V    angle_gl_driver_selection_pkgs=[]
2024-05-07 12:30:52.525 12630-12630 GraphicsEnvironment     com.waschlogic.visioncamerapreview   V    angle_gl_driver_selection_values=[]
2024-05-07 12:30:52.525 12630-12630 GraphicsEnvironment     com.waschlogic.visioncamerapreview   V  Global.Settings values are invalid: number of packages: 0, number of values: 0
2024-05-07 12:30:52.525 12630-12630 GraphicsEnvironment     com.waschlogic.visioncamerapreview   V  Neither updatable production driver nor prerelease driver is supported.
2024-05-07 12:30:52.653 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 279646685; UID 10434; state: DISABLED
2024-05-07 12:30:52.661 12630-12630 SoLoader                com.waschlogic.visioncamerapreview   W  Initializing SoLoader: 0
2024-05-07 12:30:52.664 12630-12630 SoLoader                com.waschlogic.visioncamerapreview   W  Recording new base apk path: /data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/base.apk
                                                                                                    Previously recorded 0 base apk paths.
2024-05-07 12:30:52.848 12630-12630 SoLoader                com.waschlogic.visioncamerapreview   W  SoLoader initialized: 8
2024-05-07 12:30:52.877 12630-12630 SoLoader                com.waschlogic.visioncamerapreview   W  SoLoader already initialized
2024-05-07 12:30:52.941 12630-12630 Sensors                 com.waschlogic.visioncamerapreview   W  Cannot get virtualdevice_native service
2024-05-07 12:30:53.003 12630-12658 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(79) with statsTag=0xffffffff, statsUid=-1
2024-05-07 12:30:54.507 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden field Landroid/view/View;->mKeyedTags:Landroid/util/SparseArray; (unsupported, reflection, allowed)
2024-05-07 12:30:54.507 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden field Landroid/view/View;->mListenerInfo:Landroid/view/View$ListenerInfo; (unsupported, reflection, allowed)
2024-05-07 12:30:54.507 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden field Landroid/view/View$ListenerInfo;->mOnClickListener:Landroid/view/View$OnClickListener; (unsupported, reflection, allowed)
2024-05-07 12:30:54.511 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::addPlugin Inspector
2024-05-07 12:30:54.513 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::addPlugin Databases
2024-05-07 12:30:54.516 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::addPlugin Preferences
2024-05-07 12:30:54.517 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::addPlugin CrashReporter
2024-05-07 12:30:54.519 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::addPlugin Network
2024-05-07 12:30:54.534 12630-12656 System.err              com.waschlogic.visioncamerapreview   W  SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
2024-05-07 12:30:54.534 12630-12656 System.err              com.waschlogic.visioncamerapreview   W  SLF4J: Defaulting to no-operation (NOP) logger implementation
2024-05-07 12:30:54.534 12630-12656 System.err              com.waschlogic.visioncamerapreview   W  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2024-05-07 12:30:54.538 12630-12666 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(89) with statsTag=0x90000, statsUid=-1
2024-05-07 12:30:54.559 12630-12670 vulkan                  com.waschlogic.visioncamerapreview   D  searching for layers in '/data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/lib/arm64'
2024-05-07 12:30:54.561 12630-12670 vulkan                  com.waschlogic.visioncamerapreview   D  searching for layers in '/data/app/~~mJMrWxma8pG1j-CMST0Msg==/com.waschlogic.visioncamerapreview-xEBcxEV0uDXSEOu97iYQTw==/base.apk!/lib/arm64-v8a'
2024-05-07 12:30:54.563 12630-12670 DMABUFHEAPS             com.waschlogic.visioncamerapreview   I  Using DMA-BUF heap named: vframe-secure
2024-05-07 12:30:54.589 12630-12630 AppCompatDelegate       com.waschlogic.visioncamerapreview   D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2024-05-07 12:30:54.596 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 309578419; UID 10434; state: DISABLED
2024-05-07 12:30:54.611 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden field Ljava/lang/reflect/Field;->accessFlags:I (unsupported, reflection, allowed)
2024-05-07 12:30:54.621 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 232195501; UID 10434; state: DISABLED
2024-05-07 12:30:54.637 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2024-05-07 12:30:54.637 12630-12630 oncamerapreview         com.waschlogic.visioncamerapreview   W  Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2024-05-07 12:30:54.655 12630-12630 ExpoDevMenu             com.waschlogic.visioncamerapreview   I  Set new dev-menu delegate: class expo.modules.devmenu.DevMenuDefaultDelegate
2024-05-07 12:30:54.664 12630-12630 ContentCaptureHelper    com.waschlogic.visioncamerapreview   I  Setting logging level to OFF
2024-05-07 12:30:54.672 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 237531167; UID 10434; state: DISABLED
2024-05-07 12:30:54.708 12630-12687 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(78) with statsTag=0xffffffff, statsUid=-1
2024-05-07 12:30:55.092 12630-12669 SoLoader                com.waschlogic.visioncamerapreview   W  SoLoader already initialized
2024-05-07 12:30:55.178 12630-12630 ContentCaptureHelper    com.waschlogic.visioncamerapreview   I  Setting logging level to OFF
2024-05-07 12:30:55.191 12630-12630 VRI[MainActivity]       com.waschlogic.visioncamerapreview   D  visibilityChanged oldVisibility=true newVisibility=false
2024-05-07 12:30:55.202 12630-12630 unknown:ReactNative     com.waschlogic.visioncamerapreview   W  Packager connection already open, nooping.
2024-05-07 12:30:55.270 12630-12630 VRI[MainActivity]       com.waschlogic.visioncamerapreview   D  Not drawing due to not visible
2024-05-07 12:30:55.306 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 210923482; UID 10434; state: ENABLED
2024-05-07 12:30:55.307 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 63938206; UID 10434; state: DISABLED
2024-05-07 12:30:55.436 12630-12630 WindowOnBackDispatcher  com.waschlogic.visioncamerapreview   W  sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda11@3833026
2024-05-07 12:30:56.552 12630-12710 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(132) with statsTag=0x90000, statsUid=-1
2024-05-07 12:30:58.154 12630-12630 WindowOnBackDispatcher  com.waschlogic.visioncamerapreview   W  sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda11@d8e35
2024-05-07 12:30:58.577 12630-12714 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(111) with statsTag=0x90000, statsUid=-1
2024-05-07 12:30:59.711 12630-12642 oncamerapreview         com.waschlogic.visioncamerapreview   W  Cleared Reference was only reachable from finalizer (only reported once)
2024-05-07 12:30:59.777 12630-12713 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ AppContext was initialized
2024-05-07 12:30:59.790 12630-12713 CameraManagerGlobal     com.waschlogic.visioncamerapreview   I  Connecting to camera service
2024-05-07 12:30:59.827 12630-12630 unknown:ReactNative     com.waschlogic.visioncamerapreview   W  Packager connection already open, nooping.
2024-05-07 12:30:59.869 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.traceupdateoverlay.TraceUpdateOverlayManager
2024-05-07 12:30:59.880 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
2024-05-07 12:30:59.887 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
2024-05-07 12:30:59.892 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
2024-05-07 12:30:59.899 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
2024-05-07 12:30:59.901 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
2024-05-07 12:30:59.904 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
2024-05-07 12:30:59.907 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
2024-05-07 12:30:59.914 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
2024-05-07 12:30:59.918 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
2024-05-07 12:30:59.920 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
2024-05-07 12:30:59.923 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
2024-05-07 12:30:59.925 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
2024-05-07 12:30:59.928 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
2024-05-07 12:30:59.933 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
2024-05-07 12:30:59.937 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
2024-05-07 12:30:59.938 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
2024-05-07 12:30:59.939 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
2024-05-07 12:30:59.940 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
2024-05-07 12:30:59.949 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
2024-05-07 12:30:59.955 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
2024-05-07 12:30:59.960 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
2024-05-07 12:30:59.962 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
2024-05-07 12:30:59.969 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
2024-05-07 12:30:59.970 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
2024-05-07 12:30:59.972 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
2024-05-07 12:30:59.975 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class expo.modules.kotlin.views.GroupViewManagerWrapper
2024-05-07 12:30:59.984 12630-12721 unknown:Vi...rtyUpdater com.waschlogic.visioncamerapreview   W  Could not find generated setter for class com.mrousavy.camera.react.CameraViewManager
2024-05-07 12:31:00.010 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 119147584; UID 10434; state: ENABLED
2024-05-07 12:31:00.026 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::removePlugin CrashReporter
2024-05-07 12:31:00.027 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::removePlugin Network
2024-05-07 12:31:00.027 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::removePlugin Databases
2024-05-07 12:31:00.027 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::removePlugin Preferences
2024-05-07 12:31:00.027 12630-12630 flipper                 com.waschlogic.visioncamerapreview   I  flipper: FlipperClient::removePlugin Inspector
2024-05-07 12:31:00.029 12630-12630 System.err              com.waschlogic.visioncamerapreview   W  java.lang.ClassNotFoundException: com.waschlogic.visioncamerapreview.ReactNativeFlipper
2024-05-07 12:31:00.047 12630-12630 SoLoader                com.waschlogic.visioncamerapreview   W  SoLoader already initialized
2024-05-07 12:31:00.053 12630-12725 CameraDevices           com.waschlogic.visioncamerapreview   I  Initializing ProcessCameraProvider...
2024-05-07 12:31:00.054 12630-12721 CameraDevices           com.waschlogic.visioncamerapreview   I  Camera #0 is now available.
2024-05-07 12:31:00.054 12630-12721 CameraDevices           com.waschlogic.visioncamerapreview   I  Camera #1 is now available.
2024-05-07 12:31:00.086 12630-12724 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ AppContext was initialized
2024-05-07 12:31:00.129 12630-12729 CameraRepository        com.waschlogic.visioncamerapreview   D  Added camera: 0
2024-05-07 12:31:00.170 12630-12729 Camera2CameraInfo       com.waschlogic.visioncamerapreview   I  Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL
2024-05-07 12:31:00.178 12630-12729 CameraRepository        com.waschlogic.visioncamerapreview   D  Added camera: 1
2024-05-07 12:31:00.189 12630-12729 Camera2CameraInfo       com.waschlogic.visioncamerapreview   I  Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_FULL
2024-05-07 12:31:00.192 12630-12729 CameraValidator         com.waschlogic.visioncamerapreview   D  Verifying camera lens facing on raven, lensFacingInteger: null
2024-05-07 12:31:00.197 12630-12735 CameraDevices           com.waschlogic.visioncamerapreview   I  Initializing ExtensionsManager...
2024-05-07 12:31:00.208 12630-12735 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Extension device library version 1.4.0
2024-05-07 12:31:00.209 12630-12735 ExtenderVersion         com.waschlogic.visioncamerapreview   D  Selected vendor runtime: 1.4.0
2024-05-07 12:31:00.210 12630-12735 ExtensionsManager       com.waschlogic.visioncamerapreview   D  Successfully initialized extensions
2024-05-07 12:31:00.227 12630-12735 CameraDevices           com.waschlogic.visioncamerapreview   I  Successfully initialized!
2024-05-07 12:31:00.268 12630-12735 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 206033068; UID 10434; state: ENABLED
2024-05-07 12:31:00.272 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=72000000, frameRate=60, width=3840, height=2160, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.275 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=33000000, frameRate=60, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.277 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.279 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=6000000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.281 12630-12735 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:00.297 12630-12735 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:00.310 12630-12735 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:00.382 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=22000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.384 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.386 12630-12735 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=6000000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:00.388 12630-12735 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
2024-05-07 12:31:00.399 12630-12735 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:00.406 12630-12735 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:00.497 12630-12721 ziparchive              com.waschlogic.visioncamerapreview   W  Unable to open '/data/app/~~XoMIJeLhQLcV30zmlY_iEw==/com.google.android.trichromelibrary_631212133-ej6Xo-q5f8YLNYYctx-_wA==/base.dm': No such file or directory
2024-05-07 12:31:00.499 12630-12721 oncamerapreview         com.waschlogic.visioncamerapreview   W  Entry not found
2024-05-07 12:31:00.502 12630-12721 nativeloader            com.waschlogic.visioncamerapreview   D  Configuring clns-6 for other apk /data/app/~~XoMIJeLhQLcV30zmlY_iEw==/com.google.android.trichromelibrary_631212133-ej6Xo-q5f8YLNYYctx-_wA==/base.apk. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/lib/arm64:/data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/base.apk!/lib/arm64-v8a:/data/app/~~XoMIJeLhQLcV30zmlY_iEw==/com.google.android.trichromelibrary_631212133-ej6Xo-q5f8YLNYYctx-_wA==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
2024-05-07 12:31:00.502 12630-12721 nativeloader            com.waschlogic.visioncamerapreview   D  Extending system_exposed_libraries: libedgetpu_dba.google.so
2024-05-07 12:31:00.516 12630-12721 nativeloader            com.waschlogic.visioncamerapreview   D  Configuring clns-7 for other apk /data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/lib/arm64:/data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/base.apk!/lib/arm64-v8a:/data/app/~~XoMIJeLhQLcV30zmlY_iEw==/com.google.android.trichromelibrary_631212133-ej6Xo-q5f8YLNYYctx-_wA==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand
2024-05-07 12:31:00.529 12630-12721 WebViewFactory          com.waschlogic.visioncamerapreview   I  Loading com.google.android.webview version 123.0.6312.121 (code 631212133)
2024-05-07 12:31:00.558 12630-12721 cr_WVCFactoryProvider   com.waschlogic.visioncamerapreview   I  Loaded version=123.0.6312.121 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
2024-05-07 12:31:00.578 12630-12740 chromium                com.waschlogic.visioncamerapreview   I  [0507/123100.578170:INFO:variations_seed_loader.cc(66)] Failed to open file for reading.: No such file or directory (2)
2024-05-07 12:31:00.588 12630-12656 flipper                 com.waschlogic.visioncamerapreview   I  flipper: Not started
2024-05-07 12:31:00.595 12630-12721 cr_LibraryLoader        com.waschlogic.visioncamerapreview   I  Successfully loaded native library
2024-05-07 12:31:00.596 12630-12721 cr_CachingUmaRecorder   com.waschlogic.visioncamerapreview   I  Flushed 6 samples from 6 histograms, 0 samples were dropped.
2024-05-07 12:31:00.620 12630-12744 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(167) with statsTag=0xffffffff, statsUid=-1
2024-05-07 12:31:01.194 12630-12720 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ JSI interop was installed
2024-05-07 12:31:01.194 12630-12730 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ JSI interop was installed
2024-05-07 12:31:01.196 12630-12730 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ Constants were exported
2024-05-07 12:31:01.196 12630-12720 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 263076149; UID 10434; state: ENABLED
2024-05-07 12:31:01.203 12630-12720 ExpoModulesCore         com.waschlogic.visioncamerapreview   I  ✅ Constants were exported
2024-05-07 12:31:01.295 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=72000000, frameRate=60, width=3840, height=2160, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.296 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=33000000, frameRate=60, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.296 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.297 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=6000000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.297 12630-12720 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:01.298 12630-12720 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:01.302 12630-12720 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:01.339 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=22000000, frameRate=30, width=1920, height=1080, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.340 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=12000000, frameRate=30, width=1280, height=720, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.340 12630-12720 CapabilitiesByQuality   com.waschlogic.visioncamerapreview   D  profiles = ImmutableEncoderProfilesProxy{defaultDurationSeconds=60, recommendedFileFormat=2, audioProfiles=[AudioProfileProxy{codec=3, mediaType=audio/mp4a-latm, bitrate=96000, sampleRate=48000, channels=1, profile=1}], videoProfiles=[VideoProfileProxy{codec=2, mediaType=video/avc, bitrate=6000000, frameRate=30, width=720, height=480, profile=-1, bitDepth=8, chromaSubsampling=0, hdrFormat=0}]}
2024-05-07 12:31:01.341 12630-12720 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=270, isOppositeFacing=false, result=270
2024-05-07 12:31:01.342 12630-12720 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:01.345 12630-12720 ExtenderVersionImpl     com.waschlogic.visioncamerapreview   D  Advanced Extensions Implemented 
2024-05-07 12:31:02.650 12630-12720 ReactNativeJS           com.waschlogic.visioncamerapreview   I  Running "main" with {"rootTag":11}
2024-05-07 12:31:02.664 12630-12745 TrafficStats            com.waschlogic.visioncamerapreview   D  tagSocket(168) with statsTag=0xffffffff, statsUid=-1
2024-05-07 12:31:03.294 12630-12721 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 289878283; UID 10434; state: ENABLED
2024-05-07 12:31:03.349 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera Lifecycle changed to CREATED!
2024-05-07 12:31:03.352 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  Updating CameraSession...
2024-05-07 12:31:03.360 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  Updating CameraSession...
2024-05-07 12:31:03.360 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  Updating CameraSession...
2024-05-07 12:31:03.361 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  Updating CameraSession...
2024-05-07 12:31:03.362 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Waiting for lock...
2024-05-07 12:31:03.363 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  A new configure { ... } call arrived, aborting this one...
2024-05-07 12:31:03.369 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Waiting for lock...
2024-05-07 12:31:03.369 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  A new configure { ... } call arrived, aborting this one...
2024-05-07 12:31:03.369 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Waiting for lock...
2024-05-07 12:31:03.369 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  A new configure { ... } call arrived, aborting this one...
2024-05-07 12:31:03.370 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Waiting for lock...
2024-05-07 12:31:03.370 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Updating CameraSession Configuration... Difference(deviceChanged=true, outputsChanged=true, sidePropsChanged=true, isActiveChanged=true, locationChanged=true)
2024-05-07 12:31:03.370 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Creating new Outputs for Camera #0...
2024-05-07 12:31:03.371 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Using FPS Range: [30, 30]
2024-05-07 12:31:03.371 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Creating Preview output...
2024-05-07 12:31:03.377 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Creating Photo output...
2024-05-07 12:31:03.378 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Photo size: 4032x2268
2024-05-07 12:31:03.383 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Successfully created new Outputs for Camera #0!
2024-05-07 12:31:03.383 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Binding Camera #0...
2024-05-07 12:31:03.383 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Binding 2 use-cases...
2024-05-07 12:31:03.403 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.403 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.418 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.420 12630-12630 DynamicRangeResolver    com.waschlogic.visioncamerapreview   D  Resolved dynamic range for use case androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b to no compatible HDR dynamic ranges.
                                                                                                    DynamicRange@1811d4e{encoding=UNSPECIFIED, bitDepth=0}
                                                                                                    ->
                                                                                                    DynamicRange@bacd049{encoding=SDR, bitDepth=8}
2024-05-07 12:31:03.437 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.438 12630-12630 DeferrableSurface       com.waschlogic.visioncamerapreview   D  Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.processing.SurfaceEdge$SettableSurface@1ba828b}
2024-05-07 12:31:03.443 12630-12630 DeferrableSurface       com.waschlogic.visioncamerapreview   D  Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@3ccbc67}
2024-05-07 12:31:03.447 12630-12630 DeferrableSurface       com.waschlogic.visioncamerapreview   D  New surface in use[total_surfaces=2, used_surfaces=1](androidx.camera.core.SurfaceRequest$2@3ccbc67}
2024-05-07 12:31:03.447 12630-12630 DeferrableSurface       com.waschlogic.visioncamerapreview   D  use count+1, useCount=1 androidx.camera.core.SurfaceRequest$2@3ccbc67
2024-05-07 12:31:03.448 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.456 12630-12630 ImageCapture            com.waschlogic.visioncamerapreview   D  createPipeline(cameraId: 0, streamSpec: StreamSpec{resolution=4032x2268, dynamicRange=DynamicRange@bacd049{encoding=SDR, bitDepth=8}, expectedFrameRateRange=[30, 30], implementationOptions=androidx.camera.camera2.impl.Camera2ImplConfig@4377380})
2024-05-07 12:31:03.462 12630-12630 Compatibil...geReporter com.waschlogic.visioncamerapreview   D  Compat change id reported: 236825255; UID 10434; state: ENABLED
2024-05-07 12:31:03.463 12630-12630 DeferrableSurface       com.waschlogic.visioncamerapreview   D  Surface created[total_surfaces=3, used_surfaces=1](androidx.camera.core.impl.ImmediateSurface@5cd5db9}
2024-05-07 12:31:03.472 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Successfully bound Camera #0!
2024-05-07 12:31:03.473 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use case androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250 ACTIVE
2024-05-07 12:31:03.473 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera Lifecycle changed to STARTED!
2024-05-07 12:31:03.473 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [] for camera: 0
2024-05-07 12:31:03.474 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnStopped()
2024-05-07 12:31:03.477 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use case androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109 ACTIVE
2024-05-07 12:31:03.477 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera State: CLOSED (has error: false)
2024-05-07 12:31:03.477 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera Lifecycle changed to RESUMED!
2024-05-07 12:31:03.477 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [] for camera: 0
2024-05-07 12:31:03.477 12630-12630 MetadataProvider        com.waschlogic.visioncamerapreview   I  Stopping location updates...
2024-05-07 12:31:03.477 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  configure { ... }: Completed CameraSession Configuration! (State: RESUMED)
2024-05-07 12:31:03.479 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use case androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250 ACTIVE
2024-05-07 12:31:03.479 12630-12630 PreviewView             com.waschlogic.visioncamerapreview   D  Surface requested by Preview.
2024-05-07 12:31:03.479 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [] for camera: 0
2024-05-07 12:31:03.481 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [] for camera: 0
2024-05-07 12:31:03.484 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use cases [androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109, androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250] now ATTACHED
2024-05-07 12:31:03.485 12630-12630 PreviewView             com.waschlogic.visioncamerapreview   D  Preview transformation info updated. TransformationInfo{getCropRect=Rect(0, 0 - 1600, 1200), getRotationDegrees=90, getTargetRotation=-1, hasCameraTransform=true, getSensorToBufferTransform=Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}, isMirroring=false}
2024-05-07 12:31:03.485 12630-12630 PreviewTransform        com.waschlogic.visioncamerapreview   D  Transformation info set: TransformationInfo{getCropRect=Rect(0, 0 - 1600, 1200), getRotationDegrees=90, getTargetRotation=-1, hasCameraTransform=true, getSensorToBufferTransform=Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]}, isMirroring=false} 1600x1200 false
2024-05-07 12:31:03.486 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.486 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  All use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.487 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  mMeteringRepeating is ATTACHED, SessionConfig Surfaces: 2, CaptureConfig Surfaces: 1
2024-05-07 12:31:03.489 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.495 12630-12630 SurfaceViewImpl         com.waschlogic.visioncamerapreview   D  Surface created.
2024-05-07 12:31:03.495 12630-12630 SurfaceViewImpl         com.waschlogic.visioncamerapreview   D  Surface changed. Size: 1600x1200
2024-05-07 12:31:03.496 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Resetting Capture Session
2024-05-07 12:31:03.498 12630-12630 SurfaceViewImpl         com.waschlogic.visioncamerapreview   D  Surface set on Preview.
2024-05-07 12:31:03.498 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Releasing session in state INITIALIZED
2024-05-07 12:31:03.501 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Attempting to force open the camera.
2024-05-07 12:31:03.502 12630-12729 CameraStateRegistry     com.waschlogic.visioncamerapreview   D  tryOpenCamera(Camera@1b0e9ca[id=0]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS
2024-05-07 12:31:03.504 12630-12729 CameraStateRegistry     com.waschlogic.visioncamerapreview   D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@1b0e9ca[id=0]                         OPENING               
                                                                                                    Camera@7c071ed[id=1]                         UNKNOWN               
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
2024-05-07 12:31:03.508 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Opening camera.
2024-05-07 12:31:03.509 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
2024-05-07 12:31:03.509 12630-12729 CameraStateMachine      com.waschlogic.visioncamerapreview   D  New public camera state CameraState{type=OPENING, error=null} from OPENING and null
2024-05-07 12:31:03.509 12630-12729 CameraStateMachine      com.waschlogic.visioncamerapreview   D  Publishing new public camera state CameraState{type=OPENING, error=null}
2024-05-07 12:31:03.510 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera State: OPENING (has error: false)
2024-05-07 12:31:03.511 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  All use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.561 12630-12721 CameraDevices           com.waschlogic.visioncamerapreview   I  Camera #0 is now unavailable.
2024-05-07 12:31:03.577 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use case androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109 ACTIVE
2024-05-07 12:31:03.578 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.583 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Use case androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250 ACTIVE
2024-05-07 12:31:03.584 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.589 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} CameraDevice.onOpened()
2024-05-07 12:31:03.590 12630-12729 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Transitioning camera internal state: OPENING --> OPENED
2024-05-07 12:31:03.591 12630-12729 CameraStateRegistry     com.waschlogic.visioncamerapreview   D  Recalculating open cameras:
                                                                                                    Camera                                       State                 
                                                                                                    -------------------------------------------------------------------
                                                                                                    Camera@1b0e9ca[id=0]                         OPEN                  
                                                                                                    Camera@7c071ed[id=1]                         UNKNOWN               
                                                                                                    -------------------------------------------------------------------
                                                                                                    Open count: 1 (Max allowed: 1)
2024-05-07 12:31:03.592 12630-12729 CameraStateMachine      com.waschlogic.visioncamerapreview   D  New public camera state CameraState{type=OPEN, error=null} from OPEN and null
2024-05-07 12:31:03.592 12630-12729 CameraStateMachine      com.waschlogic.visioncamerapreview   D  Publishing new public camera state CameraState{type=OPEN, error=null}
2024-05-07 12:31:03.592 12630-12630 CameraSession           com.waschlogic.visioncamerapreview   I  Camera State: OPEN (has error: false)
2024-05-07 12:31:03.592 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnInitialized()
2024-05-07 12:31:03.593 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  All use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.599 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:03.604 12630-12729 SyncCaptureSessionBase  com.waschlogic.visioncamerapreview   D  [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@4310c0c] getSurface done with results: [Surface(name=null)/@0x5cebcb0, Surface(name=null)/@0x68c6b3f]
2024-05-07 12:31:03.604 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  Opening capture session.
2024-05-07 12:31:03.609 12630-12729 SyncCaptureSessionImpl  com.waschlogic.visioncamerapreview   D  [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@4310c0c] start openCaptureSession
2024-05-07 12:31:03.610 12630-12729 DeferrableSurface       com.waschlogic.visioncamerapreview   D  use count+1, useCount=2 androidx.camera.core.SurfaceRequest$2@3ccbc67
2024-05-07 12:31:03.610 12630-12729 DeferrableSurface       com.waschlogic.visioncamerapreview   D  New surface in use[total_surfaces=3, used_surfaces=2](androidx.camera.core.impl.ImmediateSurface@5cd5db9}
2024-05-07 12:31:03.610 12630-12729 DeferrableSurface       com.waschlogic.visioncamerapreview   D  use count+1, useCount=1 androidx.camera.core.impl.ImmediateSurface@5cd5db9
2024-05-07 12:31:03.716 12630-12729 SyncCaptureSessionImpl  com.waschlogic.visioncamerapreview   D  [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@4310c0c] Session onConfigured()
2024-05-07 12:31:03.716 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  Attempting to send capture request onConfigured
2024-05-07 12:31:03.716 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  Issuing request for session.
2024-05-07 12:31:03.717 12630-12729 Camera2Cap...estBuilder com.waschlogic.visioncamerapreview   D  createCaptureRequest
2024-05-07 12:31:03.721 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  CameraCaptureSession.onConfigured() mState=OPENED
2024-05-07 12:31:03.722 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  CameraCaptureSession.onReady() OPENED
2024-05-07 12:31:03.766 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:03.850 12630-12734 StreamStateObserver     com.waschlogic.visioncamerapreview   D  Update Preview stream state to STREAMING
2024-05-07 12:31:03.850 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnStarted()
2024-05-07 12:31:04.366 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:05.367 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:06.366 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:07.367 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:08.123 12630-12630 CameraView              com.waschlogic.visioncamerapreview   D  Finding view 23...
2024-05-07 12:31:08.124 12630-12630 CameraView              com.waschlogic.visioncamerapreview   D  Found view 23!
2024-05-07 12:31:08.125 12630-12735 CameraView.takePhoto    com.waschlogic.visioncamerapreview   I  Taking photo... Options: {}
2024-05-07 12:31:08.131 12630-12735 CameraSession           com.waschlogic.visioncamerapreview   I  Ringer mode is silent (1), disabling shutter sound...
2024-05-07 12:31:08.134 12630-12630 ImageCapture            com.waschlogic.visioncamerapreview   D  takePictureInternal
2024-05-07 12:31:08.135 12630-12630 CameraOrientationUtil   com.waschlogic.visioncamerapreview   D  getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2024-05-07 12:31:08.136 12630-12630 TakePictureManager      com.waschlogic.visioncamerapreview   D  Issue the next TakePictureRequest.
2024-05-07 12:31:08.140 12630-12729 UseCaseAttachState      com.waschlogic.visioncamerapreview   D  Active and attached use case: [androidx.camera.core.ImageCapture-b24bb578-50eb-40f9-a0f7-4581b51b2384118805250, androidx.camera.core.Preview-e662b30b-1c6b-4fab-bc4f-80884001709b231980109] for camera: 0
2024-05-07 12:31:08.149 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  Attempting to submit CaptureRequest after setting
2024-05-07 12:31:08.149 12630-12729 CaptureSession          com.waschlogic.visioncamerapreview   D  Issuing request for session.
2024-05-07 12:31:08.149 12630-12729 Camera2Cap...estBuilder com.waschlogic.visioncamerapreview   D  createCaptureRequest
2024-05-07 12:31:08.366 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:08.394 12630-12734 Camera2CameraImpl       com.waschlogic.visioncamerapreview   D  {Camera@1b0e9ca[id=0]} Issue capture request
2024-05-07 12:31:08.395 12630-12734 CaptureSession          com.waschlogic.visioncamerapreview   D  Issuing capture request.
2024-05-07 12:31:08.400 12630-12734 Camera2Cap...estBuilder com.waschlogic.visioncamerapreview   D  createCaptureRequest
2024-05-07 12:31:08.600 12630-12630 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnShutter(PHOTO)
2024-05-07 12:31:08.722 12630-12630 TakePictureManager      com.waschlogic.visioncamerapreview   D  Issue the next TakePictureRequest.
2024-05-07 12:31:08.722 12630-12630 TakePictureManager      com.waschlogic.visioncamerapreview   D  No new request.
2024-05-07 12:31:08.818 12630-12725 CameraView.takePhoto    com.waschlogic.visioncamerapreview   I  Successfully captured 4032 x 2268 photo!
2024-05-07 12:31:08.837 12630-12720 ReactNativeJS           com.waschlogic.visioncamerapreview   I  'Photo taken:', { isMirrored: false,
                                                                                                      path: '/data/user/0/com.waschlogic.visioncamerapreview/cache/mrousavy-1438387375724785487.jpg',
                                                                                                      isRawPhoto: false,
                                                                                                      height: 2268,
                                                                                                      orientation: 'portrait',
                                                                                                      width: 4032 }
2024-05-07 12:31:08.854 12630-12642 oncamerapreview         com.waschlogic.visioncamerapreview   I  Background concurrent mark compact GC freed 310239(15MB) AllocSpace objects, 25(1828KB) LOS objects, 75% free, 14MB/56MB, paused 576us,2.189ms total 122.233ms
2024-05-07 12:31:08.873 12630-12644 oncamerapreview         com.waschlogic.visioncamerapreview   W  ApkAssets: Deleting an ApkAssets object '<empty> and /data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/base.apk' with 1 weak references
2024-05-07 12:31:08.873 12630-12644 oncamerapreview         com.waschlogic.visioncamerapreview   W  ApkAssets: Deleting an ApkAssets object '<empty> and /data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/split_config.en.apk' with 1 weak references
2024-05-07 12:31:08.873 12630-12644 oncamerapreview         com.waschlogic.visioncamerapreview   W  ApkAssets: Deleting an ApkAssets object '<empty> and /data/app/~~NJi9Qsr2c0TVPrTE0LAB6w==/com.google.android.webview-YeURprDbDW_P0KOPOAnvdg==/split_config.es.apk' with 1 weak references
2024-05-07 12:31:08.874 12630-12644 oncamerapreview         com.waschlogic.visioncamerapreview   W  ApkAssets: Deleting an ApkAssets object '<empty> and /data/app/~~XoMIJeLhQLcV30zmlY_iEw==/com.google.android.trichromelibrary_631212133-ej6Xo-q5f8YLNYYctx-_wA==/base.apk' with 1 weak references
2024-05-07 12:31:08.963 12630-12630 WindowOnBackDispatcher  com.waschlogic.visioncamerapreview   W  OnBackInvokedCallback is not enabled for the application.
                                                                                                    Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
2024-05-07 12:31:09.182 12630-12630 ExpoModulesCore         com.waschlogic.visioncamerapreview   W  Enum 'class expo.modules.image.enums.ContentFit' should inherit from class expo.modules.kotlin.types.Enumerable.
2024-05-07 12:31:09.366 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)
2024-05-07 12:31:10.367 12630-12746 CameraView              com.waschlogic.visioncamerapreview   I  invokeOnAverageFpsChanged(0.0)

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "full",
  "maxZoom": 20,
  "minZoom": 0.6704425811767578,
  "maxExposure": 24,
  "supportsLowLightBoost": true,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera",
    "wide-angle-camera",
    "ultra-wide-angle-camera",
    "telephoto-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": true,
  "minFocusDistance": 10.500000100135805,
  "minExposure": -24,
  "name": "0 (BACK) androidx.camera.camera2",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

Google Pixel 6 Pro

VisionCamera Version

4.0.3

Can you reproduce this issue in the VisionCamera Example app?

I reproduced with an empty Expo App.

Additional information

@Zoxive Zoxive added the 🐛 bug Something isn't working label May 7, 2024
@Zoxive Zoxive changed the title 🐛 Camera Preview does not align with taken picture 🐛 [V4] Camera Preview does not align with taken picture May 7, 2024
@mrousavy mrousavy changed the title 🐛 [V4] Camera Preview does not align with taken picture 🐛 Camera Preview does not align with taken picture May 8, 2024
@mrousavy
Copy link
Owner

mrousavy commented May 8, 2024

Hey!

Preview is a video-stream, so it uses the aspect ratio from videoResolution/videoAspectRatio in the Format.

You could prioritize video aspect ratio by moving it up, but then the photo still looks different.

I guess some photos just have a different aspect ratio for the photos stream or the video stream.

Does it look proper when you set both photoAspectRatio and videoAspectRatio to 4 / 3? Remove the fps from the filter as well, that may exclude some filters as it is spot 1 (highest priority)

@Zoxive
Copy link
Author

Zoxive commented May 8, 2024

I removed all filters, only put in a videoAspectRatio and nothing changes, also tried combinations of just photoAspectRatio and flipping their order.

It just feels like resizeMode='contain' is hard coded (somewhere) to 4/3 ish.

I think after all this testing, im just going to use resizeMode='cover' (or really just remove the prop as its the default), as that seems like what all example apps use and its fairly close.

TL;DR
After lots of testing i think best practices with v4 is use no resizeMode (aka 'cover'), and ensure that the Preview's <View>'s aspect ratio is the same as your photo format.

And maybe recommend to delete this prop since it doesn't seem to do much with v4 just causes confusion? Or I'm still doing something wrong.

@mrousavy
Copy link
Owner

mrousavy commented May 8, 2024

And maybe recommend to delete this prop since it doesn't seem to do much with v4 just causes confusion?

Not true. On iOS it works fine. Also it does change behaviour on Android. Why would I delete that prop?

@xulihang
Copy link
Contributor

Seems related to this issue: #2845

@gnanamoorthyparameshwaran
Copy link

I am also facing this issue with iPad Pro 10.5 inch(17.4.1) in front camera, for back camera it is working fine and i also tested with android 12 (vivo s1 pro) it is working good.

  const device = useCameraDevice(state.position);

  const format = useCameraFormat(device, [
    {photoAspectRatio: 4 / 3},
    {videoAspectRatio: 4 / 3},
    {
      photoResolution: {
        height: 520,
        width: 390,
      },
    },
    {
      videoResolution: {
        height: 520,
        width: 390,
      },
    },
  ]);

  const CaptureImage = async () => {
    const photo = await cameraRef.current?.takePhoto();
    console.log(photo);
    setState(prev => ({
      ...prev,
      url: photo?.path,
    }));
  };

  return (
    <View style={{flex: 1, backgroundColor: '#fff'}}>
      <View style={{flex: 1}}>
        <Camera
          ref={cameraRef}
          photo
          isActive
          format={format}
          device={device}
          style={{
            // height: 520,
            // width: 390,
            aspectRatio: 3 / 4,
          }}
        />
      </View>
      <View
        style={{
          flexDirection: 'row',
          justifyContent: 'space-evenly',
        }}>
        <Button title="Capture" color={'green'} onPress={CaptureImage} />
        <Button
          title="Switch"
          color={'red'}
          onPress={() => {
            setState(prev => ({
              ...prev,
              position: prev.position == 'front' ? 'back' : 'front',
            }));
          }}
        />
      </View>
    </View>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants