dart-archive / isolate

Makes working with Dart isolates easier.
https://pub.dev/packages/isolate
BSD 3-Clause "New" or "Revised" License
90 stars 34 forks source link

Can we encode using flutter_ffmpeg inside an isolate using this library? #40

Closed aytunch closed 3 years ago

aytunch commented 3 years ago

Encoding with flutter_ffmpeg takes too much time and resources and generates Jank in the UI. So it would be very nice if we could run it inside of an isolate.

Also, is there a straightforward way to allow this isolate to keep on working while the app is in the background?

lrhn commented 3 years ago

This package doesn't do anything you can't do with dart:isolate directly, it just provides a more convenient API on the same functionality. If you can encode using flutter_ffmpeg in your main isolate, you should be able to do it in another isolate, but you'll then have to send the resulting bytes through a send-port/receive-port communication back to the original isolate. I guess you'll have to try it to see if that overhead is a problem.

This package is not Flutter specific, it has no notion of "being in the background", so there is no functionality specific to that. You'll have to look for a way to control that in Flutter.