polarby / render

A package to render any native static and moving flutter widgets to exportable formats
https://pub.dev/packages/render
MIT License
50 stars 28 forks source link

Separate Render core code from FFMpeg #19

Open Azramis opened 1 year ago

Azramis commented 1 year ago

To begin, I would like to thanks you for this incredible package ! Usage is simple and efficient 👌

Is your feature request related to a problem? Please describe. As I mention it in another issue, I'm facing a problem when I want to use a different implementation of FFMpeg. Render depends of ffmpeg_kit_flutter_https_gpl which have only a few external library.

Describe the solution you'd like I want to be able to write a custom MotionFormat that use libvpx external library (from ffmpeg_kit_flutter_video) for exemple.

This solution that seems the most obvious to me, is the separation of the code in two packages :

Also, it might be a good way to implements a web dedicated render package (i.e. render_web), based on render_core with no ffmpeg_kit_flutter deps.

Maybe there is a simplier and better solution (would be great !)

Describe alternatives you've considered Fork the project an do it for myself.

I would be happy to work on this and open a PR, but it should be better to discuss about solutions before

polarby commented 1 year ago

Hi @Azramis, Thanks for your input! Generally, this seems a great idea, where render_core could become a platform for others to build ontop. So let me get this straight:

The render_core package (basic functions, without the processing, therefore eliminating imports of ffmpeg) is the centered main package. And then the Packages that depend on render_core with the platform (or custom) ffmpeg imports that then take the data from render_coreand "only" process it.

There would be two "user-friendly" packages:

For the forkers:

Conclusion:

I think this separation would clear things up a bit, but it would not change the way it is handled right now anyway, right? If People want a custom flutter import, they would still have to fork a package, just this time a bit smaller (render, without the code of render_core). I agree, that this separation, might make extending the endpoint easier. Don't get me wrong, I would love a simplification, but it might involve too much work (for you) and not too much of a gain?!

An extending idea:

If, on the other hand, we additionally add the packages like below, it might not even be necessary anymore to fork anything if there are ffmpeg import issues. (And would clear up issues like #18 )

Here for reference the different packages offered by flutter_ffmpeg

PS. Let me know if understood your idea correctly :) And please correct me if I am wrong.

Azramis commented 1 year ago

Thank you for the quick feedback !

You get the biggest idea behind my words ;) In my opinion, render_core should only be responsible of extracting bitmap datas, one-shot (image) or streamed (motion), and delegate the processing of these datas to a... Delegate 😁 Therefore, it will be possible for anyone to "custom" process the datas, and to make what they want with it.

Possibilities become multiple :

BTW, it should be necessary to build the new render package as it will cover the most retro-compatibility from the current. Lesser breaking changes, better the migration is !

Offer "ready-to-use" packages would be great, and the two you listed are a minima.

Forkers will probably be happy, but just like in my case, my app will only depends on the core and will implements only what I need. So I don't have to fork an entire project, and depends on a local package.
Main idea = Flexibility at most

Main changes

I'll be really enthusiast to be involved in these devs, and I'll try to take the time for its. My current work project depends of your package, and better flexibility in it means more possibilities for me 😁

What's next

I've forked the project and began to extract code.
A question remains: How do you imagine packages separation ?

From my experience, I worked with melos it allows to work with multi libraries on a mono repo. It manages versioning through conventional commits and local dependencies. Coupled with fvm it's a game killer in my opinion.

Despite this, it's important for me to have your opinion, as you are the creator of render

Extending Idea

I'm not for it, as it would complicate things.
It might be simplier to provide quickly, but I think maintenance will be nightmare when you want to upgrade dependencies versions...
Also, I prefer to have more flexibility, so... 🙃

polarby commented 1 year ago

Thanks for clearing things up and explaining. I am quite busy, so I can't help you to write/rearrange the code too much. It would be great if you could help us improve this plugin with your idea.

Execution:

I have added you to the repository as a collaborator. You have my go :)

PS. If you need special permissions please let me know. ALSO: i have already created a plane repository for render_core, feel free to use this :)

Azramis commented 1 year ago

Sorry for the late feedback.

I'm currently working on it, and testing on a mono-repo. When I'll be satisfied with a first version, I'll push it to the render_core repo you have created.

I'll try to write documentation at my best, but let be honest, that's not where I'll be the best 😂

Azramis commented 11 months ago

Quick update.

I'm really busy for now, and I couldnt work on that since my last message. 🤦 And I don't know when I'll have free time to work on it...