alexmercerind / dart_vlc

Flutter bindings to libVLC.
GNU Lesser General Public License v2.1
510 stars 136 forks source link

The library is too big #56

Closed bdlukaa closed 3 years ago

bdlukaa commented 3 years ago

Hey! Thanks for this awesome plugin :)

Unfortunatelly, the library is too big and increases the size of an app at about 100 Mb. Probably because the dartvlc folder is too big.

Is there any way to reduce the app size? I think tree shaking on vlc would be the best option

alexmercerind commented 3 years ago

Hi old friend! Glad you like this. The library is under 1 MB. The DLLs required by libVLC take majority of space in the release build (inside plugins folder). And I assure you, if you compress your app bundle with 7z or similar, you'll get under 40 MB which is really really good compared to electron & you have power to decode all media formats.

If you really want to reduce size, the best that libVLC community has told me is to "delete plugins until it stops working". For example, you just need to play audio or certain formats of audio, then you can remove DLLs according to your requirement & reduce the bundle size.

Thanks

alexmercerind commented 3 years ago

Those additional DLLs are fetched upon first build on developer's machine & not packed inside the package.

bdlukaa commented 3 years ago

That's why it's so big. It'd be good to have your own vlc branch or repo, but smaller. The current one is unviable to be used on a production app!

bdlukaa commented 3 years ago

you'll get under 40 MB which is really really good compared to electron

Well, comparing with electron we actually get a pretty good size but, when compared to native, the size is so big.

bdlukaa commented 3 years ago

And, I don't know if it's possible to tree shake the C Flutter build, but it'd be a good solution

alexmercerind commented 3 years ago

That's why it's so big. It'd be good to have your own vlc branch or repo, but smaller. The current one is unviable to be used on a production app!

Cmon, libVLC isn't yet another little library, if I decide to compile on user's machines it will take around 30 minutes at least to just build your application. I fetch pre compiled binaries for Windows & compile my shared library. And for Linux, I ask users to download from their distro repository.

Well, comparing with electron we actually get a pretty good size but, when compared to native, the size is so big.

VLC is NATIVE, pure C implementation.

alexmercerind commented 3 years ago

The current one is unviable to be used on a production app!

I can't delete the plugins just because you or someone else don't use it. Its developers own choice to remove unnecessary DLLs before distribution.

bdlukaa commented 3 years ago

I still think this is a valid request. People mostly use this for audio, then no need for video plugins, or vice-versa.

"delete DLLs until it breaks" is not a good advice, I'd have no idea if I'm breaking something hidden that could come up weeks later.

It'd be really good a monorepo for audio and video, separately

alexmercerind commented 3 years ago

"delete DLLs until it breaks" is not my advice but from other libVLC binding maintainers like libVLCsharp. And there is nothing one can do.

And I've told why I can't just myself remove the DLLs. Its completely & completely up to you.

People mostly use this for audio.

Video support has been majorly requested feature. Closed issues are there for you to see.

I'd have no idea if I'm breaking something hidden that could come up weeks later.

Its completely matter of your own handling. You can't blame anyone to remove the shared libraries.

And as you said, for building a fork of VLC, I'll then stash some of the plugins (afterall that's what smaller means) & then you'd tell me that its breaking. This library is a complete binding of Dart to libVLC with no exception in functionality. I'm not going to remove any of shared libraries upon request of a single person.

bdlukaa commented 3 years ago

VLC is NATIVE, pure C implementation.

By native I meant native code, similar to what video_player does.