Skip to content

[camera] Taking pictures is too slow on some devices #84957

Open

Description

@nero-angela

Hi, I'm making a camera app with samsung s8 device and camera package.
However, there is a problem with the shooting speed being too slow on the Android device.
It takes about 0.5 to 1.5 second to shoot. (I used camera/example for testing)

The shooting speed on the Android(S8) is too slow, so even if I shoot with the flash on, the flash effect is not applied because the shooting is completed after the flash is off.

I wonder if it's a fundamental problem with the package, or it's a problem that only occurs on my S8.

Steps to Reproduce

  1. Run camera/example with AOS device.
  2. Turn on the flash(torch or always mode).
  3. Press the capture button.
  4. Flash blinks when taking pictures.
  5. When flash is off, pictures are taken.

Expected results:
Photo with flash effect applied.

Actual results:
Photos without flash effect applied.

Activity

  1. TahaTesser commented on Jun 21, 2021

    @TahaTesser
    Contributor

    Hi @nero-angela
    I just tried budget videos, with a much slower process (Samsung M02s) and every pic taken has an on-time flash effect using official sample

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19043.1055], locale en-US)
        • Flutter version 2.2.2 at C:\Users\Taha\Code\flutter_stable
        • Framework revision d79295af24 (10 days ago), 2021-06-11 08:56:01 -0700
        • Engine revision 91c9fc8fe0
        • Dart version 2.13.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at C:\Users\Taha\Code\SDK
        • Platform android-30, build-tools 30.0.3
        • ANDROID_SDK_ROOT = C:\Users\Taha\Code\SDK
        • Java binary at: C:\Users\Taha\Code\openjdk\bin\java.exe
        • Java version OpenJDK Runtime Environment (build 1.8.0-262-b10)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.2)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        • Visual Studio Community 2019 version 16.10.31410.357
        • Windows 10 SDK version 10.0.19041.0
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
    
    [✓] IntelliJ IDEA Community Edition (version 2021.1)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
        • Flutter plugin version 57.0.5
        • Dart plugin version 211.7233
    
    [✓] VS Code (version 1.57.1)
        • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.23.0
    
    [✓] Connected device (5 available)
        • SM M025F (mobile)       • R9ZR205XX0A   • android-arm    • Android 11 (API 30)
        • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
        • Windows (desktop)       • windows       • windows-x64    • Microsoft Windows [Version 10.0.19043.1055]
        • Chrome (web)            • chrome        • web-javascript • Google Chrome 91.0.4472.114
        • Edge (web)              • edge          • web-javascript • Microsoft Edge 91.0.864.48
    
    ! Doctor found issues in 1 category.

    Can you please share Android version you're running? Are you using stock firmware or custom rom?
    Thank you

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 21, 2021
  3. nero-angela commented on Jun 22, 2021

    @nero-angela
    ContributorAuthor

    Hi @TahaTesser

    My android version is Android 9 (API 28) and I am using the S8 after factory reset.

    flutter doctor -v
    [✓] Flutter (Channel unknown, 2.2.0, on macOS 11.3.1 20E241 darwin-x64, locale ko-KR)
        • Flutter version 2.2.0 at /Users/nero/Project/FlutterContribution/flutter
        • Framework revision b22742018b (5 weeks ago), 2021-05-14 19:12:57 -0700
        • Engine revision a9d88a4d18
        • Dart version 2.13.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/nero/Library/Android/sdk
        • Platform android-30, build-tools 29.0.2
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5, Build version 12E262
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 3.6)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 44.0.2
        • Dart plugin version 192.7761
        • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    
    [✓] VS Code (version 1.57.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.23.0
    
    [✓] Connected device (2 available)
        • SM G950N (mobile) • ce0317136a2c08f10c • android-arm64  • Android 9 (API 28)
        • Chrome (web)      • chrome             • web-javascript • Google Chrome 91.0.4472.114
    
    flash_test.mp4
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jun 22, 2021
  5. changed the title [-][camera] Taking pictures is too slow on Android.[/-] [+][camera] Taking pictures is too slow on Galaxy S8[/+] on Jun 22, 2021
  6. added
    P3Issues that are less important to the Flutter project
    on Jun 24, 2021
  7. SunlightBro commented on Jun 25, 2021

    @SunlightBro

    Also reproducible on:

    • ONEPLUS A6003 (mobile) • b0a181c6 • android-arm64 • Android 10 (API 29)

    (This is currently only my own device ... I will update this list, when I can go back to the office, and have more real test devices available ...)

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-arm, locale en-DE)
        • Flutter version 2.2.2 at /Users/davidwimmer/flutter
        • Framework revision d79295af24 (2 weeks ago), 2021-06-11 08:56:01 -0700
        • Engine revision 91c9fc8fe0
        • Dart version 2.13.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/davidwimmer/Library/Android/sdk
        • Platform android-30, build-tools 30.0.3
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] ... all my IDEs ...
    
    [✓] Connected device (2 available)
        • ONEPLUS A6003 (mobile) • b0a181c6 • android-arm64  • Android 10 (API 29)
        • Chrome (web)           • chrome   • web-javascript • Google Chrome 91.0.4472.114
  8. 55 remaining items

  9. delfme commented on Oct 21, 2023

    @delfme

    Thx @Tienisto, just checked the fix on my xiaomi mi lite 5g and it works 👍

  10. SpirikleOfficial commented on Dec 8, 2023

    @SpirikleOfficial
  11. camsim99 commented on Mar 27, 2024

    @camsim99
    Contributor

    This issue should be fixed in the CameraX implementation of the camera plugin, so please try it out!

    If you find a similar issue with that implementation (or any other issues), please feel free to file a separate issue.

  12. vodemn commented on Apr 5, 2024

    @vodemn

    @camsim99
    I've taken several tens of photos of the same scene and on average it took 1753ms with a fix from #84957 (comment) and 358 without it.
    Test code from #134300 (comment)

      camera: 0.10.5+2
      camera_android_camerax: 0.6.1+1
  13. moved this to [CONFIRMED] camera_android issues solved by camera_android_camerax in Android Camera Re-writeon Aug 28, 2024
  14. Buenaventura-Celine commented on Sep 6, 2024

    @Buenaventura-Celine

    I'm experiencing the same issue on a Samsung Galaxy A50s running Android 11. Taking a picture is extremely slow, sometimes taking up to 4-5 seconds. We recently upgraded the camera package from version 0.10.0+4 to 0.11.0+2, which introduced the switch from camera_android to camera_android_camerax. Additionally, we updated Flutter from version 3.13.1 to 3.24.0. I've already implemented the suggested fix mentioned here, but the issue persists. Could anyone help resolve this or at least explain why CameraX is causing such delays in capturing images? I appreciate any assistance.

  15. victkk commented on Oct 2, 2024

    @victkk

    @camsim99
    ugprading from camera 10 to 11 reduce the time from 500ms to 300ms. But I'm looking for something like 50ms, is this possible?

  16. abhitheawesomecoder commented on Dec 16, 2024

    @abhitheawesomecoder
  17. clhey commented on Jun 15, 2025

    @clhey
  18. filio-corp commented on Dec 8, 2025

    @filio-corp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecte: device-specificOnly manifests on certain devicesp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    • Status
      [CONFIRMED] camera_android issues solved by camera_android_camerax

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions