Closed NetForces closed 3 years ago
@NetForces I didn't give a try to embed a video player, but I think it should work if we could get the window ID for master window, problem is this is platform dependent, I think the proper solution is to integrate with some video lib like libvlc-go. But currenlty I may not have enough time to do that...
@NetForces A second thought just came out. You could decode the video with ffmpeg, convert video frame to rgba image and display it at certain framerate like 24 fps.
FYI just tried it and it works. I used wmctrl
to grab the window ID and pass it to mplayer
. Indeed it's platform dependent but for me it will do.
Now follow-up question, if I have an image defined by canvas.AddImage
is there a way to bring it back to the top layer ?
24fps is too slow for my usecase.
@NetForces Just draw image after video frame is rendered. I don't quite sure this will work, maybe mplayer occupies whole event processing of the master window.
Yeah I'll give it a try. I thought the -wid
with mplayer
worked but as soon as I move the mouse the screen flickers between the video and the main window...
Lets note: https://github.com/ocornut/imgui/issues/2422
We can close this. I am using mplayer in slave mode and it works for my usecase.
Is there a way to play a video within an app build with gui ?
I know it's possible to pass
mplayer
the ID of a window with the-wid
switch:I have done this in the past in Windows with AutoIT and would like to do something similar for Linux with Go and gui...
Thanks.