Skip to content

not able to use dart_vlc (dart_vlc_ffi) together with flutter-pi to play video in widget #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
radeksalomon opened this issue Feb 4, 2022 · 6 comments

Comments

@radeksalomon
Copy link

We are not able to pass the obstacles to run video in flutter widget on rpi with flutter-pi. We run flutter-pi on archlinuxarm 32 bit armv7h and when we try to run the video in flutter, the error appears that we are missing /usr/local/bin/lib/libdart_vlc_plugin.so. I guess the missing lib is the issue, but we do not know how to build for it. Any kind of your help is much appriciated.

I also noticed flutter-pi has some support for gstreamer in you feature branch. Play-pause of file or stream is what we need to use. So maybe this should be the way, how to implement the video to the widget.

@ardera
Copy link
Owner

ardera commented Feb 4, 2022

dart_vlc looks for that lib in this line, because it assumes it's running on the linux desktop embedder: https://github.com/alexmercerind/dart_vlc/blob/61f8180324c89aaad897663c3f37c0387fad536c/lib/dart_vlc.dart#L101

That library is only built when using the linux desktop embedder and only works with the linux desktop embedder, it doesn't work with flutter-pi (at all).

It's definitely possible to make dart_vlc working with flutter-pi, but that requires modification to both dart_vlc and flutter-pi, so let me know if you want to go down that route.

As I mentioned on discord, there's two video players for flutter-pi: one based on omxplayer and one based on gstreamer.

  • I didn't test the omxplayer one in a long time, it also was a bit of a hack. Also omxplayer is deprecated now
  • the gstreamer one is the one I'm working on right now. It works pretty well, I'd definitely recommend it over the omxplayer video player. Though I haven't implemented audio yet, if you need that

@radeksalomon
Copy link
Author

Omxplayer is not the way, we should go further. I agree, it is deprecated and does not make sense to develop with it.
We like that you implemented gstreamer to the flutter-pi. Gstreamer is great tool and has some good advantages comparing to vlc (gapless play etc.). So we would like to implement it. Our solution does not support audio yet, so it looks like good match :). We will be happy to support you with further development, further tests etc.

@ardera
Copy link
Owner

ardera commented Feb 7, 2022

Thanks!
Yes there's some things I'd like to improve about the gstreamer video player. Stability is great already, but there's some things to improve about performance:

  • true zerocopy playback using hardware overlay planes
  • decouple video framerate from flutter framerate, so the video plays smoothly even when flutter drops some frames (in heavy animations, for example)
  • in some cases, the hardware decoder will fail to decode a video. In that case, the video player will fallback to software decoding, which is a lot slower. Maybe I can see what's causing that, maybe fix the bug in the gstreamer plugin / kernel driver, so we can enjoy full hardware accelerated video playback all the time.

@DisDis
Copy link
Contributor

DisDis commented Feb 7, 2022

Hi @ardera , Where can I find an example of gstreamer video playback in flutter-pi?
This topic is very interesting to me. I can be a tester.

@ardera
Copy link
Owner

ardera commented Feb 9, 2022

Hey @DisDis ,
you can use it like this:

  1. install gstreamer and plugins (this is from memory, not sure if the command is complete)
    $ sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad
  2. checkout the feature/gstreamer-video-player branch
  3. delete your build folder
  4. configure using cmake (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN is enabled by default in that branch)
  5. no need to install any pub.dev dependencies or setup anything in the projects main (like it was the case with omxplayer), just use the video_player package as normal

I'll update the readme with instructions once I merge it into master.

@ardera
Copy link
Owner

ardera commented Mar 18, 2022

Closing this since dart_vlc is not supported right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants