LibVLC + SDL2 example error

This forum is about all development around libVLC.
Sava41
New Cone
New Cone
Posts: 2
Joined: 23 Aug 2021 22:32

LibVLC + SDL2 example error

Postby Sava41 » 23 Aug 2021 23:12

Hi,

I'm having trouble with the SDL + libvlc sample code found here.

The issue is very similar to this forum post but it wasn't answered.

I'm trying to compile the example for the raspberry pi 4b. The libvlc only example works fine and so do SDL2 examples on their own. Compiling the SDL2 + libvlc example works, but gives this error when trying to play the same video that I played using the libvlc only example:

Code: Select all

VLC_PLUGIN_PATH=(null) [00fbc488] vlcpulse audio output error: PulseAudio server connection failure: Connection refused [b0315740] mmal_avcodec decoder: Looking for HEVC decoder 'hevc' [89d183c0] chain filter error: Too high level of recursion (3) [89d17e98] main filter error: Failed to create video converter [89d183c0] chain filter error: Too high level of recursion (3) [89d17e98] main filter error: Failed to create video converter [89d183c0] chain filter error: Too high level of recursion (3) [89d17e98] main filter error: Failed to create video converter [89d183c0] chain filter error: Too high level of recursion (3) [89d17e98] main filter error: Failed to create video converter [89d183c0] chain filter error: Too high level of recursion (3) [89d17e98] main filter error: Failed to create video converter mmal: mmal_vc_port_info_set: failed to set port info (3:0): EINVAL mmal: mmal_vc_port_set_format: mmal_vc_port_info_set failed 0x89d04430 (EINVAL) [89d023b8] mmal_codec filter error: Failed to commit format for output port vc.ril.hvs:out:0(Y10C) (status=3 EINVAL) Segmentation fault

This is the output from the vlc only example:

Code: Select all

[b4ea0928] mmal_avcodec decoder: Looking for HEVC decoder 'hevc' [8e724d20] gles2 generic error: parent window not available [8e724610] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module [8e724d20] xcb generic error: window not available [8e724610] mmal_xsplitter vout display error: Failed to open Xsplitter:xcb_x11 module [00e4d7b0] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1567 ms) [hevc @ 0xb4ebfcd0] Could not find ref with POC 42 [hevc @ 0xb4ebfcd0] Could not find ref with POC 40 [hevc @ 0xb4ebfcd0] Could not find ref with POC 38 [hevc @ 0xb4ebfcd0] Could not find ref with POC 34 [hevc @ 0xb4ebfcd0] Could not find ref with POC 44

What would be causing the too high level of recursion error in one example but not the other?

Thanks,

Sava

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: LibVLC + SDL2 example error

Postby Rémi Denis-Courmont » 24 Aug 2021 19:03

Examples on the official wiki are meant for the official LibVLC releases.

You're using the Raspian fork including some unofficial modules that evidently don't support some LibVLC functionality.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Sava41
New Cone
New Cone
Posts: 2
Joined: 23 Aug 2021 22:32

Re: LibVLC + SDL2 example error

Postby Sava41 » 25 Aug 2021 16:05

So we managed to get it working. The library variable wasn't set which you can do with the following command:

Code: Select all

$ export VLC_PLUGIN_PATH=/opt/vc/lib/plugins/plugins

Video playback is quite choppy. I know the documentation says this about rendering to a custom frame buffer:
Rendering video into custom memory buffers is considerably less efficient than rendering in a custom window as normal.
For optimal perfomances, VLC media player renders into a custom window, and does not use this function and associated callbacks.
It is highly recommended that other LibVLC-based application do likewise. To embed video in a window, use libvlc_media_player_set_xid() or equivalent depending on the operating system.


Is it possible to do the render to window implementation while still using SDL for the UI elements? This is for an embedded application so were not using x11. I cant find reference to the libvlc_media_player_set_xid() function in the documentation.
Last edited by Rémi Denis-Courmont on 25 Aug 2021 18:18, edited 1 time in total.
Reason: formatting

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: LibVLC + SDL2 example error

Postby Rémi Denis-Courmont » 25 Aug 2021 18:25

Is it possible to do the render to window implementation while still using SDL for the UI elements?
No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

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

Re: LibVLC + SDL2 example error

Postby unidan » 14 Dec 2021 09:38

Hi,

If you render on the end target directly with callbacks, then it will be as efficient as how VLC is rendering itself on its end target. What’s expensive (especially on Pi) is rendering in intermediate buffers (framebuffers or common memory buffers). In 3.0, you’ll mostly be stuck in the performance problem though.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests