render icon indicating copy to clipboard operation
render copied to clipboard

Web support

Open polarby opened this issue 3 years ago • 6 comments

Currently the main problem is that ffmpeg and this plugin require to write files to a temporary path. The problem is that web does not support file writings or path_provider does not offer a web solution.

A possible solution might be to have a look at how flutter_sound has managed to conquer web.

polarby avatar Jan 26 '23 07:01 polarby

Currently the main problem is that ffmpeg and this plugin require to write files to a temporary path. The problem is that web does not support file writings or path_provider does not offer a web solution.

A possible solution might be to have a look at how flutter_sound has managed to conquer web.

If FFMPEG is the only problem, Is it possible to use https://pub.dev/packages/ffmpeg_wasm which wraps https://github.com/ffmpegwasm/ffmpeg.wasm JavaScript library? Or will there be any other problem when trying to implement for web? I am planning to try to implement for web.

jayaanandabalaji avatar May 12 '23 11:05 jayaanandabalaji

Great! I didn't know of this package! If you have the knowledge you are the best guy to do this! Thanks a lot!

Right now we write each captured frame to a temporary directory and then process those frames via ffmpeg. As file writing usually is also a problem for web, we might should consider piping them directly to web (not saving, but directly feeding to ffmpeg - a way more effective method, that has not been implemented yet), as mentioned here: #3 (this guy might know more about it). If file writing is not supported by ffmpeg_wasm, maybe another wasm package can help you out there.

I am looking forward to your contribution! I will try to be the best help to you with quickly merging pull requests :) or give you more info regarding the package.

polarby avatar May 12 '23 11:05 polarby

I have used ffmpeg_wasm in another project for a web application. It works great and may be implemented in this plugin.

The following things would need to be done:

  1. Write a universal_ffmpeg.dart file for this plugin, where both mobile & web can be handled. With the basic execution command run(List<String> command) and file management (write file to web ffmpeg).

  2. Reopen and Merge the #15 piping frames ffmpeg (but only exclusively for the web - and maybe even configurable as settings in RenderController)

  3. Configure web & ffmpeg_wasm instructions in index.dart

Time projection: 5-8h (2h code, 3-6 debug)

polarby avatar Jul 07 '23 10:07 polarby

hello @polarby i am interested in web support for this package, any updates for it?

abdelaziz-mahdy avatar Dec 18 '23 19:12 abdelaziz-mahdy

Currently not on my agenda any time soon. The documentation is however there and can be quite easily implemented. If this is an essential feature for you, you may consider adding it yourself:)

polarby avatar Dec 19 '23 11:12 polarby

Currently not on my agenda any time soon. The documentation is however there and can be quite easily implemented. If this is an essential feature for you, you may consider adding it yourself:)

i will see if i can implement it, most probably it will not be the best, but if i got it working i will open the pr

abdelaziz-mahdy avatar Dec 19 '23 11:12 abdelaziz-mahdy