Skip to content

[camera] Add support for capturing current preview frame (Snapshot/Fast Capture) #179064

Open

Description

@leetuanbmt

Use case

Hi team,

We have use cases in our app that require camera preview frames to be saved instantly, with minimal delay, for the following scenarios:

  • Zero Shutter Lag (instant snapshot as soon as user taps the shutter)
  • Photo booth/burst mode (multiple images in quick succession)
  • Realtime AI processing (e.g. face/object detection, OCR, etc.)

Currently, the camera plugin's takePicture() method performs a full photo capture sequence (autofocus, high-res processing, etc), which always adds >1s delay—making it unsuitable for real-time or instant-capture workflows.

Developers are forced to use controller.startImageStream(), then extract/convert raw frame data (YUV420/BGRA8888) into a file/JPEG themselves in Dart. This leads to:

  • Heavy CPU/memory use and UI jank (Dart processing is slow even with Isolates)
  • Complicated platform-specific code
  • Lower reliability compared to native burst/instant-capture support

Proposal

Expose a new API on CameraController, implemented natively, that allows instant snapshot of the current camera preview frame with low latency and zero shutter lag. Example:

/// Captures a JPEG/PNG file from the current preview frame instantly (at preview resolution, not full photo res).
Future<XFile> takePreviewSnapshot();

Details:

  • The method should convert the current preview buffer to a file in platform code (Kotlin/Swift/C++) for maximum speed and minimal CPU impact on Flutter UI thread.
  • Returns the file via XFile in Dart.
  • Should be safe to call even while preview is running (recommended for instant, burst, or AI workflow use).

This would:

  • Enable true instant-capture and photo booth experiences
  • Make burst shooting and low-latency AI workflows feasible without complex Dart-side buffer conversion
  • Unlock competitive camera features in Flutter apps

No current workaround (using Dart/Isolates) matches the performance or reliability of native buffer-to-file logic.

We believe this feature is essential for building modern camera UX in Flutter, and would greatly appreciate your consideration.

Thank you!

Activity

  1. darshankawar commented on Nov 25, 2025

    @darshankawar
    Member

    @leetuanbmt Can you check if your case is similar to #176148 or not ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 25, 2025
  3. leetuanbmt commented on Nov 26, 2025

    @leetuanbmt
    Author

    @darshankawar
    Thank you for asking. After reviewing #176148, our use case (#179064) is different, though both relate to camera performance.

    Differences:

    1. Problem scope:

    2. Solution approach:

    3. Use cases:

    Why they're complementary, not similar:

    They can work together: you could use framesPerSecond to optimize the stream, then call takePreviewSnapshot() to capture a frame from that stream. However, they solve different problems:

    Conclusion:

    These are separate features that address different needs. Both would be valuable for building modern camera experiences in Flutter, but they are not duplicates.

    Thank you for considering both features.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 26, 2025
  5. added
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    packageflutter/packages repository. See also p: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Nov 26, 2025
  6. added
    P2Important issues not at the top of the work list
    on Dec 2, 2025
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

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions