Skip to content

Add ability record a movie, exposed to Dart code #8245

Closed

Description

@tvolkert

Similar to #8244, but recording movies instead of screenshots.

The raw bytes of the movie will be too big, so we'll need to use libffmpeg to encode it. Any sufficiently compressing codec that's playable in a browser by default will do (mp4 may not be suitable because of licensing requirements). We also don't want to statically link the engine against libffmpeg, so we'll have to dlopen it.

In testing, this will be especially handy when you have continuous integration tests being run in an automated remote environment. Failing tests can provide a link to the movie recording of what the test was doing, which will provide insight into the test failure.

@chinmaygarde

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    engineflutter/engine related. See also e: labels.
    on Feb 17, 2017
  2. tvolkert commented on Feb 17, 2017

    @tvolkert
    ContributorAuthor

    Initial take on what the Dart API would look like (in dart:ui):

    /// Represents a movie recording of the current frame buffer activity.
    class ScreenRecording {
      /// Creates a new `ScreenRecording`.
      ///
      /// Recording will commence immediatly and will continue until [stop] is
      /// called (unless [duration] is specified, in which case the recording will
      /// automatically be stopped after the specified duration).
      ScreenRecording([Duration duration]);
    
      /// Gets the stream of encoded bytes produced by the recording.
      ///
      /// These bytes will be encoded using the <TODO> codec.
      Stream<List<int>> get stream;
    
      /// Stops recording. The recording's [stream] will send a "done" event after
      /// the final bytes of the recording have been sent.
      ///
      /// If the recording is already stopped, a [StateError] will be thrown.
      void stop();
    
      /// Whether the recording has been stopped, either automatically or explicitly
      /// using [stop].
      bool get isStopped;
    }

    We'll have to make it clear in the docs that device deployments will have to bundle libffmpeg in order to be able to use this...

    @abarth for thoughts

  3. added this to the milestone on Feb 18, 2017
  4. ishaan1995 commented on Jul 9, 2019

    @ishaan1995

    @zoechi Is this going to be picked in the near future?
    If not, is there any other way I can achieve this in a graceful manner?
    Would be a good add-on since most of the existing sdk's like appsee and uxcam do not work on flutter ui. I want this for initial testing of my app and see how user's are interacting with it.

  5. removed this from the milestone on Jun 1, 2020
  6. tvolkert commented on Jul 17, 2020

    @tvolkert
    ContributorAuthor

    We're unlikely to do this in the foreseeable future.

    The https://github.com/flutter/assets-for-api-docs repository has code to use a test widgets binding to go one frame at a time, capturing screenshots, then assemble them into a video after the fact. It's how we achieve animations like the one in https://api.flutter.dev/flutter/widgets/Image/loadingBuilder.html

  7. tvolkert commented on Mar 22, 2023

    @tvolkert
    ContributorAuthor

    We're unlikely to ever do this, so closing.

  8. github-actions commented on Apr 5, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Apr 5, 2023
  10. added
    P3Issues that are less important to the Flutter project
    and removed on Jun 28, 2023
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 projecta: tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions