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 ruThe simplest option is to choose Add TinePlayer to PATH when installing. With that enabled, you can simply run
TinePlayerin a terminal from any location.Without it, the full path to the exe needs to be provided:
Installed Program For the current user only %LOCALAPPDATA%\Programs\TinePlayer\TinePlayer.exeFor all users C:\Program Files\TinePlayer\TinePlayer.exeFrom the portable ZIP TinePlayer.exe, wherever you unpacked it -
macOS
/Applications/TinePlayer.app/Contents/MacOS/tineplayer video.mkv --primary en --secondary ruThe 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 ruThe package puts
tineplayeron 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
| Option | What it does |
|---|---|
FILE | The 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 |
--play | Start playing immediately rather than opening the media page. Requires FILE |
--list-tracks | Print a file's soundtracks and subtitles, with their numbers. Requires FILE |
--list-devices | Print the current machine's audio outputs by name |
--restart | Start playback from the beginning, ignoring a saved progress |
--forget | Forget remembered positions and choices. With a FILE, only that file |
--fullscreen | Launch in fullscreen mode |
--windowed | Launch in windowed mode |
--external | Used when launched by another application. Requires FILE. See Advanced integration |
--kodi | Launched by Kodi. Implies --external |
-V, --version | Print the version |
-h, --help | Print 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:
| Given | Means |
|---|---|
3 | The third entry --list-tracks printed, whether that is a track inside the video or a file beside it |
en | The first track in that language |
ad | The first described track |
en:ad | The first described track in that language |
0 or none | Nothing on this output |
| a path | That 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:
| Given | Means |
|---|---|
none or 0 | No subtitles |
3 | The third subtitle --list-tracks printed |
en.hi | The track whose label reads that way, as --list-tracks printed it |
ru | The first subtitle in that language |
| a file name | A subtitle file with that name beside the video |
| a path | An absolute path to a subtitle file |
forced_only, forced, full or sdh | Specific 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.
Next: Troubleshooting - sorted by what is going wrong.