Documentation › Integrations

Command Line

TinePlayer supports a number of command line options for controlling playback and getting information about video files and devices, and is especially useful for integration with other applications.

Running It on Each Platform

Running TinePlayer from the command line varies a bit for each platform.

  • Windows

    TinePlayer "video.mkv" --primary en --secondary ru

    The simplest option is to choose Add TinePlayer to PATH when installing. With that enabled, you can simply run TinePlayer in a terminal from any location.

    Without it, the full path to the exe needs to be provided:

    InstalledProgram
    For the current user only %LOCALAPPDATA%\Programs\TinePlayer\TinePlayer.exe
    For all users C:\Program Files\TinePlayer\TinePlayer.exe
    From the portable ZIP TinePlayer.exe, wherever you unpacked it
  • macOS

    /Applications/TinePlayer.app/Contents/MacOS/tineplayer video.mkv --primary en --secondary ru

    The executable inside the application bundle is what needs to be run, which is why the path goes into TinePlayer.app.

  • Linux

    tineplayer video.mkv --primary en --secondary ru

    The package puts tineplayer on your PATH, so it can be run by name from anywhere.

Everywhere below, the command is written as tineplayer for short. Substitute whichever path above is needed for your use case.

All Options

OptionWhat it does
FILEThe video to play: a path, a network share, or an http:// or smb:// address
--primary <T>What the first output plays. See below
--secondary <T>What the second output plays
--subtitle <S>Which subtitles to show. See below
--playStart playing immediately rather than opening the media page. Requires FILE
--list-tracksPrint a file's soundtracks and subtitles, with their numbers. Requires FILE
--list-devicesPrint the current machine's audio outputs by name
--restartStart playback from the beginning, ignoring a saved progress
--forgetForget remembered positions and choices. With a FILE, only that file
--fullscreenLaunch in fullscreen mode
--windowedLaunch in windowed mode
--externalUsed when launched by another application. Requires FILE. See Advanced integration
--kodiLaunched by Kodi. Implies --external
-V, --versionPrint the version
-h, --helpPrint this list

Listing the Available Outputs

To get a list of the output devices available on the current system, use:

tineplayer --list-devices

Every audio output the system offers is printed, counted, and one per line:

Audio output devices (3):

  Built-in Audio Analog Stereo
  LG TV SSCR2
  WH-1000XM4

These are the names primary_sink and secondary_sink should be set to in the config file and what show up under Settings › Outputs.

Listing a File's Tracks

In order to provide track numbers for other commands, you need to determine what those numbers are.

tineplayer --list-tracks video.mkv

This prints every soundtrack and subtitle in the file with its number. Each row names the language as the file tagged it and the language as detected, the format, and the track kind if known. Both lists offer 0 for none.

Both lists cover the embedded tracks and files beside the video: external audio files and subtitle files are numbered continuing from the embedded tracks. Those numbers are what can be passed to --primary, --secondary and --subtitle.

Audio tracks (3):

  0  None
  1  eng (English) - AAC 2ch
  2  rus (Русский) - AAC 6ch
  3  English - Audio Description

Subtitles (2):

  0  None
  1  eng (English) - SRT
  2  en.forced (English) - Forced

Audio track 3 is an example of a file beside the video (Film (2019).en.ad.mp3).

Choosing Soundtracks

--primary and --secondary each accept any of the following values:

GivenMeans
3The third entry --list-tracks printed, whether that is a track inside the video or a file beside it
enThe first track in that language
adThe first described track
en:adThe first described track in that language
0 or noneNothing on this output
a pathThat external audio file on this output

A language code on its own will never select an audio description or commentary track.

A language code and ad search the files beside the video as well as the tracks inside it, reading the language and the type from the name a file was given. So --primary en:ad finds Film (2019).en.ad.mp3 as readily as a described stream in the video.

Anything that resolves to a file is treated as one, such as a path on disk, or a URL. Any sync already saved for that pairing is applied.

tineplayer video.mkv --primary en --secondary "Video (2019) AD.mp3"

Choosing Subtitles

--subtitle either names one particular subtitle or asks for one to be chosen. It overrides your subtitle preferences for this run:

GivenMeans
none or 0No subtitles
3The third subtitle --list-tracks printed
en.hiThe track whose label reads that way, as --list-tracks printed it
ruThe first subtitle in that language
a file nameA subtitle file with that name beside the video
a pathAn absolute path to a subtitle file
forced_only, forced, full or sdhSpecific type, following Subtitle Type rules

When setting by a type, you can also specify which language, which can be anything the Subtitle Language setting takes:

--subtitle sdh:fr             SDH, in French
--subtitle full:first_only    Full subtitles in the first output's language
--subtitle forced             Forced only, in whichever language you have configured

If the second part is omitted, then it will fall back to the subtitle preference setting.

Starting Playback Directly

To skip the media page and start playback immediately pass the --play argument.

tineplayer video.mkv --play

It will load any saved selections from a previous play of that video, or your language preferences if it has not been played before, or you can pass more options to specify what tracks to select:

# Straight into playback, with these soundtracks
tineplayer video.mkv --play --primary 5 --secondary 1

# The same choices, but opening the media page first
tineplayer video.mkv --primary 5 --secondary 1

Fullscreen

--fullscreen starts fullscreen; --windowed starts windowed.

If --fullscreen is passed in addition to --external, TinePlayer will disallow toggling fullscreen off and hide the toggle button.