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

🐛 App crash for LEGACY camera device with video set to true #907

Closed
3 of 4 tasks
capriine opened this issue Mar 15, 2022 · 26 comments · Fixed by #1466
Closed
3 of 4 tasks

🐛 App crash for LEGACY camera device with video set to true #907

capriine opened this issue Mar 15, 2022 · 26 comments · Fixed by #1466
Labels
🐛 bug Something isn't working

Comments

@capriine
Copy link

What were you trying to do?

Using the example app from 2.12.2, the app crashes for me when using video={true} for the Camera, running on an older Android 7.1.1 Motorola E4 (Plus) which has LEGACY support for Camera2 API.

Photos seem to be fine.

Things I have checked or tried:

  • I have tried photo={false}, photo={undefined} and omitting photo completely.
  • I checked out the supportsParallelVideoProcessing on https://github.com/mrousavy/react-native-vision-camera/blob/c627febde5c51336be058172d0ed4d19ea47d697/docs/docs/guides/DEVICES.mdx#the-supportsparallelvideoprocessing-prop and everything seems to make sense, the value is false, but I am only trying to do one thing - video.
  • I have tried disableFrameProcessors in gradle.properties, cleaning and re-building.
  • I have tried this on another Motorola phone, running Android 11 and everything seems fine.
  • If I omit photo and video (or set them both to be false) I see the preview - so it does seem to be related to the preview and the video being captured simultaneously.
  • I have tried video={true} with varying values for preset and for format, none seem to work.
  • I tried removing a lot more of the properties for the Camera as well, taking it back to the simple versions in the Guides https://mrousavy.com/react-native-vision-camera/docs/guides/
  • I also removed Reanimated and tried Camera on its own.
  • I can see changes last year to separate the use cases, but the issue still persists for me, so it must be something else in this specific case.

When using Camera2 Probe, my device shows as LEGACY as expected, but after reading around a lot it seems I should be able to record video or photo independently with that.
image

Any advice or suggestions would be very welcome, and if anything else is needed please let me know.
I am happy to help any way I can, as it may help others with some legacy device support.

Reproduceable Code

// Example app from 2.12.2 with one change, photo={false}

              <ReanimatedCamera
                ref={camera}
                style={StyleSheet.absoluteFill}
                device={device}
                format={format}
                fps={fps}
                hdr={enableHdr}
                lowLightBoost={device.supportsLowLightBoost && enableNightMode}
                isActive={isActive}
                onInitialized={onInitialized}
                onError={onError}
                enableZoomGesture={false}
                animatedProps={cameraAnimatedProps}
                photo={false}
                video={true}
                audio={hasMicrophonePermission}
                frameProcessor={device.supportsParallelVideoProcessing ? frameProcessor : undefined}
                orientation="portrait"
                frameProcessorFps={1}
                onFrameProcessorPerformanceSuggestionAvailable={onFrameProcessorSuggestionAvailable}
              />

What happened instead?

App crashes with generic message
image

Relevant log output

// There is more before this, but github won't let me paste it all in for length reasons, so I can add that if needs be via a comment. I couldn't see anything of interest in that part at a glance.
2022-03-15 10:12:04.226 2847-2917/com.mrousavy.camera.example I/VisionCamera: Initializing FrameProcessorRuntimeManager...
2022-03-15 10:12:04.226 2847-2917/com.mrousavy.camera.example I/VisionCamera: Initializing Vision JS-Runtime...
2022-03-15 10:12:04.233 2847-2917/com.mrousavy.camera.example I/VisionCamera: Initialized Vision JS-Runtime!
2022-03-15 10:12:04.233 2847-2917/com.mrousavy.camera.example I/FrameProcessorRuntime: Installing Frame Processor Plugins...
2022-03-15 10:12:04.234 2847-2917/com.mrousavy.camera.example I/VisionCamera: Installing Frame Processor Plugin "__example_plugin"...
2022-03-15 10:12:04.234 2847-2917/com.mrousavy.camera.example I/FrameProcessorRuntime: Successfully installed 1 Frame Processor Plugins!
2022-03-15 10:12:04.234 2847-2917/com.mrousavy.camera.example I/FrameProcessorRuntime: Installing JSI Bindings on JS Thread...
2022-03-15 10:12:04.419 2847-2914/com.mrousavy.camera.example D/SoLoader: About to load: libreactnativeblob.so
2022-03-15 10:12:04.420 2847-2914/com.mrousavy.camera.example D/SoLoader: libreactnativeblob.so not found on /data/data/com.mrousavy.camera.example/lib-main
2022-03-15 10:12:04.420 2847-2914/com.mrousavy.camera.example D/SoLoader: libreactnativeblob.so found on /data/app/com.mrousavy.camera.example-1/lib/arm
2022-03-15 10:12:04.420 2847-2914/com.mrousavy.camera.example D/SoLoader: Not resolving dependencies for libreactnativeblob.so
2022-03-15 10:12:04.422 2847-2914/com.mrousavy.camera.example D/SoLoader: Loaded: libreactnativeblob.so
2022-03-15 10:12:06.260 2847-2914/com.mrousavy.camera.example I/VisionCamera: Installing JSI bindings...
2022-03-15 10:12:06.260 2847-2914/com.mrousavy.camera.example E/VisionCamera: JS-Runtime was null, Frame Processor JSI bindings could not be installed!
2022-03-15 10:12:06.293 2847-2915/com.mrousavy.camera.example D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.android.chrome-2/lib/arm:/data/app/com.android.chrome-2/base.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_cablev2_authenticator.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_chrome.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_config.en.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_extra_icu.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_feedv2.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_survey.apk!/lib/armeabi-v7a:/data/app/com.android.chrome-2/split_weblayer.apk!/lib/armeabi-v7a for namespace 0xb3cc20d0
2022-03-15 10:12:06.302 2847-2915/com.mrousavy.camera.example I/WebViewFactory: Loading com.android.chrome version 99.0.4844.58 (code 484405820)
2022-03-15 10:12:06.368 2847-2915/com.mrousavy.camera.example I/cr_WVCFactoryProvider: Loaded version=99.0.4844.58 minSdkVersion=24 isBundle=true multiprocess=false packageId=2
2022-03-15 10:12:06.398 2847-2915/com.mrousavy.camera.example W/ResourceType: Failure getting entry for 0x7f1408bf (t=19 e=2239) (error -2147483647)
2022-03-15 10:12:06.404 2847-2915/com.mrousavy.camera.example I/cr_LibraryLoader: Successfully loaded native library
2022-03-15 10:12:06.405 2847-2915/com.mrousavy.camera.example I/cr_CachingUmaRecorder: Flushed 8 samples from 8 histograms.
2022-03-15 10:12:06.428 2847-2933/com.mrousavy.camera.example D/libc-netbsd: getaddrinfo: localhost get result from proxy gai_error = 0
2022-03-15 10:12:06.429 2847-2933/com.mrousavy.camera.example I/System.out: [socket][4] connection localhost/127.0.0.1:8097;LocalPort=-1(10000)
2022-03-15 10:12:06.430 2847-2933/com.mrousavy.camera.example D/: [Posix_connect Debug]Process com.mrousavy.camera.example :8097 
2022-03-15 10:12:06.432 2847-2933/com.mrousavy.camera.example I/System.out: [socket][5:-1] exception
2022-03-15 10:12:06.433 2847-2933/com.mrousavy.camera.example I/System.out: close [socket][::/:::-1]
2022-03-15 10:12:06.437 2847-2935/com.mrousavy.camera.example I/System.out: [socket][5] connection localhost/127.0.0.1:8081;LocalPort=-1(10000)
2022-03-15 10:12:06.437 2847-2935/com.mrousavy.camera.example D/: [Posix_connect Debug]Process com.mrousavy.camera.example :8081 
2022-03-15 10:12:06.438 2847-2935/com.mrousavy.camera.example I/System.out: [socket][/127.0.0.1:54592] connected
2022-03-15 10:12:06.599 2847-2847/com.mrousavy.camera.example W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
2022-03-15 10:12:06.608 2847-2915/com.mrousavy.camera.example W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.swmansion.rnscreens.ScreensShadowNode
2022-03-15 10:12:06.652 2847-2943/com.mrousavy.camera.example I/CameraManagerGlobal: Connecting to camera service
2022-03-15 10:12:06.715 2847-2943/com.mrousavy.camera.example D/CameraRepository: Added camera: 0
2022-03-15 10:12:06.718 2847-2943/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:06.720 2847-2943/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:06.730 2847-2943/com.mrousavy.camera.example I/Camera2CameraInfo: Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
2022-03-15 10:12:06.732 2847-2943/com.mrousavy.camera.example D/CameraRepository: Added camera: 1
2022-03-15 10:12:06.733 2847-2943/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:06.734 2847-2943/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:06.735 2847-2847/com.mrousavy.camera.example I/ReactNative: [GESTURE HANDLER] Initialize gesture handler for root view com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView{177c3a9 V.E...... ......ID 0,0-720,1184 #1}
2022-03-15 10:12:06.737 2847-2943/com.mrousavy.camera.example I/Camera2CameraInfo: Device Level: INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
2022-03-15 10:12:06.738 2847-2943/com.mrousavy.camera.example D/CameraValidator: Verifying camera lens facing on nicklaus_fn, lensFacingInteger: null
2022-03-15 10:12:06.745 2847-2940/com.mrousavy.camera.example I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$1>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsInitializedCallback;
2022-03-15 10:12:06.745 2847-2940/com.mrousavy.camera.example I/art:     at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:191)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Object com.mrousavy.camera.CameraViewModule$getAvailableCameraDevices$1.invokeSuspend(java.lang.Object) (CameraViewModule.kt:146)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:106)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:571)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:750)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker() (CoroutineScheduler.kt:678)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run() (CoroutineScheduler.kt:665)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsInitializedCallback" on path: DexPathList[[zip file "/data/app/com.mrousavy.camera.example-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mrousavy.camera.example-1/lib/arm, /data/app/com.mrousavy.camera.example-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:191)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Object com.mrousavy.camera.CameraViewModule$getAvailableCameraDevices$1.invokeSuspend(java.lang.Object) (CameraViewModule.kt:146)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:106)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:571)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:750)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker() (CoroutineScheduler.kt:678)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run() (CoroutineScheduler.kt:665)
2022-03-15 10:12:06.746 2847-2940/com.mrousavy.camera.example I/art: 
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.camera.extensions.ExtensionsManager$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/camera/extensions/impl/InitializerImpl$OnExtensionsDeinitializedCallback;
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:191)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Object com.mrousavy.camera.CameraViewModule$getAvailableCameraDevices$1.invokeSuspend(java.lang.Object) (CameraViewModule.kt:146)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:106)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:571)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:750)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker() (CoroutineScheduler.kt:678)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run() (CoroutineScheduler.kt:665)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.camera.extensions.impl.InitializerImpl$OnExtensionsDeinitializedCallback" on path: DexPathList[[zip file "/data/app/com.mrousavy.camera.example-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mrousavy.camera.example-1/lib/arm, /data/app/com.mrousavy.camera.example-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
2022-03-15 10:12:06.750 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at com.google.common.util.concurrent.ListenableFuture androidx.camera.extensions.ExtensionsManager.getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider) (ExtensionsManager.java:191)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at java.lang.Object com.mrousavy.camera.CameraViewModule$getAvailableCameraDevices$1.invokeSuspend(java.lang.Object) (CameraViewModule.kt:146)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(java.lang.Object) (ContinuationImpl.kt:33)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.DispatchedTask.run() (DispatchedTask.kt:106)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:571)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(kotlinx.coroutines.scheduling.Task) (CoroutineScheduler.kt:750)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker() (CoroutineScheduler.kt:678)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art:     at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run() (CoroutineScheduler.kt:665)
2022-03-15 10:12:06.751 2847-2940/com.mrousavy.camera.example I/art: 
2022-03-15 10:12:06.755 2847-2940/com.mrousavy.camera.example D/ExtenderVersion: No versioning extender found. Falling back to default.
2022-03-15 10:12:06.765 2847-2899/com.mrousavy.camera.example D/OpenGLRenderer: ProgramCache.generateProgram: 34359738371
2022-03-15 10:12:06.775 2847-2899/com.mrousavy.camera.example D/GraphicBuffer: register, handle(0xa9f1fb40) (w:720 h:1280 s:720 f:0x1 u:0x000b00)
2022-03-15 10:12:07.042 2847-2852/com.mrousavy.camera.example I/art: Do partial code cache collection, code=16KB, data=25KB
2022-03-15 10:12:07.044 2847-2852/com.mrousavy.camera.example I/art: After code cache collection, code=16KB, data=25KB
2022-03-15 10:12:07.044 2847-2852/com.mrousavy.camera.example I/art: Increasing code cache capacity to 128KB
2022-03-15 10:12:07.090 2847-2940/com.mrousavy.camera.example W/CameraView: CameraViewModule::getAvailableCameraDevices took: 466 ms
2022-03-15 10:12:07.142 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:12:07.142 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:12:07.142 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:12:07.184 2847-2847/com.mrousavy.camera.example D/CameraView: Lifecycle went from INITIALIZED -> CREATED (isActive: true | isAttachedToWindow: false)
2022-03-15 10:12:07.220 2847-2847/com.mrousavy.camera.example D/CameraView: Lifecycle went from CREATED -> RESUMED (isActive: true | isAttachedToWindow: true)
2022-03-15 10:12:07.240 2847-2899/com.mrousavy.camera.example D/OpenGLRenderer: CacheTexture 4 upload: x, y, width height = 0, 0, 82, 48
2022-03-15 10:12:07.241 2847-2847/com.mrousavy.camera.example D/CameraView: Lifecycle went from RESUMED -> RESUMED (isActive: true | isAttachedToWindow: true)
2022-03-15 10:12:07.241 2847-2847/com.mrousavy.camera.example I/CameraView: Configuring session...
2022-03-15 10:12:07.244 2847-2847/com.mrousavy.camera.example I/CameraView: Configuring session with Camera ID 0 and custom format...
2022-03-15 10:12:07.266 2847-2847/com.mrousavy.camera.example I/CameraView: Using custom format - photo: 4096x2304, video: 4096x2304 @ 30 FPS
2022-03-15 10:12:07.267 2847-2847/com.mrousavy.camera.example I/CameraView: Setting AE_TARGET_FPS_RANGE to 30-30, and SENSOR_FRAME_DURATION to 0
2022-03-15 10:12:07.268 2847-2847/com.mrousavy.camera.example I/CameraView: Adding VideoCapture use-case...
2022-03-15 10:12:07.284 2847-2847/com.mrousavy.camera.example I/CameraView: Attaching 1 use-cases...
2022-03-15 10:12:07.304 2847-2947/com.mrousavy.camera.example I/System.out: [socket][6] connection localhost/127.0.0.1:8081;LocalPort=-1(0)
2022-03-15 10:12:07.304 2847-2947/com.mrousavy.camera.example D/: [Posix_connect Debug]Process com.mrousavy.camera.example :8081 
2022-03-15 10:12:07.307 2847-2947/com.mrousavy.camera.example I/System.out: [socket][/127.0.0.1:54593] connected
2022-03-15 10:12:07.309 2847-2948/com.mrousavy.camera.example I/System.out: [socket][7] connection localhost/127.0.0.1:8081;LocalPort=-1(0)
2022-03-15 10:12:07.309 2847-2948/com.mrousavy.camera.example D/: [Posix_connect Debug]Process com.mrousavy.camera.example :8081 
2022-03-15 10:12:07.314 2847-2948/com.mrousavy.camera.example I/System.out: [socket][/127.0.0.1:54594] connected
2022-03-15 10:12:07.323 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.324 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.325 2847-2847/com.mrousavy.camera.example D/QualitySelector: supportedQualities = [ConstantQuality{value=4, name=SD}]
2022-03-15 10:12:07.325 2847-2847/com.mrousavy.camera.example W/QualitySelector: quality is not supported and will be ignored: ConstantQuality{value=6, name=FHD}
2022-03-15 10:12:07.325 2847-2847/com.mrousavy.camera.example W/QualitySelector: quality is not supported and will be ignored: ConstantQuality{value=5, name=HD}
2022-03-15 10:12:07.325 2847-2847/com.mrousavy.camera.example D/VideoCapture: Found selectedQualities [ConstantQuality{value=4, name=SD}] by QualitySelector{preferredQualities=[ConstantQuality{value=6, name=FHD}, ConstantQuality{value=5, name=HD}, ConstantQuality{value=4, name=SD}], fallbackStrategy=RuleStrategy{fallbackQuality=ConstantQuality{value=6, name=FHD}, fallbackRule=1}}
2022-03-15 10:12:07.326 2847-2852/com.mrousavy.camera.example I/art: Do partial code cache collection, code=36KB, data=62KB
2022-03-15 10:12:07.326 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.326 2847-2847/com.mrousavy.camera.example D/VideoCapture: Set supported resolutions = [720x480]
2022-03-15 10:12:07.328 2847-2852/com.mrousavy.camera.example I/art: After code cache collection, code=36KB, data=62KB
2022-03-15 10:12:07.328 2847-2852/com.mrousavy.camera.example I/art: Increasing code cache capacity to 256KB
2022-03-15 10:12:07.332 2847-2847/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:07.335 2847-2847/com.mrousavy.camera.example D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2022-03-15 10:12:07.335 2847-2847/com.mrousavy.camera.example D/CamcorderProfileResolut: mSupportedResolutions = [800x600, 864x480, 800x480, 720x480, 640x480, 480x368, 480x320, 352x288, 320x240, 176x144]
2022-03-15 10:12:07.336 2847-2847/com.mrousavy.camera.example D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2022-03-15 10:12:07.350 2847-2847/com.mrousavy.camera.example D/DeferrableSurface: Surface created[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@6e58f06}
2022-03-15 10:12:07.354 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.355 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.355 2847-2847/com.mrousavy.camera.example D/QualitySelector: supportedQualities = [ConstantQuality{value=4, name=SD}]
2022-03-15 10:12:07.355 2847-2847/com.mrousavy.camera.example W/QualitySelector: quality is not supported and will be ignored: ConstantQuality{value=6, name=FHD}
2022-03-15 10:12:07.358 2847-2847/com.mrousavy.camera.example W/QualitySelector: quality is not supported and will be ignored: ConstantQuality{value=5, name=HD}
2022-03-15 10:12:07.359 2847-2847/com.mrousavy.camera.example D/VideoCapture: Found selectedQualities [ConstantQuality{value=4, name=SD}] by QualitySelector{preferredQualities=[ConstantQuality{value=6, name=FHD}, ConstantQuality{value=5, name=HD}, ConstantQuality{value=4, name=SD}], fallbackStrategy=RuleStrategy{fallbackQuality=ConstantQuality{value=6, name=FHD}, fallbackRule=1}}
2022-03-15 10:12:07.360 2847-2847/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.360 2847-2847/com.mrousavy.camera.example D/VideoCapture: Set supported resolutions = [720x480]
2022-03-15 10:12:07.361 2847-2847/com.mrousavy.camera.example D/VideoCapture: suggestedResolution = 720x480
2022-03-15 10:12:07.362 2847-2847/com.mrousavy.camera.example D/DeferrableSurface: Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@75d5b63}
2022-03-15 10:12:07.362 2847-2899/com.mrousavy.camera.example D/OpenGLRenderer: ~CanvasContext() 0x92eabd80
2022-03-15 10:12:07.363 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:12:07.364 2847-2847/com.mrousavy.camera.example D/Recorder: Surface is requested in state: INITIALIZING, Current surface: 0
2022-03-15 10:12:07.366 2847-2847/com.mrousavy.camera.example D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2022-03-15 10:12:07.367 2847-2949/com.mrousavy.camera.example D/VideoCapabilities: profile = CamcorderProfileProxy{duration=30, quality=4, fileFormat=2, videoCodec=3, videoBitRate=4500000, videoFrameRate=30, videoFrameWidth=720, videoFrameHeight=480, audioCodec=3, audioBitRate=128000, audioSampleRate=48000, audioChannels=2}
2022-03-15 10:12:07.367 2847-2949/com.mrousavy.camera.example D/Recorder: Using supported quality of ConstantQuality{value=4, name=SD} for surface size 720x480
2022-03-15 10:12:07.367 2847-2949/com.mrousavy.camera.example D/Recorder: MediaSpec contains OUTPUT_FORMAT_AUTO. Using CamcorderProfile to derive VIDEO settings [mime type: video/mp4v-es]
2022-03-15 10:12:07.368 2847-2949/com.mrousavy.camera.example D/VideoConfigUtil: Using single supported VIDEO frame rate: 30
2022-03-15 10:12:07.368 2847-2949/com.mrousavy.camera.example D/VidEncCmcrdrPrflRslvr: Using resolved VIDEO bitrate from CamcorderProfile
2022-03-15 10:12:07.369 2847-2949/com.mrousavy.camera.example D/VideoConfigUtil: Base Bitrate(4500000bps) * Frame Rate Ratio(30 / 30) * Width Ratio(720 / 720) * Height Ratio(480 / 480) = 4500000
2022-03-15 10:12:07.369 2847-2847/com.mrousavy.camera.example D/Recorder: Video source has transitioned to state: ACTIVE_NON_STREAMING
2022-03-15 10:12:07.371 2847-2949/com.mrousavy.camera.example D/VideoEncoder: mMediaFormat = {width=720, height=480, bitrate=4500000, mime=video/mp4v-es, frame-rate=30, i-frame-interval=1, color-format=2130708361}
2022-03-15 10:12:07.371 2847-2847/com.mrousavy.camera.example D/Recorder: Video source transitions to the same state: ACTIVE_NON_STREAMING
2022-03-15 10:12:07.373 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122 ACTIVE
2022-03-15 10:12:07.375 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [] for camera: 0
2022-03-15 10:12:07.375 2847-2847/com.mrousavy.camera.example D/CameraOrientationUtil: getRelativeImageRotation: destRotationDegrees=0, sourceRotationDegrees=90, isOppositeFacing=true, result=90
2022-03-15 10:12:07.376 2847-2847/com.mrousavy.camera.example I/CameraView.performance: Session configured in 135 ms! Camera: androidx.camera.lifecycle.LifecycleCamera@fa9af73
2022-03-15 10:12:07.376 2847-2847/com.mrousavy.camera.example I/CameraView: invokeOnInitialized()
2022-03-15 10:12:07.378 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813 INACTIVE
2022-03-15 10:12:07.379 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [] for camera: 0
2022-03-15 10:12:07.382 2847-2847/com.mrousavy.camera.example D/PreviewView: Surface requested by Preview.
2022-03-15 10:12:07.384 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122 ACTIVE
2022-03-15 10:12:07.386 2847-2847/com.mrousavy.camera.example D/PreviewView: Preview transformation info updated. TransformationInfo{cropRect=Rect(0, 0 - 800, 600), rotationDegrees=90, targetRotation=0}
2022-03-15 10:12:07.386 2847-2847/com.mrousavy.camera.example D/PreviewTransform: Transformation info set: TransformationInfo{cropRect=Rect(0, 0 - 800, 600), rotationDegrees=90, targetRotation=0} 800x600 false
2022-03-15 10:12:07.387 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [] for camera: 0
2022-03-15 10:12:07.390 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use cases [androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813, androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122] now ATTACHED
2022-03-15 10:12:07.394 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: All use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.395 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: mMeteringRepeating is ATTACHED, SessionConfig Surfaces: 2, CaptureConfig Surfaces: 1
2022-03-15 10:12:07.395 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122] for camera: 0
2022-03-15 10:12:07.397 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2022-03-15 10:12:07.397 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
2022-03-15 10:12:07.397 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 32768/64 for video/mp4v-es
2022-03-15 10:12:07.399 2847-2847/com.mrousavy.camera.example I/BufferQueue: [unnamed-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:-1) BufferQueue core=(2847:com.mrousavy.camera.example)
2022-03-15 10:12:07.400 2847-2847/com.mrousavy.camera.example I/BufferQueueConsumer: [unnamed-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:2847) connect(C): consumer=(2847:com.mrousavy.camera.example) controlledByApp=true
2022-03-15 10:12:07.400 2847-2847/com.mrousavy.camera.example I/BufferQueueConsumer: [unnamed-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:2847) setConsumerName: unnamed-2847-0
2022-03-15 10:12:07.400 2847-2847/com.mrousavy.camera.example I/BufferQueueConsumer: [SurfaceTexture-0-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:2847) setConsumerName: SurfaceTexture-0-2847-0
2022-03-15 10:12:07.401 2847-2847/com.mrousavy.camera.example I/BufferQueueConsumer: [SurfaceTexture-0-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:2847) setDefaultBufferSize: width=800 height=600
2022-03-15 10:12:07.401 2847-2847/com.mrousavy.camera.example D/TextureViewImpl: SurfaceTexture available. Size: 800x600
2022-03-15 10:12:07.401 2847-2847/com.mrousavy.camera.example I/BufferQueueConsumer: [SurfaceTexture-0-2847-0](this:0x91e52400,id:0,api:0,p:-1,c:2847) setDefaultBufferSize: width=800 height=600
2022-03-15 10:12:07.402 2847-2847/com.mrousavy.camera.example D/TextureViewImpl: Surface set on Preview.
2022-03-15 10:12:07.404 2847-2899/com.mrousavy.camera.example I/GLConsumer: [SurfaceTexture-0-2847-0] attachToContext
2022-03-15 10:12:07.408 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Resetting Capture Session
2022-03-15 10:12:07.409 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Releasing session in state INITIALIZED
2022-03-15 10:12:07.410 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Attempting to force open the camera.
2022-03-15 10:12:07.412 2847-2943/com.mrousavy.camera.example D/CameraStateRegistry: tryOpenCamera(Camera@3a19e35[id=0]) [Available Cameras: 1, Already Open: false (Previous state: null)] --> SUCCESS
2022-03-15 10:12:07.417 2847-2943/com.mrousavy.camera.example D/CameraStateRegistry: Recalculating open cameras:
    Camera                                       State                 
    -------------------------------------------------------------------
    Camera@ba20117[id=1]                         UNKNOWN               
    Camera@3a19e35[id=0]                         OPENING               
    -------------------------------------------------------------------
    Open count: 1 (Max allowed: 1)
2022-03-15 10:12:07.418 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Opening camera.
2022-03-15 10:12:07.418 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Transitioning camera internal state: INITIALIZED --> OPENING
2022-03-15 10:12:07.419 2847-2943/com.mrousavy.camera.example D/CameraStateMachine: New public camera state CameraState{type=OPENING, error=null} from OPENING and null
2022-03-15 10:12:07.419 2847-2943/com.mrousavy.camera.example D/CameraStateMachine: Publishing new public camera state CameraState{type=OPENING, error=null}
2022-03-15 10:12:07.424 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: All use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.431 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unsupported mime video/x-ms-wmv
2022-03-15 10:12:07.434 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unsupported mime video/divx
2022-03-15 10:12:07.438 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unsupported mime video/divx3
2022-03-15 10:12:07.441 2847-2943/com.mrousavy.camera.example I/CameraManager: Using legacy camera HAL.
2022-03-15 10:12:07.442 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unsupported mime video/xvid
2022-03-15 10:12:07.447 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unsupported mime video/flv1
2022-03-15 10:12:07.451 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2022-03-15 10:12:07.497 2847-2950/com.mrousavy.camera.example D/Camera-JNI: (tid:2950)[MtkJNICameraContext] this:0x91ef9540 camera->getStrongCount(3) 
2022-03-15 10:12:07.527 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813 INACTIVE
2022-03-15 10:12:07.530 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122] for camera: 0
2022-03-15 10:12:07.539 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122 ACTIVE
2022-03-15 10:12:07.543 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122] for camera: 0
2022-03-15 10:12:07.549 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Use case androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813 ACTIVE
2022-03-15 10:12:07.551 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.556 2847-2949/com.mrousavy.camera.example I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2022-03-15 10:12:07.557 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.564 2847-2949/com.mrousavy.camera.example W/AudioCapabilities: Unsupported mime audio/ac3
2022-03-15 10:12:07.566 2847-2949/com.mrousavy.camera.example W/AudioCapabilities: Unsupported mime audio/eac3
2022-03-15 10:12:07.568 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Issue capture request
2022-03-15 10:12:07.570 2847-2949/com.mrousavy.camera.example W/AudioCapabilities: Unsupported mime audio/eac3-joc
2022-03-15 10:12:07.570 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.572 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2022-03-15 10:12:07.576 2847-2949/com.mrousavy.camera.example I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2022-03-15 10:12:07.578 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2022-03-15 10:12:07.580 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} CameraDevice.onOpened()
2022-03-15 10:12:07.580 2847-2949/com.mrousavy.camera.example I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2022-03-15 10:12:07.580 2847-2943/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Transitioning camera internal state: OPENING --> OPENED
2022-03-15 10:12:07.582 2847-2943/com.mrousavy.camera.example D/CameraStateRegistry: Recalculating open cameras:
    Camera                                       State                 
    -------------------------------------------------------------------
    Camera@ba20117[id=1]                         UNKNOWN               
    Camera@3a19e35[id=0]                         OPEN                  
    -------------------------------------------------------------------
    Open count: 1 (Max allowed: 1)
2022-03-15 10:12:07.582 2847-2943/com.mrousavy.camera.example D/CameraStateMachine: New public camera state CameraState{type=OPEN, error=null} from OPEN and null
2022-03-15 10:12:07.583 2847-2943/com.mrousavy.camera.example D/CameraStateMachine: Publishing new public camera state CameraState{type=OPEN, error=null}
2022-03-15 10:12:07.583 2847-2949/com.mrousavy.camera.example I/MediaCodec: name=null isType=false encoder=false
2022-03-15 10:12:07.583 2847-2949/com.mrousavy.camera.example D/DebugUtils: [Start] Dump MediaCodecList for mediaFormat {width=720, height=480, bitrate=4500000, mime=video/mp4v-es, frame-rate=30, i-frame-interval=1, color-format=2130708361}
2022-03-15 10:12:07.584 2847-2949/com.mrousavy.camera.example W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2022-03-15 10:12:07.585 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: All use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.586 2847-2949/com.mrousavy.camera.example D/DebugUtils: [Start] [OMX.MTK.VIDEO.ENCODER.MPEG4]
2022-03-15 10:12:07.586 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] isFormatSupported = false
2022-03-15 10:12:07.586 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] getDefaultFormat = {mime=video/mp4v-es, bitrate-mode=1}
2022-03-15 10:12:07.588 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] profileLevels = [{level=1, profile=1}, {level=2, profile=1}, {level=4, profile=1}, {level=8, profile=1}, {level=16, profile=1}, {level=32, profile=1}, {level=64, profile=1}, {level=128, profile=1}]
2022-03-15 10:12:07.588 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] colorFormats = [2130706944, 2130708361, 2135033992, 2135033992, 2130706944, 19, 6, 11, 16, 2130707200, 15]
2022-03-15 10:12:07.588 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getBitrateRange = [1, 8000000]
2022-03-15 10:12:07.589 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedWidths = [176, 176], getWidthAlignment = 16
2022-03-15 10:12:07.589 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedHeights = [144, 144], getHeightAlignment = 16
2022-03-15 10:12:07.590 2847-2949/com.mrousavy.camera.example V/VideoCapabilities: could not get supported heights for 720
2022-03-15 10:12:07.591 2847-2949/com.mrousavy.camera.example W/DebugUtils: [VideoCaps] could not getSupportedHeightsFor 720
    java.lang.IllegalArgumentException: unsupported width
        at android.media.MediaCodecInfo$VideoCapabilities.getSupportedHeightsFor(MediaCodecInfo.java:1378)
        at androidx.camera.video.internal.DebugUtils.dumpVideoCapabilities(DebugUtils.java:218)
        at androidx.camera.video.internal.DebugUtils.dumpCodecCapabilities(DebugUtils.java:176)
        at androidx.camera.video.internal.DebugUtils.dumpMediaCodecListForFormat(DebugUtils.java:146)
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:87)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214)
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294)
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998)
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396)
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2022-03-15 10:12:07.591 2847-2949/com.mrousavy.camera.example V/VideoCapabilities: could not get supported widths for 480
2022-03-15 10:12:07.593 2847-2949/com.mrousavy.camera.example W/DebugUtils: [VideoCaps] could not getSupportedWidthsFor 480
    java.lang.IllegalArgumentException: unsupported height
        at android.media.MediaCodecInfo$VideoCapabilities.getSupportedWidthsFor(MediaCodecInfo.java:1334)
        at androidx.camera.video.internal.DebugUtils.dumpVideoCapabilities(DebugUtils.java:224)
        at androidx.camera.video.internal.DebugUtils.dumpCodecCapabilities(DebugUtils.java:176)
        at androidx.camera.video.internal.DebugUtils.dumpMediaCodecListForFormat(DebugUtils.java:146)
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:87)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214)
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294)
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998)
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396)
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2022-03-15 10:12:07.593 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] isSizeSupported for 720x480 = false
2022-03-15 10:12:07.594 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedFrameRates = [12, 60]
2022-03-15 10:12:07.594 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.MTK.VIDEO.ENCODER.MPEG4] does not support mime video/mp4v-es
2022-03-15 10:12:07.595 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.MTK.VIDEO.ENCODER.H263] does not support mime video/mp4v-es
2022-03-15 10:12:07.595 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.MTK.VIDEO.ENCODER.AVC] does not support mime video/mp4v-es
2022-03-15 10:12:07.595 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.aac.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.596 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.amrnb.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.597 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.amrwb.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.597 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.flac.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.597 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.h263.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.597 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.h264.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.598 2847-2949/com.mrousavy.camera.example I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2022-03-15 10:12:07.598 2847-2943/com.mrousavy.camera.example D/UseCaseAttachState: Active and attached use case: [androidx.camera.video.VideoCapture-2f48f7d1-b482-4139-b6d5-eef735d4964878584122, androidx.camera.core.Preview-2047891d-b2d8-4151-bb1c-374234ee657e144627813] for camera: 0
2022-03-15 10:12:07.599 2847-2949/com.mrousavy.camera.example D/DebugUtils: [Start] [OMX.google.mpeg4.encoder]
2022-03-15 10:12:07.599 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] isFormatSupported = false
2022-03-15 10:12:07.600 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] getDefaultFormat = {mime=video/mp4v-es, bitrate-mode=1}
2022-03-15 10:12:07.600 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] profileLevels = [{level=8, profile=4}]
2022-03-15 10:12:07.600 2847-2949/com.mrousavy.camera.example D/DebugUtils: [CodecCaps] colorFormats = [2135033992, 19, 21, 2130708361]
2022-03-15 10:12:07.600 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getBitrateRange = [1, 64000]
2022-03-15 10:12:07.601 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedWidths = [16, 176], getWidthAlignment = 16
2022-03-15 10:12:07.602 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedHeights = [16, 144], getHeightAlignment = 16
2022-03-15 10:12:07.603 2847-2949/com.mrousavy.camera.example V/VideoCapabilities: could not get supported heights for 720
2022-03-15 10:12:07.604 2847-2949/com.mrousavy.camera.example W/DebugUtils: [VideoCaps] could not getSupportedHeightsFor 720
    java.lang.IllegalArgumentException: unsupported width
        at android.media.MediaCodecInfo$VideoCapabilities.getSupportedHeightsFor(MediaCodecInfo.java:1378)
        at androidx.camera.video.internal.DebugUtils.dumpVideoCapabilities(DebugUtils.java:218)
        at androidx.camera.video.internal.DebugUtils.dumpCodecCapabilities(DebugUtils.java:176)
        at androidx.camera.video.internal.DebugUtils.dumpMediaCodecListForFormat(DebugUtils.java:146)
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:87)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214)
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294)
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998)
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396)
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2022-03-15 10:12:07.604 2847-2949/com.mrousavy.camera.example V/VideoCapabilities: could not get supported widths for 480
2022-03-15 10:12:07.605 2847-2949/com.mrousavy.camera.example W/DebugUtils: [VideoCaps] could not getSupportedWidthsFor 480
    java.lang.IllegalArgumentException: unsupported height
        at android.media.MediaCodecInfo$VideoCapabilities.getSupportedWidthsFor(MediaCodecInfo.java:1334)
        at androidx.camera.video.internal.DebugUtils.dumpVideoCapabilities(DebugUtils.java:224)
        at androidx.camera.video.internal.DebugUtils.dumpCodecCapabilities(DebugUtils.java:176)
        at androidx.camera.video.internal.DebugUtils.dumpMediaCodecListForFormat(DebugUtils.java:146)
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:87)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214)
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294)
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998)
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396)
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2022-03-15 10:12:07.605 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] isSizeSupported for 720x480 = false
2022-03-15 10:12:07.605 2847-2949/com.mrousavy.camera.example D/DebugUtils: [VideoCaps] getSupportedFrameRates = [12, 60]
2022-03-15 10:12:07.605 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.mpeg4.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.606 2847-2949/com.mrousavy.camera.example W/DebugUtils: [OMX.google.vp8.encoder] does not support mime video/mp4v-es
2022-03-15 10:12:07.607 2847-2949/com.mrousavy.camera.example D/DebugUtils: [End] Dump MediaCodecList
2022-03-15 10:12:07.610 2847-2944/com.mrousavy.camera.example D/SyncCaptureSessionBase: [androidx.camera.camera2.internal.SynchronizedCaptureSessionImpl@2190866] getSurface...done
2022-03-15 10:12:07.610 2847-2949/com.mrousavy.camera.example E/Recorder: Unable to initialize video encoder.
    androidx.camera.video.internal.encoder.InvalidConfigException: Encoder cannot created: null
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:88)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214)
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294)
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998)
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396)
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
     Caused by: java.lang.NullPointerException
        at android.media.MediaCodec.native_setup(Native Method)
        at android.media.MediaCodec.<init>(MediaCodec.java:1794)
        at android.media.MediaCodec.createByCodecName(MediaCodec.java:1772)
        at androidx.camera.video.internal.workaround.EncoderFinder.findEncoder(EncoderFinder.java:85)
        at androidx.camera.video.internal.encoder.EncoderImpl.<init>(EncoderImpl.java:214) 
        at androidx.camera.video.Recorder.setupVideo(Recorder.java:1294) 
        at androidx.camera.video.Recorder.initializeInternal(Recorder.java:998) 
        at androidx.camera.video.Recorder.lambda$onSurfaceRequested$0$Recorder(Recorder.java:396) 
        at androidx.camera.video.-$$Lambda$Recorder$rmXiULQ5PEuoeWjV80ajHa1DeFE.run(lambda) 
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:111) 
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231) 
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
        at java.lang.Thread.run(Thread.java:761) 
2022-03-15 10:12:07.610 2847-2949/com.mrousavy.camera.example D/Recorder: Transitioning Recorder internal state: INITIALIZING --> ERROR
2022-03-15 10:12:07.615 2847-2944/com.mrousavy.camera.example D/Camera2CameraImpl: {Camera@3a19e35[id=0]} Posting surface closed
    java.lang.Throwable
        at androidx.camera.camera2.internal.Camera2CameraImpl.postSurfaceClosedError(Camera2CameraImpl.java:1174)
        at androidx.camera.camera2.internal.Camera2CameraImpl$2.onFailure(Camera2CameraImpl.java:1116)
        at androidx.camera.core.impl.utils.futures.Futures$CallbackListener.run(Futures.java:340)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:231)
        at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:173)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
2022-03-15 10:12:07.616 2847-2847/com.mrousavy.camera.example D/DeferrableSurface: surface closed,  useCount=0 closed=true androidx.camera.core.SurfaceRequest$2@75d5b63
2022-03-15 10:12:07.616 2847-2847/com.mrousavy.camera.example D/DeferrableSurface: Surface terminated[total_surfaces=1, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@75d5b63}
2022-03-15 10:12:07.617 2847-2847/com.mrousavy.camera.example D/DeferrableSurface: Surface created[total_surfaces=2, used_surfaces=0](androidx.camera.core.SurfaceRequest$2@7490a84}
2022-03-15 10:12:07.618 2847-2847/com.mrousavy.camera.example D/Recorder: Surface is requested in state: ERROR, Current surface: 0
2022-03-15 10:12:07.619 2847-2847/com.mrousavy.camera.example D/AndroidRuntime: Shutting down VM
2022-03-15 10:12:07.620 2847-2847/com.mrousavy.camera.example E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mrousavy.camera.example, PID: 2847
    java.lang.IllegalStateException: Surface was requested when the Recorder had encountered error androidx.camera.video.internal.ResourceCreationException: androidx.camera.video.internal.encoder.InvalidConfigException: Encoder cannot created: null
        at androidx.camera.video.Recorder.onSurfaceRequested(Recorder.java:406)
        at androidx.camera.video.VideoCapture.createPipeline(VideoCapture.java:416)
        at androidx.camera.video.VideoCapture.resetPipeline(VideoCapture.java:482)
        at androidx.camera.video.VideoCapture.lambda$createPipeline$0$VideoCapture(VideoCapture.java:433)
        at androidx.camera.video.-$$Lambda$VideoCapture$6BBmhv2eFVUcrkw2nD0ve39oNMM.onError(lambda)
        at androidx.camera.camera2.internal.Camera2CameraImpl.lambda$postSurfaceClosedError$14(Camera2CameraImpl.java:1175)
        at androidx.camera.camera2.internal.-$$Lambda$Camera2CameraImpl$mXKgpn7oCoUsbBlL_FtX0cw1qkM.run(lambda)
        at android.os.Handler.handleCallback(Handler.java:836)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:203)
        at android.app.ActivityThread.main(ActivityThread.java:6339)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)
2022-03-15 10:12:13.754 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:12:13.754 2847-2856/com.mrousavy.camera.example D/Camera-JNI: (tid:2856)[release camera] - X context=0x0 
2022-03-15 10:17:03.513 2847-3221/? I/System.out: close [socket][/127.0.0.1:54587]

Device

Motorola E4 Plus, Android 7.1.1

VisionCamera Version

2.12.2

Additional information

@capriine capriine added the 🐛 bug Something isn't working label Mar 15, 2022
@mrousavy
Copy link
Owner

Hey!

Thank you so much for the detailed issue report. This is nice to work with.

Have you tried removing frameProcessor as well?

@capriine
Copy link
Author

Thanks for the reply, really appreciate it.

And no worries, I wouldn't even raise a ticket if I hadn't been through as much as I could without running out of ideas, so everything I found was put onto the ticket to try and help out.

I just tried the example app again without frameProcessor, and the same happens.
The log output to logcat is identical (except from the timestamps)

Also ran it with

              <ReanimatedCamera
                ref={camera}
                style={StyleSheet.absoluteFill}
                device={device}
                // format={format}
                preset={'low'}
                // fps={fps}
                // hdr={enableHdr}
                // lowLightBoost={device.supportsLowLightBoost && enableNightMode}
                isActive={isActive}
                // onInitialized={onInitialized}
                // onError={onError}
                // enableZoomGesture={false}
                // animatedProps={cameraAnimatedProps}
                photo={false}
                video={true}
                audio={false}
                // frameProcessor={device.supportsParallelVideoProcessing ? frameProcessor : undefined}
                // orientation="portrait"
                // frameProcessorFps={1}
                // onFrameProcessorPerformanceSuggestionAvailable={onFrameProcessorSuggestionAvailable}
              />```
which was also the same.

@pierroo
Copy link

pierroo commented Apr 19, 2022

Hi @capriine , by any chance, did you find a solution for this issue?
Some of my users also face the same issue which leads to google play errors "java.lang.IllegalStateException"

@huseyintamer
Copy link

Anyone found a solution?

@huseyintamer
Copy link

I found solution, my device is OPPO X3 Pro - Android 12

"react-native": "0.66.3",
"react-native-vision-camera": "^2.13.3",
  1. Remove package
  2. Clean phone cache
  3. Restart phone
  4. rm -rf node_modules
  5. npm install

its fixed

@capriine
Copy link
Author

capriine commented May 9, 2022

I haven't had a chance to try it yet on react-native-vision-camera versions above v2.12.2, but will do so this week.

@capriine
Copy link
Author

Just got around to trying this out, and I am still seeing the same behaviour.

I have tried the steps from above by huseyintamer as well as trying a factory reset on the device and a brand new copy of the example project with the latest 2.13.3 release.

@ssoruf
Copy link

ssoruf commented Jul 11, 2022

News?

@Sidebook
Copy link

Just as another data point, I'm seeing the same issue on Xiaomi Redmi Note 11 Pro+ 5G w/ Android 12.

@sc11p
Copy link

sc11p commented Jul 25, 2022

Same on POCO M4 Pro 5G/ Android 12

@ckaznable
Copy link

Based on android/camera-samples#434 I upgraded androidx.camera version to 1.1.0-rc01 and solved the crash problem.

implementation "androidx.camera:camera-core:1.1.0-rc01"
implementation "androidx.camera:camera-camera2:1.1.0-rc01"
implementation "androidx.camera:camera-lifecycle:1.1.0-rc01"
implementation "androidx.camera:camera-video:1.1.0-rc01"

implementation "androidx.camera:camera-view:1.1.0-rc01"
implementation "androidx.camera:camera-extensions:1.1.0-rc01"

However, I still can't record and the following error is displayed.

 "code": "capture/recorder-error", "message": "[capture/recorder-error] The recording failed because the Recorder is in an unrecoverable error state.
When this happens and the output file is generated, the output file is not properly constructed. The application will need to clean up the output file, such as deleting the file. Such an error will usually require creating a new Recorder object to start a new recording.", "userInfo": null}

My device is Redmi 10C/ Android 11.

@Sidebook
Copy link

android/camera-samples#450 also seems related, upgrading androidx.camera version to 1.2.0 may solve the issue.
(I haven't been able to find time to try it, though)

@adembacajmemmo
Copy link

adembacajmemmo commented Sep 23, 2022

Did anyone managed to solve this issue? I just got some reports from Bugsnag from users with Oppo devices. They had exactly the same issue.

@hirbod
Copy link
Contributor

hirbod commented Sep 24, 2022

Looks like the issue is solved with the camera-library 1.2.0-beta02 - but this requires to bump the compileSdkVersion to 33, which currently does break expo-dev-menu for me. So I could not finally verify it.

@hirbod
Copy link
Contributor

hirbod commented Sep 24, 2022

I got reports back that changing to

  implementation "androidx.camera:camera-core:1.1.0"
  implementation "androidx.camera:camera-camera2:1.1.0"
  implementation "androidx.camera:camera-lifecycle:1.1.0"
  implementation "androidx.camera:camera-video:1.1.0"

  implementation "androidx.camera:camera-view:1.1.0"
  implementation "androidx.camera:camera-extensions:1.1.0"

was enough and fixed the issues. I don't have reports about recording issues, but those might still happen on other devices. Ultimately, we need an upgrade to 1.2.0

@parthasarathi95
Copy link

parthasarathi95 commented Sep 29, 2022

Facing the same issue on Realme Narzo 30 Pro 5G (Android 12) and camera hardware support level is LEVEL_3, while setting the video={true} app is crashing. Any solutions?

@sylvobravo
Copy link

implementation "androidx.camera:camera-core:1.2.0-beta02"
    implementation "androidx.camera:camera-camera2:1.2.0-beta02"
    implementation "androidx.camera:camera-lifecycle:1.2.0-beta02"
    implementation "androidx.camera:camera-video:1.2.0-beta02"
    implementation "androidx.camera:camera-view:1.2.0-beta02"
    implementation "androidx.camera:camera-extensions:1.2.0-beta02"

adding the above to your build.gradle should probably fix it

@adembacajmemmo
Copy link

adembacajmemmo commented Oct 14, 2022

I got reports back that changing to

  implementation "androidx.camera:camera-core:1.1.0"
  implementation "androidx.camera:camera-camera2:1.1.0"
  implementation "androidx.camera:camera-lifecycle:1.1.0"
  implementation "androidx.camera:camera-video:1.1.0"

  implementation "androidx.camera:camera-view:1.1.0"
  implementation "androidx.camera:camera-extensions:1.1.0"

was enough and fixed the issues. I don't have reports about recording issues, but those might still happen on other devices. Ultimately, we need an upgrade to 1.2.0

This one fixed the issue for us. We had issues on specific devices like Oppo, Motorola etc...

@pierroo
Copy link

pierroo commented Oct 14, 2022

I am sorry if the question sounds stupid, but where are we supposed to add those lines above?
And how do we know which version of androidx camera we are actually using?

@wygarner
Copy link

I am sorry if the question sounds stupid, but where are we supposed to add those lines above?
And how do we know which version of androidx camera we are actually using?

You can create a patch for react-native-vision-camera using patch-package and postinstall-postinstall

  1. yarn add patch-package postinstall-postinstall --dev
  2. add "postinstall": "patch-package" to "scripts" in your package.json
  3. In node_modules/react-native-vision-camera/android/build.gradle find the lines mentioned above, change them to the lines in 🐛 App crash for LEGACY camera device with video set to true #907 (comment), then save your changes
  4. run yarn patch-package react-native-vision-camera

Your patch will be saved in your project directory and will be applied when you run the project

@subhadeepquantiantech
Copy link

I got reports back that changing to

  implementation "androidx.camera:camera-core:1.1.0"
  implementation "androidx.camera:camera-camera2:1.1.0"
  implementation "androidx.camera:camera-lifecycle:1.1.0"
  implementation "androidx.camera:camera-video:1.1.0"

  implementation "androidx.camera:camera-view:1.1.0"
  implementation "androidx.camera:camera-extensions:1.1.0"

was enough and fixed the issues. I don't have reports about recording issues, but those might still happen on other devices. Ultimately, we need an upgrade to 1.2.0

working:D

@xeroxoid
Copy link

Can confirm that using version 1.1.0 in android/app/build.gradle solves the issue.

@xeroxoid
Copy link

Created PR #1425 which should fix the issue, although I guess it could be updated to 1.2.0 too.

@subhadeepquantiantech
Copy link

implementation "androidx.camera:camera-core:1.1.0"
implementation "androidx.camera:camera-camera2:1.1.0"
implementation "androidx.camera:camera-lifecycle:1.1.0"
implementation "androidx.camera:camera-video:1.1.0"

implementation "androidx.camera:camera-view:1.1.0"
implementation "androidx.camera:camera-extensions:1.1.0"

@izuutech
Copy link

I got reports back that changing to

  implementation "androidx.camera:camera-core:1.1.0"
  implementation "androidx.camera:camera-camera2:1.1.0"
  implementation "androidx.camera:camera-lifecycle:1.1.0"
  implementation "androidx.camera:camera-video:1.1.0"

  implementation "androidx.camera:camera-view:1.1.0"
  implementation "androidx.camera:camera-extensions:1.1.0"

was enough and fixed the issues. I don't have reports about recording issues, but those might still happen on other devices. Ultimately, we need an upgrade to 1.2.0

This seemed to solve the issue on a Tecno Camon 20 Pro (Android 13) But what exactly does this do

@mrousavy
Copy link
Owner

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! 🎉
Otherwise please let me know and I'll keep this issue open to keep track of it.

Thank you!

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

Successfully merging a pull request may close this issue.