LinuxCommandLibrary

streamlink

Stream online video to media players

TLDR

Attempt to extract streams from the URL specified, and if it's successful, print out a list of available streams to choose from

$ streamlink [example.com/stream]
copy

Open a stream with the specified quality
$ streamlink [example.com/stream] [720p60]
copy

Select the highest or lowest available quality
$ streamlink [example.com/stream] [best|worst]
copy

Use a specific player to feed stream data to (VLC is used by default if found)
$ streamlink --player=[mpv] [example.com/stream] [best]
copy

Skip a specific amount of time from the beginning of the stream. For live streams, this is a negative offset from the end of the stream (rewind)
$ streamlink --hls-start-offset [[HH:]MM:SS] [example.com/stream] [best]
copy

Skip to the beginning of a live stream, or as far back as possible
$ streamlink --hls-live-restart [example.com/stream] [best]
copy

Write stream data to a file instead of playing it
$ streamlink --output [path/to/file.ts] [example.com/stream] [best]
copy

Open the stream in the player, while at the same time writing it to a file
$ streamlink --record [path/to/file.ts] [example.com/stream] [best]
copy

SYNOPSIS

streamlink [OPTIONS] <URL> [STREAM_QUALITY]

Examples:
   streamlink https://www.twitch.tv/twitch 'best'
   streamlink 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' best --player mpv
   streamlink 'https://example.com/live' 720p -o stream.mp4

PARAMETERS


    The URL of the stream to play or download.

[STREAM_QUALITY]
    Desired stream quality, e.g., 'best', 'worst', 'source', '720p'. If omitted, a list of available qualities is shown.

-p, --player <player>
    Specify the media player to use (e.g., 'vlc', 'mpv', 'mpv --no-x11').

-o, --output <file>
    Output the stream to a file instead of a player.

--default-stream <quality>
    Set a default stream quality to automatically select if available.

-l, --lowest
    Select the lowest available stream quality.

-h, --highest
    Select the highest available stream quality.

--url, --stream-url
    Print the direct URL of the stream instead of playing it.

--config <path>
    Load configuration from a specific file.

--force
    Force stream playback even if errors are detected.

--no-verify-ssl
    Disable SSL certificate verification for insecure connections.

--retry-streams <seconds>
    Number of seconds to retry connecting to the stream.

--retry-open <seconds>
    Number of seconds to retry opening the stream after initial connection failure.

--json
    Output stream metadata and plugin data as JSON.

--plugins
    List all built-in plugins.

--version
    Show program's version number and exit.

--help
    Show program's help message and exit.

DESCRIPTION

streamlink is a powerful command-line utility that extracts streams from various online video services and pipes them into a user-chosen video player, such as VLC, MPV, or into standard output. It was developed to provide a lightweight alternative to resource-heavy web players, often offering better performance, higher quality stream options, and more control over playback. Supporting a wide array of streaming platforms through its extensible plugin system, streamlink can handle content from sites like Twitch, YouTube, and many others. Beyond playing, it can also save streams directly to a file. It acts as an essential bridge, simplifying access to online video content and enhancing the viewing experience by bypassing browser dependencies.

CAVEATS

streamlink relies on community-maintained plugins, meaning support for specific streaming services can break if those services change their underlying technologies. It requires an external media player (like VLC or MPV) to function as intended for playback. While generally used for legitimate purposes, users should be aware that accessing content this way might, in rare cases, conflict with a streaming service's terms of service, although enforcement against passive viewing is uncommon.

CONFIGURATION FILE

streamlink can be configured using a configuration file, typically located at ~/.config/streamlink/config or /etc/streamlink/config. This file allows users to set default options such as the preferred media player, stream quality, and other parameters, avoiding the need to specify them with every command execution.

PLUGIN SYSTEM

A core strength of streamlink is its highly extensible plugin system. These plugins are Python scripts that allow streamlink to understand and extract streams from hundreds of different streaming websites. This modular design enables rapid adaptation to changes in streaming services and allows the community to contribute support for new platforms without modifying the core application.

HISTORY

streamlink originated as an actively maintained fork of livestreamer, a project initially created to address the performance and dependency issues of watching live streams through web browsers (especially Flash-based ones). When livestreamer development became stagnant, a dedicated group of contributors started streamlink to continue its legacy, adding new features, improving existing plugins, and ensuring ongoing compatibility with evolving streaming platforms. It quickly became the de facto successor, known for its robust plugin system and reliable stream extraction capabilities.

SEE ALSO

mpv(1), vlc(1), ffmpeg(1), curl(1)

Copied to clipboard