Skip to content
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

[feature request] implementation of libvlc_video_set_callbacks and libvlc_video_set_format #103

Open
c1ngular opened this issue May 4, 2023 · 5 comments

Comments

@c1ngular
Copy link

c1ngular commented May 4, 2023

so user of this lib will be able to make their own media player using preferred GUI frameworks ?

Thanks

@c1ngular
Copy link
Author

c1ngular commented May 8, 2023

@adrg
do you know anyway better than using libvlc_video_set_callbacks and libvlc_video_set_format to make a customized video player? i just learned this is not the performant way cuz it will be very heavy burden on CPU . is there anyway we can use gpu-decoded image directly ?

any advise would be really appreciated .

@adrg
Copy link
Owner

adrg commented May 9, 2023

Hi @c1ngular,

What GUI framework are you planning to use for the custom video player? If the framework exposes a reference to the underlying window of the surface you are trying to render the video on, you can let libVLC take care of the video rendering.

The GTK 3 player example showcases just that. Basically, you would pass a reference to the surface you are drawing the video on to vlc.Player.SetXWindow, vlc.Player.SetHWND or vlc.Player.SetNSObject, depending on the operating system.

@c1ngular
Copy link
Author

c1ngular commented May 9, 2023

@adrg thank you for reply, I was wondering how to play multiple videos on same window(probably with ui overlays above video), have not seen many such apps out there . so I guess vlc.player.setwindow will not working ? I am curious about how to use gpu (hardware accelerated) decoded video without copying to CPU and to GPU again. I don't have an actual project going on, I am just learning and exploring go and multimedia stuff .
thanks again .

@adrg
Copy link
Owner

adrg commented May 11, 2023

You mean playing videos one after another? Because that is possible using both the Player and the ListPlayer structs.
Or do you mean playing multiple videos at the same time? In this case, you would have to use multiple players.

In any case, I believe libVLC does use hardware acceleration by default or it can be enabled using a parameter when initializing the library.

@adrg thank you for reply, I was wondering how to play multiple videos on same window(probably with ui overlays above video), have not seen many such apps out there . so I guess vlc.player.setwindow will not working ?

Let me clarify a bit. In my GTK 3 example, there is a root window which holds multiple components. One of those components is a GtkDrawingArea. The video is rendered to this component. Components in GTK 3 (in other frameworks as well) are also windows, and they have handles by which they can be identified. You can have more than one drawing area in a top-level window and render multiple videos at the same time to them.

@c1ngular
Copy link
Author

c1ngular commented May 15, 2023

@adrg thanks a lot

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

2 participants