Skip to content

[camera] Ability to get the current duration of the recorded video #101785

Open
flutter/packages
#13521

Description

@aytunch

Since Camera plugin allows us to pause and resume the recordings, this need is even more important imo.
Is there a way to get the recording duration before calling stopRecording?
Of course we can implement a separate Timer and try to keep track of the recording duration but this solutions won't be exact in milliseconds.
Most of the apps have strict recording limits and being able to stop recording by listening to the camera controller and getting the duration will make everything more stable.
I think that we should be able to get the current recording duration from CameraController.value.

Activity

  1. maheshj01 commented on Apr 13, 2022

    @maheshj01
    Member

    Hi @aytunch, Thanks for filing the issue. The Camera plugin currently doesn't support showing recorded video duration. Labeling this issue as a proposal to get the recorded video duration from the camera plugin.

  2. added
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Apr 13, 2022
  3. added
    P3Issues that are less important to the Flutter project
    on Apr 14, 2022
  4. gikwegbu commented on Jun 30, 2022

    @gikwegbu

    Hi @maheshmnj , does the Camera plugin support a maxDuration, Because currently, any video recording longer than 50seconds, tends to crash my app. Showing

    Clamp target GC heap from 279MB to 256MB

  5. maheshj01 commented on Jul 1, 2022

    @maheshj01
    Member

    @gikwegbu Please file that as a separate issue with all the requested info in the issue template, We would love to take a look.

  6. gikwegbu commented on Jul 4, 2022

    @gikwegbu

    Hi @maheshmnj , thanks for your feedback, so I figured it out, it's mostly on the Android OS issue, as the OS tends to close any application that is consuming lots of RAM while running at the background.

    A solution I found was to add

    android:hardwareAccelerated="false" android:largeHeap="true"

    In my AndroidManifest.xml, and it solved it for me.

  7. reiko-dev commented on Jul 14, 2022

    @reiko-dev
  8. CartmanGD commented on Nov 9, 2022

    @CartmanGD

    Hi @maheshmnj , thanks for your feedback, so I figured it out, it's mostly on the Android OS issue, as the OS tends to close any application that is consuming lots of RAM while running at the background.

    A solution I found was to add

    android:hardwareAccelerated="false" android:largeHeap="true"

    In my AndroidManifest.xml, and it solved it for me.

    try to avoid largeHeap

    https://stackoverflow.com/a/30930239/12695188

  9. added
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Oct 26, 2026
  10. self-assigned this
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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