libVLC 4 + OpenGL callbacks

This forum is about all development around libVLC.
FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

libVLC 4 + OpenGL callbacks

Postby FL53 » 27 Apr 2019 11:38

Hi,

I am using libVLC 4 with opengl callbacks to play videos in my application. Everything works pretty well (playing at a different rate, asking for playing/pausing...) but ...

I have got rendering issues:
- I would like to display the first image of the video pausing the video and asking the user to press the play button. To do that I ask for playing the video looping next until the getVideoFrame return a valid texture ID. Have you got an idea to do a better snapshot of the first video image ?
- I would like to use hardware to accelerate decompression and it seems NVDECODE is not used (this codec would enable me to play 6K or 8K videos if available). Is there any way to activate it ?
- I would like to play the videos without taking into account the metadata (to display equirectangular videos without using the video 360 mode included in VLC), is there an option/flag/function to do that ?

And an issue more related to the (lib)VLC way of doing things :
- I would like to stop the video at the end and ask for returning to the beginning of the video when pressing play. I struggled with the way to detect the end of the video and it seems that sometimes I detect the end too late which prevents me to go back to the beginning (I use the libvlc_media_player_set_position function after checking the video is paused using libvlc_media_player_is_playing and libvlc_media_player_pause if needed ).

Regards

unidan
Developer
Developer
Posts: 1493
Joined: 25 Mar 2018 01:00

Re: libVLC 4 + OpenGL callbacks

Postby unidan » 29 Apr 2019 12:41

- I would like to display the first image of the video pausing the video and asking the user to press the play button. To do that I ask for playing the video looping next until the getVideoFrame return a valid texture ID. Have you got an idea to do a better snapshot of the first video image ?
You can use

Code: Select all

--start-paused, --no-start-paused Start paused (default disabled) Pause each item in the playlist on the first frame.
- I would like to use hardware to accelerate decompression and it seems NVDECODE is not used (this codec would enable me to play 6K or 8K videos if available). Is there any way to activate it ?
There is no support for NVDEC currently. You can use vaapi/vdpau/dxva instead.
- I would like to play the videos without taking into account the metadata (to display equirectangular videos without using the video 360 mode included in VLC), is there an option/flag/function to do that ?
There was no option in VLC3 by choice but it will come in libVLC4.
- I would like to stop the video at the end and ask for returning to the beginning of the video when pressing play. I struggled with the way to detect the end of the video and it seems that sometimes I detect the end too late which prevents me to go back to the beginning (I use the libvlc_media_player_set_position function after checking the video is paused using libvlc_media_player_is_playing and libvlc_media_player_pause if needed ).
You can use this and handle the event yourself.

Code: Select all

--play-and-pause, --no-play-and-pause Play and pause (default disabled) Pause each item in the playlist on the last frame. --play-and-stop, --no-play-and-stop Play and stop (default disabled) Stop the playlist after each played playlist item.

FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

Re: libVLC 4 + OpenGL callbacks

Postby FL53 » 02 May 2019 11:14

[Thanks, I will try that today !] EDIT : In fact, I already put these parameters :) ( "--start-paused", "--play-and-pause", "--no-play-and-stop") ... and the video is well loaded and start paused if I call "libvlc_media_player_play" right after loading (and setting up the opengl callbacks) but the first image is not set into the OpenGL textures : the swap callback should not be called : first frames of the video should not be decoded :(. And when stopping the video no way to get it playing again unless I relaod it

How to be sure VLC will use vaapi/vdpau/dxva and are they available in the nightly builds ?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 26 guests