简体   繁体   中英

docker streamlink opens a stream but immediately closes it

I was trying to test a stream in a docker instance. It was pretty common in work flow

docker pull ubuntu
docker run -it ubuntu /bin/sh
apt-get install -y python python3.6 vlc curl
curl https://bootstrap.pypa.io/get-pip.py > git-pip.py
python get-pip.py
pip install streamlink
useradd vlcuser
su vlcuser
pip install vlc
streamlink https:www//myurl worst

and then it will print something like:

$ streamlink https:www//myurl worst
[cli][info] Found matching plugin twitch for URL https:www//myurl
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p (best)
[cli][info] Opening stream: 160p (hls)
[cli][info] Starting player: /usr/bin/vlc
[cli][info] Player closed
[cli][info] Stream ended
[cli][info] Closing currently open stream...

but i cant figure out why the player immediately closes. Is there a way to keep it open?

I was originally having issues with VLC but running it as non root got me to this point. Im just not sure why the stream fails to stay open. As of right now, I am not Authenticated for Twitch etc. I was trying to set it up to be user agnostic as it is just a public stream i wanted to look at

It seems like the trick is to not use VLC at all.

Inside of streamlink there is a param called: --player-external-http which wont open the player but essentially set up a means to forward the stream through.

This will keep the streams open and VLC will not close. Im not sure if it has the same effect as running VLC. I figure syncing onto a stream would count as a view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM