video_editor icon indicating copy to clipboard operation
video_editor copied to clipboard

[Refactor] remove ffmpeg_kit dependency and add web implementation

Open maRci002 opened this issue 1 year ago • 7 comments

closes #146

This PR contains the following:

  • Removed the dependency on the ffmpeg_kit package.
  • Created FFmpegConfig to improve video and cover export functionality.
  • Added an example demonstrating how to export video and cover images using either ffmpeg_kit or ffmpeg_wasm, depending on the platform.
  • Updated the video_thumbnail version to 0.6.0.
  • Updated the project to work on the web.
  • Updated the documentation to reflect these changes.

Breaking changes

  • Replaced File with XFile in VideoEditorController.file.
  • Removed VideoEditorController.getMetaData.
  • Removed VideoEditorController.exportVideo.
  • Removed VideoEditorController.extractCover.

Still need:

  • [x] Merge PR for redleafsofts/flutter_ffmpeg_wasm#1
  • [ ] Merge PR for justsoft/video_thumbnail#135
  • [ ] Remove git and local path from pubspec.yaml, this needs the Pull Requests to be merged.
  • [x] Update documentation how to create custom export, especially the executeFFmpegWeb and executeFFmpegIO methods in the example.
  • [x] When CropScreen is closed the VideoPlayer is black
    • Problem: flutter/flutter#124210 using two VideoPlayer at the same time: CropGridViewer.preview / CropGridViewer.edit
    • Solution: since we never show two video players side by side at the same time, the VideoPlayer key must change as soon as we are done cropping
  • [x] Check why cropStyle: const CropGridStyle(background: Colors.transparent), is needed on the web. It seems that Path.combine breaks on the web.

Please refer to the redleafsofts/flutter_ffmpeg_wasm#1 README for instructions on how to run ffmpeg_wasm on the web.

This is what it looks like on the web (using HTML renderer):

https://user-images.githubusercontent.com/8436039/231599361-de6faade-c7ed-4514-86e0-7cfce1f6b195.mp4

maRci002 avatar Apr 07 '23 23:04 maRci002