alexmercerind / dart_vlc

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

Platform Support Progress #254

Open alexmercerind opened 2 years ago

alexmercerind commented 2 years ago

✅: Done. ⚠️: Done, but currently has issues in it or a work-in-progress. 🚫: Not implemented yet. 🛑: removed support. see #242.

Additional notes on video embedding/rendering:

Video widget uses libvlc_video_set_callbacks (best as-of libvlc 3.0) which has performance-costs at higher resolution videos due to pixel-buffer (RGBA/BGRA depending upon platform) conversion & other copy operations when using Texture widget. libvlc 4.0 will come with a better rendering API which supports rendering into an OpenGL context or Direct3D device/surface. Still, on Flutter Windows, there are no GPU-backed-buffers for Texture widget.

~~The new NativeVideo widget on the other hand, uses flutter_native_view on Windows currently (in future, I will add Linux support myself). On other platforms, official platform views can be used. In general, NativeVideo is more-performant since it doesn't involve any pixel-buffer conversion, neither unnecessary copy operations. A native VLC-video-output window is directly embedded inside Flutter view as a Widget.~~

~~[Video: 1080p 60FPS 4973kbps. CPU: AMD Ryzen 3 2200U (ZEN I). GPU: AMD Radeon Vega 3 (Integrated)] _On normal 720p videos, both CPU & GPU usages stay around ~5% on NativeVideo & bearable on Video._~~

ench0 commented 2 years ago

Great overview, thanks for this. It also answered at least 5 of my questions in one go. :-)

razfazz commented 2 years ago

please add support for android. the performance of the other vlc plugin is really bad. thank you for this!

alexmercerind commented 2 years ago

please add support for android. the performance of the other vlc plugin is really bad. thank you for this!

It's no surprise. It uses libvlc_video_set_callbacks, and I already wonder how it'd perform on a mobile device. A better approach should be to use platform views, I assume. I'm not working that actively on the project though.

razfazz commented 2 years ago

i forgot to thank you @alexmercerind for this great package and also thank you for fast response. if this also supports android it will be the first real cross platform videoplayer. did you list your package correctly in pub.dev? it is hard to find and from approach much better then the other one. ( sorry for off-topic comment)

GroovinChip commented 2 years ago

@alexmercerind This issue should be updated to reflect that iOS support has been removed in master

theolundqvist commented 1 year ago

@alexmercerind I have a flutter desktop app. Last time I updated it was 1 year ago. It shows a video on startup and relies heavily on dart_vlc.

When I was going to update it now I noticed that it could not be built for mac since VLCKit was not found. When I checked this thread (and others) It became clear that dart_vlc absolutely should not work for mac. Which was weird since I have an old build running perfectly (though I remember it was quite a hassle to get it to work).

I spent yesterday trying to get it to work and was very close to giving up.

Today when I tried flutter run it just worked.

What I think solved the issue was that I right before bed yesterday built VLCKit from source.

To build it from source just run the following commands (-x builds for mac)

git clone https://code.videolan.org/videolan/VLCKit.git
cd vlckit
bash compileAndBuildVLCKit.sh -x

ps. it probably took an hour to build.

alexmercerind commented 1 year ago

@theolundqvist, I would suggest using media_kit instead of dart_vlc.

It has better performance (capable of 4K/8K 60 FPS), small size & stability. And, most importantly, it supports all platforms.

These improvements were not feasible with VLC core, media_kit is GPU powered. A massive engineering work has gone into it (still in steady progress). I can guarantee better future for it, as compared to dart_vlc. A better testing is also being done.

Thanks!

theolundqvist commented 1 year ago

@alexmercerind awesome, I will check it out