Flutter Camera video recording throw error on Android 6.0.1
1,073
try using lower the preset value of CameraController
new CameraController(cameras[0], ResolutionPreset.low);
Author by
Taleb
Updated on December 07, 2022Comments
-
Taleb over 1 year
I'm using camera plugin for take photo and video recording in the android. every thing is ok in the most of devices with high api, but i got error when i want to startVideoRecording or stopVideoRecording in the some devices with low api.
Here are the logs i'm getting after start recording the video.
I/Timeline( 2896): Timeline: Activity_idle id: android.os.BinderProxy@22d8a63 time:49383500 I/Timeline( 2896): Timeline: Activity_idle id: android.os.BinderProxy@22d8a63 time:49384645 I/Timeline( 2896): Timeline: Activity_idle id: android.os.BinderProxy@22d8a63 time:49385598 I/CameraManagerGlobal( 2896): Connecting to camera service I/CameraManager( 2896): Using legacy camera HAL. I/CameraDeviceState( 2896): Legacy camera service transitioning to state CONFIGURING I/RequestThread-0( 2896): Configure outputs: 2 surfaces configured. D/Camera ( 2896): app passed NULL surface I/RequestThread-0( 2896): configureOutputs - set take picture size to 1920x1080 I/CameraDeviceState( 2896): Legacy camera service transitioning to state IDLE I/RequestQueue( 2896): Repeating capture request set. W/LegacyRequestMapper( 2896): convertRequestMetadata - control.awbRegions setting is not supported, ignoring value W/LegacyRequestMapper( 2896): Only received metering rectangles with weight 0. W/LegacyRequestMapper( 2896): Only received metering rectangles with weight 0. I/CameraDeviceState( 2896): Legacy camera service transitioning to state CAPTURING I/RequestQueue( 2896): Repeating capture request cancelled. I/CameraDeviceState( 2896): Legacy camera service transitioning to state IDLE E/CameraDevice-0-LE( 2896): Surface with size (w=1920, h=1080) and format 0x1 is not valid, size not in valid set: [1280x960, 1280x720, 640x480, 480x640, 352x288, 320x240, 240x320, 176x144, 144x176] W/CameraDevice-JV-0( 2896): Stream configuration failed E/CameraCaptureSession( 2896): Session 1: Failed to create capture session; configuration failed
log of Flutter doctor -v :
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.14.6 18G5033, locale en-US) • Flutter version 1.22.1 at /Users/taleb/Developer/flutter • Framework revision f30b7f4db9 (13 days ago), 2020-10-08 10:06:30 -0700 • Engine revision 75bef9f6c8 • Dart version 2.10.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) • Android SDK at /Users/taleb/Library/Android/sdk • Platform android-30, build-tools 30.0.2 • ANDROID_HOME = /Users/taleb/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 11.0) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.0, Build version 11A420a • CocoaPods version 1.8.3 [!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) [!] IntelliJ IDEA Ultimate Edition (version 2019.3) • IntelliJ at /Applications/IntelliJ IDEA.app ✗ Flutter plugin not installed; this adds Flutter specific functionality. • Dart plugin version 193.5731 • For information about installing plugins, see https://flutter.dev/intellij-setup/#installing-the-plugins [✓] Connected device (1 available) • P024 (mobile) • 192.168.43.200:5555 • android-arm • Android 6.0.1 (API 23) ! Doctor found issues in 2 categories.
-
genericUser over 1 yearWow... I really don't know why, but this solution solved my issue. Thanks.
-
genericUser over 1 yearMy resolution was at "max", but converting it to low, medium, or even high performed much better.