libvlc-go icon indicating copy to clipboard operation
libvlc-go copied to clipboard

[feature request] implementation of libvlc_video_set_callbacks and libvlc_video_set_format

Open c1ngular opened this issue 1 year ago • 5 comments

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

Thanks

c1ngular avatar May 04 '23 17:05 c1ngular

@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 .

c1ngular avatar May 08 '23 07:05 c1ngular

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.

adrg avatar May 09 '23 06:05 adrg

@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 .

c1ngular avatar May 09 '23 18:05 c1ngular

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.

adrg avatar May 11 '23 08:05 adrg

@adrg thanks a lot

c1ngular avatar May 15 '23 10:05 c1ngular