Streamlink, a CLI utility for viewing online video streams

about stream link

In the next article we are going to take a look at Streamlink. This is a command line utility that will allow us to channel video transmissions from various services to a video player, which we will have to have previously installed on our computer. The main purpose of this application is to avoid non-optimized websites, while allowing the user to enjoy the content that is transmitted.

Streamlink is a open source program written with the Python language. This program was forked from LiveStreamer, which is no longer maintained. It is a software compatible with GNU / Linux, Windows and Mac OS X. A colleague already spoke about this program in this blog a while ago, but now we will see a couple more ways to install this program in Ubuntu.

Streamlink is a command line transmission utility that will allow us to watch online video streams on popular media players as popular as VLC, MPlayer, MPlayer2, MPC-HC, mpv, Daum Pot Player, QuickTime and OMXPlayer, etc..

Nowadays this software supports live video streaming services like YouTube, Dailymotion, Livestream, Twitch, UStream and more. As this application is based on a system of add-ons that allows you to easily add new services. You can consult the list of accessories available in the following link.

It's important to know that Streamlink will not play video streams if there are no media players available on the system. Therefore, it is necessary to make sure that you have installed a player on our system before using this program.

Install Streamlink on Ubuntu

Via PIP

Since Streamlink has been written using Python, can be installed using package manager Pip. If your computer does not have this tool, you can install it using a terminal (Ctrl + Alt + T):

sudo apt install python3-pip

When you already have Pip installed on your computer, you can run the following command to install Streamlink:

instralar streamlink with pip3

sudo pip3 install streamlink

As AppImage

You can also enjoy this application using its corresponding AppImage file. This can be downloaded from releases page using the web browser or by opening a terminal (Ctrl + Alt + T) and using wget as follows:

download streamlink appimage

wget https://github.com/streamlink/streamlink-appimage/releases/download/2.4.0-1/streamlink-2.4.0-1-cp39-cp39-manylinux2014_x86_64.AppImage -O streamlink.AppImage

When we have downloaded the AppImage file, we only have make it executable with the command:

chmod +x streamlink.AppImage

At this point, we can launch the program by double clicking on the file, or by typing in the terminal (Ctrl + Alt + T) the command:

./streamlink.AppImage

A quick look at the program

As commented lines above, this is an application for the command line. Typical use of Streamlink it would be something like the following:

streamlink syntax

streamlink [OPCIONES] <URL> [CALIDAD]

URL indicates the URL of online video streaming. It could be any video link from the supported sites. QUALITY indicates the quality of the video. It can be used 'best" or "sausage'to get the highest or lowest quality available. In addition we will also have the possibility to specify a list of resolutions separated by commas, which would be something like the following:

"720p,480p,best"

If no sequence is specified and is not used –Default-stream, the program will print a list of available grades.

Play a video

streamlink will play video streams in our default video player.

playing with vlc

./streamlink.AppImage https://www.youtube.com/watch?v=-tAEAyHgCec best

Once you run this command, Streamlink extracts the online video stream from the specified url and routes it to the default video player (which in my case is VLC), or to which we indicate with the best available quality.

List of available streams

To see the list of available streams of the video, all you have to do is do not specify the QUALITY value (worst or best).

available video resolutions

Play audio only

If you are interested in being able to listen to only the audio, at the end of the command you just have to add "audio_mp4a" or "audio_webm" instead of "best":

playing audio only

streamlink https://www.youtube.com/watch?v=-tAEAyHgCec audio_mp4a

Select the player to use

If you want to play the video streams with a different player than the default one, it is only necessary to specify it with the option –Player followed by the name of the player:

playing with mplayer

streamlink https://www.youtube.com/watch?v=-tAEAyHgCec 480p --player mplayer

This command will play the given video stream in 480p quality using Mplayer to play it back.

See other services

This program can also be used with other online streaming services through plugins. A full list of plugins currently included can be found in the project website.

In addition we can list plugins using command:

available plugins

streamlink --plugins

Help

Users who want can get more information about using this program can consult the man pages:

man streamlink

man streamlink

Or by typing in the terminal:

streamlink --help

In addition, users can know more about how to work with this program, using the tutorial offered on the project website or on your GitHub repository.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.