-
Notifications
You must be signed in to change notification settings - Fork 281
Plugin for flutter.io/videoPlayer #134
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
Comments
Progress on #102 has been made. The texture_tutorial has been updated with a video example. What is left to do is to align ourself with the way the flutter.io/videoPlayer do things |
Looking for maintainer: A first implementation is available at: https://github.com/go-flutter-desktop/plugins/tree/master/video_player |
I've reimplemented the backend logic using gocv here https://github.com/Knights-of-the-Functional-Calculus/gfd-plugins/blob/master/video_player/cv.go It's still showing memory leaks. I can't find any place where it might be leaking in my implementation nor in the flutter go embedder. Is there anyway we can renew interest in this subject? I'm not particularly great at leak hunting myself. Edit: One thing I forgot to mention is that memstat appears to say that the leak isn't happening on the golang side, and I've made sure that my Mats are closed after usage. This could point to a leak in the flutter texture implementation, but I don't see it. |
@j4qfrost I'll take a look at this once I have more time. |
Bump. Is there anything I can do to get better at tracking down the leaks? |
I don't time at the moment, I'm very sorry but I can't help. |
I use this in Mac.But I got error like these: (This is taking an unexpectedly long time.) ⢿go-flutter/plugins/video_player WARNING MethodCall to ' setLooping ' isn't supported by the Golang video_player Can U help me?Thanks. |
Edit: This isn't it. Handled here: go-flutter/texture-registry.go Line 91 in f67b5ec
@pchampio I think I may have found a solution. I'm ashamed I hadn't thought of it earlier. The guys over at flutter-rs got around to fixing the memory leak issue by calling the destruction_callback https://github.com/flutter-rs/flutter-rs/blob/696d4b1ecce501e061523d01d8476280f88f3d2e/flutter-engine/src/texture_registry.rs#L122. The downside to this is that I ran into high CPU usage. I am not sure if that's due to the constant frequent destruction, but that's the only thing I can think of. I'll see if I can get something working. |
@j4qfrost |
I'm not quite sure either. Maybe it's because The allocation for an OpenGL texture happens first and this is to ensure that the texture gets destroyed in case registering on the engine doesn't take place. What I seem to be observing with the memory leak seems to be in line with some framebuffer not clearing. When I ran the video player examples under flutter-rs some months ago, I didn't have the same memory leak issues, but I did have insane CPU usage, and after looking at it for a bit I think the reason is that at each interval, the actually replace the texture handler rather than push in a new PixelBuffer, https://github.com/flutter-rs/flutter-video-plugin/blob/99b6133b8cdee38432d45c762c12318818ff1ad7/src/video.rs#L116 post_rgba calls post_internal which calls destruction_callback which calls glDeleteTextures, and this happens each time there's a new frame. I'll reach out to the flutter-rs guys tomorrow and ask about this. Last I checked their development has slowed. csnewman is still working on it. |
last time I checked flutter-rs I saw those 2 commits: The high CPU usage might of come from their event loop, not their texture ABI. On the go-flutter side we are still in the process of merging: #390 |
Quoting from
|
So it would be fine to throw away the texture at each redraw? I'm also kind of confused about what the purpose of the destruction_callback is. Is it actually called within the flutter api if it gets set or is it just there for convenience? |
Looking a bit deeper at the flutter-rs code, it seems they are Creating a new texture on every new frame. This isn't what we do, we are reusing the same texture, instead of creating/deleting on each frame. FWI: the go-flutter implementation was based of flutter/engine#9822 |
Yeah, I recognized that go-flutter and flutter-rs differed in that respect. I was considering deleting the texture at each frame to see if that solved the memory leak but wasn't quite sure how to do that, so I held off until I got a response. I actually was able to somewhat successfully use webcloudrtc's branch, but I stopped when I realized how much of a pain working with Makefiles would be moving forward. By then I had a stuttering demo working, and it was also a pain to keep my flutter install at the right version for everything to work correctly. |
Also forgot to mention that I can't use valgrind on my machine due to some paging issues with mac. I haven't gotten my linux machine set up yet. |
Even if you use valgrind, it's going to fail. Since the engine is written itself in C, the output will just be a bunch of unrelated mess. |
We began our own ffmpeg-based implementation as we needed to get video and audio to work: https://github.com/telefuel/video_player_testbed Currently we’re stuck on getting the audio and video to sync, most likely the result of some missing ffmpeg incantations or worst case some compatibility issues with the hardware. We also have an open bounty to get this resolved. @pchampio @j4qfrost any thoughts on our implementation? Having a functioning video/audio player is critical for us and other applications. We’d be happy to support this effort. Cc @kiasaki |
@MattNguyen this is so cool! I'm always surprised on how the community is using go-flutter ❤️ I currently don't have much time to work on such plugin, I respect the time and money you put into this. |
@MattNguyen Where are we on this Video Player thing man. Anything new yet? |
We've since moved on from the project, and was unable to progress on the video player. The issue is certainly related to some ffmpeg incantations that we're not familiar with. Hopefully someone can take over the work and solve the issue. |
我打包出的 windows桌面应用字体有点问题 请问我如何修复它 |
@ablockhead 能贴个windows的例子吗?正在弄这个,我还没搞通。 |
the flutter video_player plugin change a lot. I use the version v0.10.9+2 to test in Windows 10, only the tests-sample.mp4(https://github.com/3d0c/gmf/blob/master/examples/tests-sample.mp4) can play, the other mp4 report Resource temporarily unavailable error. |
flutter/engine#20714 |
@Leadrive this is related to the official linux embedder. The PR you referenced above have nothing to do with go-flutter. In this un-official implementation, we have merge texture back in Aug 2019 in #217 We need contributor to implement our go-flutter compatible version of the videoPlayer. Some work has already been done: https://github.com/telefuel/video_player_testbed https://github.com/go-flutter-desktop/examples/tree/master/texture_tutorial |
Can we have video player plug-in for Windows?
Thank you for your amazing work.
Flutter version
Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (2 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
Go.mod file
module C:\go-flutter-master\example\test_template/desktop
go 1.12
require (
github.com/go-flutter-desktop/go-flutter v0.16.0
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 // indirect
github.com/pkg/errors v0.8.1
github.com/stretchr/objx v0.2.0 // indirect
)
The text was updated successfully, but these errors were encountered: