Search code examples
cameradartvideo-streamingflutter

Is it possible to stream a video with flutter camera plugin?


I've been playing around with the camera plugin, I know there's the possibility to capture a video via the CameraController with the functions start/stopVideoRecording, the functions will take a path for a file as an input.

I'd like to be able to stream this video to a server while it's being recorded, is it possible somehow with the current capabilities of the camera plugin?


Solution

  • Looks like it is possible as it was done at Flutter Live with one of the development demos. Check out the YouTube video here . at 24:17. There is a method on the CameraController called getByteStream. The gist of the method shown below.

    void cameraBytesToDetector({@required CameraController camera}){
      camera.startByteStream( (image) {
        // do something with the image stream here
      });
    }
    

    But I can find no reference anywhere as I am also looking for a way to read the video stream.