Black screen when trying to stream from twitch

This forum is about all development around libVLC.
Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Black screen when trying to stream from twitch

Postby Razkan » 26 Jan 2019 08:36

Hi,

There is a similar post: https://forum.videolan.org/viewtopic.ph ... ed#p483870 however I believe my issue is different and don't want to mix help in the same thread.

I have been using a library, Vlc.DotNet a libVLC wrapper for windows forms, where I get a black screen when trying to play streams from twitch.tv. I get the following debug log when running the program:
(x86) https://pastebin.com/raw/nd5S3yYD.
(x64) https://pastebin.com/5deE2s1t

I discussed this with the Vlc.DotNet creator at https://github.com/ZeBobo5/Vlc.DotNet/issues/509 but it was decided the issue is with libVLC.

The weird behaviour is that the screen is blank, but the memory keeps increasing until all the computers memory is reserved and in some cases an OutOfMemoryException is thrown after a few minutes of running it.

There is a work around, where you use https://github.com/streamlink/streamlink, converting the twitch.tv link to a vlc player friendly link (.m3u8), however that doesn't feel like a plausible solution, since if you paste the twitch.tv link direct in vlc it works out of the box.

I have tried libVLC 3.0.0, 3.0.4, 3.0.5 and 3.0.6.

Any suggestion on how to solve it?

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 31 Jan 2019 17:06

Could someone confirm if this is intended, bug or just missing information to how to test it? I want it integrated with my application, but if it is not serious enough to investigate i'll try another framework.

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: Black screen when trying to stream from twitch

Postby chouquette » 31 Jan 2019 17:09

Can you reproduce the same (or a similar) behavior when using VLC itself?

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 31 Jan 2019 17:12

No, with vlc it works flawless.

copied from the github issue report:

"With vlc I can:
- [x] Play a local .mp4 clip.
- [x] I can play the 'vlcControl1.Play("http://download.blender.org/peach/bigbu ... p_h264.mov"));`
- [x] Play a livestream from example twitch

With vlccontroller (libvlc wrapper) I can:
- [x] Play a local .mp4 clip.
- [x] I can play the 'vlcControl1.Play("http://download.blender.org/peach/bigbu ... p_h264.mov"));`
- [ ] Play a livestream from example twitch
"

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Black screen when trying to stream from twitch

Postby Jean-Baptiste Kempf » 10 Feb 2019 22:15

It seems the lua module is not loaded, tbh.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 10 Feb 2019 22:43

is that something I can do manually, or something that has to be fixed in libvlc?

If the stream is converted to .m3u8 through https://github.com/streamlink/streamlink it works flawless.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Black screen when trying to stream from twitch

Postby Jean-Baptiste Kempf » 16 Feb 2019 11:05

Are you shipping all the modules correctly?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 17 Feb 2019 20:37

Are you shipping all the modules correctly?
How can I verify that?

As far as I know, the modules works correctly since I can get it to work if I pass it as a .m3u8 extension, however that might be something else?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Black screen when trying to stream from twitch

Postby Jean-Baptiste Kempf » 17 Feb 2019 21:04

Can you compare the VLC logs output and the libVLC logs output on the same link?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 18 Feb 2019 00:15

Can you compare the VLC logs output and the libVLC logs output on the same link?
LibVLC (not working): https://pastebin.com/uU8EN2LT
VLC (working): https://pastebin.com/nm4GeMfs

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 18 Feb 2019 00:25

I removed all but twitch.luac from <ProjectFolder>\Library\VideoLAN.LibVLC.Windows.3.0.6\build\x64\lua\playlist, and it gave the following result https://pastebin.com/ejuvDxRb, but then nothing more happend. Seems like a small progress.

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 18 Feb 2019 00:28

So the LibVLC generates a .m3u8 link (line 153 in https://pastebin.com/ejuvDxRb), if I copy that link to VLC it starts to play the twitch stream correctly in VLC.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Black screen when trying to stream from twitch

Postby Jean-Baptiste Kempf » 18 Feb 2019 15:05

Are you playing the item?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 19 Feb 2019 18:46

Are you playing the item?

we'll the only thing I am running is

Code: Select all

vlcControl1.Play("https://www.twitch.tv/followgrubby")
so I assume it is running.

When I run it the usher.twitch.tv link is generated, but the generated item does not seem to start. If i run it again, with swapping the https://www.twitch.tv/<channel> to the generated usher.twitch.tv link (copy paste from the log), it works.

basically all the pre work seems to work (fetching links, and generating a .m3u8), however after the .m3u8 is generated nothing more happens.

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: Black screen when trying to stream from twitch

Postby mfkl » 20 Feb 2019 03:54

This code will play your stream with LibVLCSharp as soon as https://github.com/videolan/libvlcsharp/pull/31 gets merged and released

Code: Select all

Core.Initialize(); using (var libVLC = new LibVLC()) { var media = new Media(libVLC, "https://www.twitch.tv/followgrubby", Media.FromType.FromLocation); var status = await media.Parse(Media.MediaParseOptions.ParseNetwork); using (var mp = new MediaPlayer(media.SubItems[0])) { media.Dispose(); mp.Play(); Console.ReadKey(); } }
Vlc.DotNet does not support `libvlc_media_subitems` yet, so your options are: 1. Make a PR to Vlc.DotNet or 2. Switch to LibVLCSharp and wait for PR31 to get merged.
https://mfkl.github.io

Razkan
Blank Cone
Blank Cone
Posts: 10
Joined: 26 Jan 2019 07:58

Re: Black screen when trying to stream from twitch

Postby Razkan » 20 Feb 2019 10:45

This code will play your stream with LibVLCSharp as soon as https://github.com/videolan/libvlcsharp/pull/31 gets merged and released

Code: Select all

Core.Initialize(); using (var libVLC = new LibVLC()) { var media = new Media(libVLC, "https://www.twitch.tv/followgrubby", Media.FromType.FromLocation); var status = await media.Parse(Media.MediaParseOptions.ParseNetwork); using (var mp = new MediaPlayer(media.SubItems[0])) { media.Dispose(); mp.Play(); Console.ReadKey(); } }
Vlc.DotNet does not support `libvlc_media_subitems` yet, so your options are: 1. Make a PR to Vlc.DotNet or 2. Switch to LibVLCSharp and wait for PR31 to get merged.

Thanks, this is the kind of solution I want. I'll switch to LibVLCSharp and wait for PR31, any ETA?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 23 guests