Use libvlc_video_set_output_callbacks() to work around high CPU usage
Posted: 01 Feb 2022 00:00
We are developing a desktop application for viewing all kinds of media including Office documents, text, audio, video, and images.
The application is written in C++ and uses Qt and Qml. Due to this fact, we cannot use libvlc_media_player_set_xwindow() but rather libvlc_video_set_callbacks(). Unfortunately, this results in high CPU usage due to video buffer management and decoding that cannot be done by the GPU.
To work around this issue, we would like to use libvlc_video_set_output_callbacks() from VLCv4.0 so that we can render video frames directly to an OpenGL texture. This should make use of the system GPU.
Unfortunately, the documentation for this function is limited and we cannot find any examples to help us understand how best to use it.
1. Is this the correct path to follow? That is, will libvlc_video_set_output_callbacks() from VLCv4.0 potentially solve our problem?
2. If correct, where can we find examples of how to use libvlc_video_set_output_callbacks()?
3. If not, is there another possible work around?
At least on other developer has tried the same work around: https://code.videolan.org/videolan/vlc- ... ssues/1465
The application is written in C++ and uses Qt and Qml. Due to this fact, we cannot use libvlc_media_player_set_xwindow() but rather libvlc_video_set_callbacks(). Unfortunately, this results in high CPU usage due to video buffer management and decoding that cannot be done by the GPU.
To work around this issue, we would like to use libvlc_video_set_output_callbacks() from VLCv4.0 so that we can render video frames directly to an OpenGL texture. This should make use of the system GPU.
Unfortunately, the documentation for this function is limited and we cannot find any examples to help us understand how best to use it.
1. Is this the correct path to follow? That is, will libvlc_video_set_output_callbacks() from VLCv4.0 potentially solve our problem?
2. If correct, where can we find examples of how to use libvlc_video_set_output_callbacks()?
3. If not, is there another possible work around?
At least on other developer has tried the same work around: https://code.videolan.org/videolan/vlc- ... ssues/1465