VLC decoding twitch stream (via streamlink), irregular image and audio

I distinctly remember having this problem before, quite possibly with a different distribution (before switching to EOS). The problem as I see it:

I am using and supporting Streamlink amd Streamlink-Twitch-GUI, which allows viewing Twitch streams via regular media players (MPV and VLC are supported OOTB). While MPV works quite well, I have always preferred VLC, and I remember installing MPV because of the problem I want to describe.

When starting a stream through Streamlink, this is the log when VLC is configured as the target media player:

[dromundkaas@Pure ~]$ streamlink -v https://twitch.tv/rdulive best
[cli][info] Found matching plugin twitch for URL https://twitch.tv/rdulive
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: /usr/bin/vlc
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000556e76a57550] main libvlc: VLC wird mit dem Standard-Interface ausgeführt. Benutzen Sie 'cvlc', um VLC ohne Interface zu verwenden.
[00007fb4e8007ab0] gl gl: Initialized libplacebo v5.229.2 (API v229)
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007fb4e8007ab0] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
[00007fb4e8007ab0] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fb4e8007ab0] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007fb4e8007ab0] gl gl: Initialized libplacebo v5.229.2 (API v229)
[00007fb5180722d0] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library  530.41.03  Thu Mar 16 19:21:47 UTC 2023 for hardware decoding
[00007fb518080390] main decoder error: buffer deadlock prevented
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 16 bits with -3 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 16 bits with -19 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 16 bits with -35 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 6 bits with -4 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
Note: Illegal Audio-MPEG-Header 0x00000135 at offset 938.
[src/libmpg123/parse.c:wetwork():1379] error: not attempting to resync...
[00007fb518080390] mpg123 decoder error: mpg123_decode_frame error: A generic mpg123 error.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 10 bits with -6 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 10 bits with -16 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 10 bits with -26 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
Note: Illegal Audio-MPEG-Header 0xbef39a29 at offset 1844.
[src/libmpg123/parse.c:wetwork():1379] error: not attempting to resync...
[00007fb518080390] mpg123 decoder error: mpg123_decode_frame error: A generic mpg123 error.
[src/libmpg123/layer1.c:check_balloc():30] error: Illegal bit allocation value.
[src/libmpg123/layer1.c:INT123_do_layer1():228] error: Aborting layer I decoding after step one.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 5 bits with -4 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 5 bits with -9 available.
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 5 bits with -14 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 16 bits with -3 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
[src/libmpg123/getbits.h:getbits():45] error: Tried to read 4 bits with -3 available.
[src/libmpg123/layer2.c:INT123_do_layer2():365] error: missing bits in layer II step two
Note: Illegal Audio-MPEG-Header 0xffffffff at offset 750.
[src/libmpg123/parse.c:wetwork():1379] error: not attempting to resync...
[00007fb518080390] mpg123 decoder error: mpg123_decode_frame error: A generic mpg123 error.
Note: Illegal Audio-MPEG-Header 0xffffffff at offset 754.
[src/libmpg123/parse.c:wetwork():1379] error: not attempting to resync...
[00007fb518080390] mpg123 decoder error: mpg123_decode_frame error: A generic mpg123 error.
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

The video and audio are completely broken, here’s a sample screenshot:

However, I said that I remember having this problem before, and I am almost 100% sure that the solution was some kind of plugin or other setting, because the issue is caused by subtitles in the stream that VLC does not recognize without that plugin, interprets it as part of the video byte stream, and this is the result.

MPV decodes the stream perfectly, however I’d really like to use VLC.

However, googling any of the actual error messages doesn’t seem to result in any subtitle plugins or packages mentioned as the solution, so I turn to you, Obi Wan EOS - you’re my only hope.

Have a great weekend.

Did you try cvlc instead of vlc, as suggested? This can greatly reduce errors as per my own experience on linux.

As for sutitles, I’m not exactly sure, as I think the former Vlsub plugin was in-between fully integrated in to VLC itself, so it is no longer needed.

You might want to read this article:

:v:

Thanks for your suggestions.

I forced the usage of cvlc as you suggested, but the resulting problem stays. The log:

[dromundkaas@Pure ~]$ streamlink --player cvlc -v https://twitch.tv/rdulive best
[cli][info] Found matching plugin twitch for URL https://twitch.tv/rdulive
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[cli][info] Starting player: cvlc
VLC media player 3.0.18 Vetinari (revision 3.0.13-8-g41878ff4f2)
[00005649cddfd3b0] dummy interface: using the dummy interface module...
[00007f4824007b60] gl gl: Initialized libplacebo v5.229.2 (API v229)
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007f4824007b60] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
[00007f4824007b60] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007f4824007b60] glconv_vaapi_drm gl error: vaInitialize: unknown libva error
[00007f4824007b60] gl gl: Initialized libplacebo v5.229.2 (API v229)
[00007f482009c4f0] avcodec decoder: Using NVIDIA VDPAU Driver Shared Library  530.41.03  Thu Mar 16 19:21:47 UTC 2023 for hardware decoding
[00007f482010e200] main decoder error: buffer deadlock prevented
[00007f47fc1252e0] xcb_window window error: X server failure
X Error of failed request:  GLXBadWindow
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  26 (X_GLXMakeContextCurrent)
  Serial number of failed request:  860
  Current serial number in output stream:  860
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...
[dromundkaas@Pure ~]$ 

I don’t really want to download any subtitles, if that’s how my post sounds I apologize, it seems I did not make myself clear then. I think when I had the problem last there was some mention of subtitles in the stream not being decoded/picked up by VLC, so the stream looked broken for VLC, and that was the cause of the weird graphics issue.

1 Like

Ok, after reading up on the net, here
it could be an error related to the latest libva-package. In one solution, downgrading that package helped.

Also hardware-acceleration (you can disable that in VLC settings) might play a role. And your graphics-card (driver), too. Are you on Wayland, or on Nvidia graphics? If so, try using Xorg instead of Wayland. As per Nvidia, you could refine the above linked search given in this post.