neulab/tldr huggingface dataset:
-Dblack_belt_mode=?         Keep warning messages to a minimum [true,false] -DuserplotX=FILE[,FILE2]    For sequence 'X' open one or more userplots -DloguserplotX=FILE[,FILE2] For sequence 'X' open one or more userplots, take log(data) -DbamX=FILE[,FILE2,...]     For sequence 'X' open one or more BAM, CRAM, VCF, or BCF files -Dchado="h:p/d?u"           Get ACT to open this CHADO database -Dread_only                 Open CHADO database read-only
% act % act af063097.embl af063097_v_b132222.crunch b132222.embl % act -Dblack_belt_mode=true -Dbam1=MAL_0h.bam -Dbam2=MAL_7h.bam,var.raw.new.bcf % act -Duserplot2=/pathToFile/userPlot
https://sanger-pathogens.github.io/Artemis/ACT/
art(1), dnaplotter(1)
GPASSWD(1)                        User Commands                       GPASSWD(1)
gpasswd - administer /etc/group and /etc/gshadow
gpasswd [option] group
The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password.
System administrators can use the -A option to define group administrator(s) and the -M option to define members. They have all rights of group administrators and members.
gpasswd called by a group administrator with a group name only prompts for the new password of the group.
If a password is set the members can still use newgrp(1) without a password, and non-members must supply the password.
Notes about group passwords Group passwords are an inherent security problem since more than one person is permitted to know the password. However, groups are a useful tool for permitting co-operation between different users.
Except for the -A and -M options, the options cannot be combined.
The options which apply to the gpasswd command are:
-a, --add user Add the user to the named group.
-d, --delete user Remove the user from the named group.
-Q, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory.
-r, --remove-password Remove the password from the named group. The group password will be empty. Only group members will be allowed to use newgrp to join the named group.
-R, --restrict Restrict the access to the named group. The group password is set to "!". Only group members with a password will be allowed to use newgrp to join the named group.
-A, --administrators user,... Set the list of administrative users.
-M, --members user,... Set the list of group members.
This tool only operates on the /etc/group and /etc/gshadow files.  Thus you cannot change any NIS or LDAP group. This must be performed on the corresponding server.
ENCRYPT_METHOD (string) This defines the system default encryption algorithm for encrypting passwords (if no algorithm are specified on the command line).
It can take one of these values: DES (default), MD5, SHA256, SHA512.
Note: this parameter overrides the MD5_CRYPT_ENAB variable.
MD5_CRYPT_ENAB (boolean) Indicate if passwords must be encrypted using the MD5-based algorithm. If set to yes, new passwords will be encrypted using the MD5-based algorithm compatible with the one used by recent releases of FreeBSD. It supports passwords of unlimited length and longer salt strings. Set to no if you need to copy encrypted passwords to other systems which don't understand the new algorithm. Default is no.
This variable is superseded by the ENCRYPT_METHOD variable or by any command line option used to configure the encryption algorithm.
This variable is deprecated. You should use ENCRYPT_METHOD.
SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number) When ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the number of SHA rounds used by the encryption algorithm by default (when the number of rounds is not specified on the command line).
With a lot of rounds, it is more difficult to brute forcing the password. But note also that more CPU resources will be needed to authenticate users.
If not specified, the libc will choose the default number of rounds (5000).
The values must be inside the 1000-999,999,999 range.
If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS values is set, then this value will be used.
If SHA_CRYPT_MIN_ROUNDS > SHA_CRYPT_MAX_ROUNDS, the highest value will be used.
newgrp(1), groupadd(8), groupdel(8), groupmod(8), grpck(8), group(5), gshadow(5).
REV(1)                            User Commands                           REV(1)
rev - reverse lines characterwise
rev [option] [file...]
The rev utility copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.
This utility is a line-oriented tool and it uses in-memory allocated buffer for a whole wide-char line. If the input file is huge and without line breaks than allocate the memory for the file may be unsuccessful.
tac(1)
The rev command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
XXD(1)                       General Commands Manual                      XXD(1)
xxd - make a hexdump or do the reverse.
xxd -h[elp] xxd [options] [infile [outfile]] xxd -r[evert] [options] [infile [outfile]]
xxd creates a hex dump of a given file or standard input.  It can also convert a hex dump back to its original binary form.  Like uuencode(1) and uudecode(1) it allows the transmission of binary data in a `mail- safe' ASCII representation, but has the advantage of decoding to standard output.  Moreover, it can be used to perform binary file patching.
If no infile is given, standard input is read.  If infile is specified as a `-' character, then input is taken from standard input.  If no outfile is given (or a `-' character is in its place), results are sent to standard output.
Note that a "lazy" parser is used which does not check for more than the first option letter, unless the option is followed by a parameter. Spaces between a single option letter and its parameter are optional. Parameters to options can be specified in decimal, hexadecimal or octal notation.  Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent.
-a | -autoskip Toggle autoskip: A single '*' replaces nul-lines.  Default off.
-b | -bits Switch to bits (binary digits) dump, rather than hexdump.  This option writes octets as eight digits "1"s and "0"s instead of a normal hexadecimal dump. Each line is preceded by a line number in hexadecimal and followed by an ascii (or ebcdic) representation. The command line switches -r, -p, -i do not work with this mode.
-c cols | -cols cols Format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b: 6). Max 256.
-C | -capitalize Capitalize variable names in C include file style, when using -i.
-E | -EBCDIC Change the character encoding in the righthand column from ASCII to EBCDIC.  This does not change the hexadecimal representation. The option is meaningless in combinations with -r, -p or -i.
-e     Switch to little-endian hexdump.  This option treats byte groups as words in little-endian byte order.  The default grouping of 4 bytes may be changed using -g.  This option only applies to hexdump, leaving the ASCII (or EBCDIC) representation unchanged. The command line switches -r, -p, -i do not work with this mode.
-g bytes | -groupsize bytes Separate the output of every <bytes> bytes (two hex characters or eight bit-digits each) by a whitespace.  Specify -g 0 to suppress grouping.  <Bytes> defaults to 2 in normal mode, 4 in little- endian mode and 1 in bits mode.  Grouping does not apply to postscript or include style.
-h | -help Print a summary of available commands and exit.  No hex dumping is performed.
-i | -include Output in C include file style. A complete static array definition is written (named after the input file), unless xxd reads from stdin.
-l len | -len len Stop after writing <len> octets.
-o offset Add <offset> to the displayed file position.
-p | -ps | -postscript | -plain Output in postscript continuous hexdump style. Also known as plain hexdump style.
-r | -revert Reverse operation: convert (or patch) hexdump into binary.  If not writing to stdout, xxd writes into its output file without truncating it. Use the combination -r -p to read plain hexadecimal dumps without line number information and without a particular column layout. Additional Whitespace and line-breaks are allowed anywhere.
-seek offset When used after -r: revert with <offset> added to file positions found in hexdump.
-s [+][-]seek Start at <seek> bytes abs. (or rel.) infile offset.  + indicates that the seek is relative to the current stdin file position (meaningless when not reading from stdin).  - indicates that the seek should be that many characters from the end of the input (or if combined with +: before the current stdin file position). Without -s option, xxd starts at the current file position.
-u     Use upper case hex letters. Default is lower case.
-v | -version Show version string.
xxd -r has some builtin magic while evaluating line number information. If the output file is seekable, then the linenumbers at the start of each hexdump line may be out of order, lines may be missing, or overlapping. In these cases xxd will lseek(2) to the next position. If the output file is not seekable, only gaps are allowed, which will be filled by null- bytes.
xxd -r never generates parse errors. Garbage is silently skipped.
When editing hexdumps, please note that xxd -r skips everything on the input line after reading enough columns of hexadecimal data (see option -c). This also means, that changes to the printable ascii (or ebcdic) columns are always ignored. Reverting a plain (or postscript) style hexdump with xxd -r -p does not depend on the correct number of columns. Here anything that looks like a pair of hex-digits is interpreted.
Note the difference between % xxd -i file and % xxd -i < file
xxd -s +seek may be different from xxd -s seek, as lseek(2) is used to "rewind" input.  A '+' makes a difference if the input source is stdin, and if stdin's file position is not at the start of the file by the time xxd is started and given its input.  The following examples may help to clarify (or further confuse!)...
Rewind stdin before reading; needed because the `cat' has already read to the end of stdin. % sh -c "cat > plain_copy; xxd -s 0 > hex_copy" < file
Hexdump from file position 0x480 (=1024+128) onwards.  The `+' sign means "relative to the current position", thus the `128' adds to the 1k where dd left off. % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet" < file
Hexdump from file position 0x100 ( = 1024-768) on. % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet" < file
However, this is a rare situation and the use of `+' is rarely needed. The author prefers to monitor the effect of xxd with strace(1) or truss(1), whenever -s is used.
Print everything but the first three lines (hex 0x30 bytes) of file. % xxd -s 0x30 file
Print 3 lines (hex 0x30 bytes) from the end of file. % xxd -s -0x30 file
Print 120 bytes as continuous hexdump with 20 octets per line. % xxd -l 120 -ps -c 20 xxd.1 2e54482058584420312022417567757374203139 39362220224d616e75616c207061676520666f72 20787864220a2e5c220a2e5c222032317374204d 617920313939360a2e5c22204d616e2070616765 20617574686f723a0a2e5c2220202020546f6e79 204e7567656e74203c746f6e79407363746e7567
Hexdump the first 120 bytes of this man page with 12 octets per line. % xxd -l 120 -c 12 xxd.1 0000000: 2e54 4820 5858 4420 3120 2241  .TH XXD 1 "A 000000c: 7567 7573 7420 3139 3936 2220  ugust 1996" 0000018: 224d 616e 7561 6c20 7061 6765  "Manual page 0000024: 2066 6f72 2078 7864 220a 2e5c   for xxd"..\ 0000030: 220a 2e5c 2220 3231 7374 204d  "..\" 21st M 000003c: 6179 2031 3939 360a 2e5c 2220  ay 1996..\" 0000048: 4d61 6e20 7061 6765 2061 7574  Man page aut 0000054: 686f 723a 0a2e 5c22 2020 2020  hor:..\" 0000060: 546f 6e79 204e 7567 656e 7420  Tony Nugent 000006c: 3c74 6f6e 7940 7363 746e 7567  <tony@sctnug
Display just the date from the file xxd.1 % xxd -s 0x36 -l 13 -c 13 xxd.1 0000036: 3231 7374 204d 6179 2031 3939 36  21st May 1996
Copy input_file to output_file and prepend 100 bytes of value 0x00. % xxd input_file | xxd -r -s 100 > output_file
Patch the date in the file xxd.1 % echo "0000037: 3574 68" | xxd -r - xxd.1 % xxd -s 0x36 -l 13 -c 13 xxd.1 0000036: 3235 7468 204d 6179 2031 3939 36  25th May 1996
Create a 65537 byte file with all bytes 0x00, except for the last one which is 'A' (hex 0x41). % echo "010000: 41" | xxd -r > file
Hexdump this file with autoskip. % xxd -a -c 12 file 0000000: 0000 0000 0000 0000 0000 0000  ............ * 000fffc: 0000 0000 40                   ....A
Create a 1 byte file containing a single 'A' character.  The number after '-r -s' adds to the linenumbers found in the file; in effect, the leading bytes are suppressed. % echo "010000: 41" | xxd -r -s -0x10000 > file
Use xxd as a filter within an editor such as vim(1) to hexdump a region marked between `a' and `z'. :'a,'z!xxd
Use xxd as a filter within an editor such as vim(1) to recover a binary hexdump marked between `a' and `z'. :'a,'z!xxd -r
Use xxd as a filter within an editor such as vim(1) to recover one line of a hexdump.  Move the cursor over the line and type: !!xxd -r
Read single characters from a serial line % xxd -c1 < /dev/term/b & % stty < /dev/term/b -echo -opost -isig -icanon min 1 % echo -n foo > /dev/term/b
The following error values are returned:
0      no errors encountered.
-1     operation not supported ( xxd -r -i still impossible).
1      error while parsing options.
2      problems with input file.
3      problems with output file.
4,5    desired seek position is unreachable.
uuencode(1), uudecode(1), patch(1)
The tools weirdness matches its creators brain.  Use entirely at your own risk. Copy files. Trace it. Become a wizard.
This manual page documents xxd version 1.7
(c) 1990-1997 by Juergen Weigert <jnweiger@informatik.uni-erlangen.de>
Distribute freely and credit me, make money and share with me, lose money and don't ask me.
Manual page started by Tony Nugent <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au> Small changes by Bram Moolenaar.  Edited by Juergen Weigert.
MPV(1)                             multimedia                             MPV(1)
mpv - a media player
mpv [options] [file|URL|PLAYLIST|-] mpv [options] files
mpv is a media player based on MPlayer and mplayer2. It supports a wide variety of video file formats, audio and video codecs, and subtitle types. Special input URL types are available to read input from a variety of sources other than disk files. Depending on platform, a variety of different video and audio output methods are supported.
mpv has a fully configurable, command-driven control layer which allows you to control mpv using keyboard, mouse, or remote control (there is no LIRC support - configure remotes as input devices instead).
See the --input- options for ways to customize it.
The following listings are not necessarily complete. See etc/input.conf for a list of default bindings. User input.conf files and Lua scripts can define additional key bindings.
See also --input-test for interactive binding details by key, and the stats built-in script for key bindings list (including print to terminal).
Keyboard Control LEFT and RIGHT Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek (see --hr-seek).
UP and DOWN Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see --hr-seek).
Ctrl+LEFT and Ctrl+RIGHT Seek to the previous/next subtitle. Subject to some restrictions and might not always work; see sub-seek command.
Ctrl+Shift+Left and Ctrl+Shift+Right Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio.
[ and ] Decrease/increase current playback speed by 10%.
{ and } Halve/double current playback speed.
BACKSPACE Reset playback speed to normal.
Shift+BACKSPACE Undo the last seek. This works only if the playlist entry was not changed.  Hitting it a second time will go back to the original position.  See revert-seek command for details.
Shift+Ctrl+BACKSPACE Mark the current position. This will then be used by Shift+BACKSPACE as revert position (once you seek back, the marker will be reset). You can use this to seek around in the file and then return to the exact position where you left off.
< and > Go backward/forward in the playlist.
ENTER  Go forward in the playlist.
p / SPACE Pause (pressing again unpauses).
.      Step forward. Pressing once will pause, every consecutive press will play one frame and then go into pause mode again.
,      Step backward. Pressing once will pause, every consecutive press will play one frame in reverse and then go into pause mode again.
q      Stop playing and quit.
Q      Like q, but store the current playback position. Playing the same file later will resume at the old playback position if possible.
/ and * Decrease/increase volume.
9 and 0 Decrease/increase volume.
m      Mute sound.
_      Cycle through the available video tracks.
#      Cycle through the available audio tracks.
f      Toggle fullscreen (see also --fs).
ESC    Exit fullscreen mode.
T      Toggle stay-on-top (see also --ontop).
w and W Decrease/increase pan-and-scan range. The e key does the same as W currently, but use is discouraged.
o (also P) Show progression bar, elapsed time and total duration on the OSD.
O      Toggle OSD states between normal and playback time/duration.
v      Toggle subtitle visibility.
j and J Cycle through the available subtitles.
z and Z Adjust subtitle delay by +/- 0.1 seconds. The x key does the same as Z currently, but use is discouraged.
l      Set/clear A-B loop points. See ab-loop command for details.
L      Toggle infinite looping.
Ctrl + and Ctrl - Adjust audio delay (A/V sync) by +/- 0.1 seconds.
Shift+g and Shift+f Adjust subtitle font size by +/- 10%.
u      Switch between applying no style overrides to SSA/ASS subtitles, and overriding them almost completely with the normal subtitle style. See --sub-ass-override for more info.
V      Toggle subtitle VSFilter aspect compatibility mode. See --sub-ass-vsfilter-aspect-compat for more info.
r and R Move subtitles up/down. The t key does the same as R currently, but use is discouraged.
s      Take a screenshot.
S      Take a screenshot, without subtitles. (Whether this works depends on VO driver support.)
Ctrl s Take a screenshot, as the window shows it (with subtitles, OSD, and scaled video).
PGUP and PGDWN Seek to the beginning of the previous/next chapter. In most cases, "previous" will actually go to the beginning of the current chapter; see --chapter-seek-threshold.
Shift+PGUP and Shift+PGDWN Seek backward or forward by 10 minutes. (This used to be mapped to PGUP/PGDWN without Shift.)
d      Activate/deactivate deinterlacer.
A      Cycle aspect ratio override.
Ctrl h Toggle hardware video decoding on/off.
Alt+LEFT, Alt+RIGHT, Alt+UP, Alt+DOWN Move the video rectangle (panning).
Alt + and Alt - Combining Alt with the + or - keys changes video zoom.
Alt+BACKSPACE Reset the pan/zoom settings.
F8     Show the playlist and the current position in it (useful only if a UI window is used, broken on the terminal).
F9     Show the list of audio and subtitle streams (useful only if a UI window  is used, broken on the terminal).
i and I Show/toggle an overlay displaying statistics about the currently playing file such as codec, framerate, number of dropped frames and so on. See STATS for more information.
del    Cycle OSC visibility between never / auto (mouse-move) / always
`      Show the console. (ESC closes it again. See CONSOLE.)
(The following keys are valid only when using a video output that supports the corresponding adjustment.)
1 and 2 Adjust contrast.
3 and 4 Adjust brightness.
5 and 6 Adjust gamma.
7 and 8 Adjust saturation.
Alt+0 (and command+0 on macOS) Resize video window to half its original size.
Alt+1 (and command+1 on macOS) Resize video window to its original size.
Alt+2 (and command+2 on macOS) Resize video window to double its original size.
command + f (macOS only) Toggle fullscreen (see also --fs).
PAUSE  Pause.
STOP   Stop playing and quit.
PREVIOUS and NEXT Seek backward/forward 1 minute.
If you miss some older key bindings, look at etc/restore-old-bindings.conf in the mpv git repository.
Mouse Control Left double click Toggle fullscreen on/off.
Right click Toggle pause on/off.
Forward/Back button Skip to next/previous entry in playlist.
Wheel up/down Seek forward/backward 10 seconds.
Wheel left/right Decrease/increase volume.
Command line arguments starting with - are interpreted as options, everything else as filenames or URLs. All options except flag options (or choice options which include yes) require a parameter in the form --option=value.
One exception is the lone - (without anything else), which means media data will be read from stdin. Also, -- (without anything else) will make the player interpret all following arguments as filenames, even if they start with -. (To play a file named -, you need to use ./-.)
Every flag option has a no-flag counterpart, e.g. the opposite of the --fs option is --no-fs. --fs=yes is same as --fs, --fs=no is the same as --no-fs.
Legacy option syntax The --option=value syntax is not strictly enforced, and the alternative legacy syntax -option value and -option=value will also work. This is mostly  for compatibility with MPlayer. Using these should be avoided. Their semantics can change any time in the future.
For example, the alternative syntax will consider an argument following the option a filename. mpv -fs no will attempt to play a file named no, because --fs is a flag option that requires no parameter. If an option changes and its parameter becomes optional, then a command line using the alternative syntax will break.
Until mpv 0.31.0, there was no difference whether an option started with -- or a single -. Newer mpv releases strictly expect that you pass the option value after a =. For example, before mpv --log-file f.txt would write a log to f.txt, but now this command line fails, as --log-file expects an option value, and f.txt is simply considered a normal file to be played (as in mpv f.txt).
The future plan is that -option value will not work anymore, and options with a single - behave the same as -- options.
Escaping spaces and other special characters Keep in mind that the shell will partially parse and mangle the arguments you pass to mpv. For example, you might need to quote or escape options and filenames: mpv "filename with spaces.mkv" --title="window title"
It gets more complicated if the suboption parser is involved. The suboption parser puts several options into a single string, and passes them to a component at once, instead of using multiple options on the level of the command line.
The suboption parser can quote strings with " and [...].  Additionally, there is a special form of quoting with %n% described below.
For example, assume the hypothetical foo filter can take multiple options: mpv test.mkv --vf=foo:option1=value1:option2:option3=value3,bar
This passes option1 and option3 to the foo filter, with option2 as flag (implicitly option2=yes), and adds a bar filter after that. If an option contains spaces or characters like , or :, you need to quote them: mpv '--vf=foo:option1="option value with spaces",bar'
Shells may actually strip some quotes from the string passed to the commandline, so the example quotes the string twice, ensuring that mpv receives the " quotes.
The [...] form of quotes wraps everything between [ and ]. It's useful with shells that don't interpret these characters in the middle of an argument (like bash). These quotes are balanced (since mpv 0.9.0): the [ and ] nest, and the quote terminates on the last ] that has no matching [ within the string. (For example, [a[b]c] results in a[b]c.)
The fixed-length quoting syntax is intended for use with external scripts and programs.
It is started with % and has the following format:
%n%string_of_length_n
mpv '--vf=foo:option1=%11%quoted text' test.avi
Or in a script:
mpv --vf=foo:option1=%`expr length "$NAME"`%"$NAME" test.avi
Note: where applicable with JSON-IPC, %n% is the length in UTF-8 bytes, after decoding the JSON data.
Suboptions passed to the client API are also subject to escaping. Using mpv_set_option_string() is exactly like passing --name=data to the command line (but without shell processing of the string). Some options support passing values in a more structured way instead of flat strings, and can avoid the suboption parsing mess. For example, --vf supports MPV_FORMAT_NODE, which lets you pass suboptions as a nested data structure of maps and arrays.
Paths Some care must be taken when passing arbitrary paths and filenames to mpv. For example, paths starting with - will be interpreted as options. Likewise, if a path contains the sequence ://, the string before that might be interpreted as protocol prefix, even though :// can be part of a legal UNIX path. To avoid problems with arbitrary paths, you should be sure that absolute paths passed to mpv start with /, and prefix relative paths with ./.
Using the file:// pseudo-protocol is discouraged, because it involves strange URL unescaping rules.
The name - itself is interpreted as stdin, and will cause mpv to disable console controls. (Which makes it suitable for playing data piped to stdin.)
The special argument -- can be used to stop mpv from interpreting the following arguments as options.
When using the client API, you should strictly avoid using mpv_command_string for invoking the loadfile command, and instead prefer e.g. mpv_command to avoid the need for filename escaping.
For paths passed to suboptions, the situation is further complicated by the need to escape special characters. To work this around, the path can be additionally wrapped in the fixed-length syntax, e.g. %n%string_of_length_n (see above).
Some mpv options interpret paths starting with ~.  Currently, the prefix ~~home/ expands to the mpv configuration directory (usually ~/.config/mpv/).  ~/ expands to the user's home directory. (The trailing / is always required.) The following paths are currently recognized:
┌─────────────┬─────────────────────────────┐ │Name         │ Meaning                     │ ├─────────────┼─────────────────────────────┤ │~~/          │ If the subpath exists in    │ │             │ any of the mpv's config     │ │             │ directories the path of the │ │             │ existing file/dir is        │ │             │ returned. Otherwise this is │ │             │ equivalent to ~~home/.      │ │             │ Note that if --no-config is │ │             │ used ~~/foobar will resolve │ │             │ to foobar which can be      │ │             │ unexpected.                 │ ├─────────────┼─────────────────────────────┤ │~/           │ user home directory root    │ │             │ (similar to shell, $HOME)   │ └─────────────┴─────────────────────────────┘
│~~home/      │ mpv config dir (for example │ │             │ ~/.config/mpv/)             │ ├─────────────┼─────────────────────────────┤ │~~global/    │ the global config path, if  │ │             │ available (not on win32)    │ ├─────────────┼─────────────────────────────┤ │~~osxbundle/ │ the macOS bundle resource   │ │             │ path (macOS only)           │ ├─────────────┼─────────────────────────────┤ │~~desktop/   │ the path to the desktop     │ │             │ (win32, macOS)              │ ├─────────────┼─────────────────────────────┤ │~~exe_dir/   │ win32 only: the path to the │ │             │ directory containing the    │ │             │ exe (for config file        │ │             │ purposes; $MPV_HOME         │ │             │ overrides it)               │ ├─────────────┼─────────────────────────────┤ │~~old_home/  │ do not use                  │ └─────────────┴─────────────────────────────┘
Per-File Options When playing multiple files, any option given on the command line usually affects all files. Example:
mpv --a file1.mkv --b file2.mkv --c
┌──────────┬────────────────┐ │File      │ Active options │ ├──────────┼────────────────┤ │file1.mkv │ --a --b --c    │ ├──────────┼────────────────┤ │file2.mkv │ --a --b --c    │ └──────────┴────────────────┘
(This is different from MPlayer and mplayer2.)
Also, if any option is changed at runtime (via input commands), they are not reset when a new file is played.
Sometimes, it is useful to change options per-file. This can be achieved by adding the special per-file markers --{ and --}. (Note that you must escape these on some shells.) Example:
mpv --a file1.mkv --b --\{ --c file2.mkv --d file3.mkv --e --\} file4.mkv --f
┌──────────┬─────────────────────────┐ │File      │ Active options          │ ├──────────┼─────────────────────────┤ │file1.mkv │ --a --b --f             │ ├──────────┼─────────────────────────┤ │file2.mkv │ --a --b --f --c --d --e │ ├──────────┼─────────────────────────┤ │file3.mkv │ --a --b --f --c --d --e │ ├──────────┼─────────────────────────┤ │file4.mkv │ --a --b --f             │ └──────────┴─────────────────────────┘
Additionally, any file-local option changed at runtime is reset when the current file stops playing. If option --c is changed during playback of file2.mkv, it is reset when advancing to file3.mkv. This only affects file-local options. The option --a is never reset here.
List Options Some options which store lists of option values can have action suffixes. For example, the --display-tags option takes a ,-separated list of tags, but the option also allows you to append a single tag with --display-tags-append, and the tag name can for example contain a literal , without the need for escaping.
String list and path list options String lists are separated by ,. The strings are not parsed or interpreted by the option system itself. However, most
Path or file list options use : (Unix) or ; (Windows) as separator, instead of ,.
They support the following operations:
┌────────┬─────────────────────────────┐ │Suffix  │ Meaning                     │ ├────────┼─────────────────────────────┤ │-set    │ Set a list of items (using  │ │        │ the list separator, escaped │ │        │ with backslash)             │ ├────────┼─────────────────────────────┤ │-append │ Append single item (does    │ │        │ not interpret escapes)      │ ├────────┼─────────────────────────────┤ │-add    │ Append 1 or more items      │ │        │ (same syntax as -set)       │ ├────────┼─────────────────────────────┤ │-pre    │ Prepend 1 or more items     │ │        │ (same syntax as -set)       │ ├────────┼─────────────────────────────┤ │-clr    │ Clear the option (remove    │ │        │ all items)                  │ ├────────┼─────────────────────────────┤ │-remove │ Delete item if present      │ │        │ (does not interpret         │ │        │ escapes)                    │ ├────────┼─────────────────────────────┤ │-del    │ Delete 1 or more items by   │ │        │ integer index (deprecated)  │ ├────────┼─────────────────────────────┤ │-toggle │ Append an item, or remove   │ │        │ if if it already exists (no │ │        │ escapes)                    │ └────────┴─────────────────────────────┘
-append is meant as a simple way to append a single item without having to escape the argument (you may still need to escape on the shell level).
Key/value list options A key/value list is a list of key/value string pairs. In programming languages, this type of data structure is often called a map or a dictionary. The order normally does not matter, although in some cases the order might matter.
┌────────┬─────────────────────────────┐ │Suffix  │ Meaning                     │ ├────────┼─────────────────────────────┤ │-set    │ Set a list of items (using  │ │        │ , as separator)             │ ├────────┼─────────────────────────────┤ │-append │ Append a single item        │ │        │ (escapes for the key, no    │ │        │ escapes for the value)      │ ├────────┼─────────────────────────────┤ │-add    │ Append 1 or more items      │ │        │ (same syntax as -set)       │ └────────┴─────────────────────────────┘
│-remove │ Delete item by key if       │ │        │ present (does not interpret │ │        │ escapes)                    │ └────────┴─────────────────────────────┘
Keys are unique within the list. If an already present key is set, the existing key is removed before the new value is appended.
If you want to pass a value without interpreting it for escapes or ,, it is recommended to use the -add variant. When using libmpv, prefer using MPV_FORMAT_NODE_MAP; when using a scripting backend or the JSON IPC, use an appropriate structured data type.
Prior to mpv 0.33, : was also recognized as separator by -set.
Filter options This is a very complex option type for the --af and --vf options only. They often require complicated escaping. See VIDEO FILTERS for details. They support the following operations:
┌────────┬─────────────────────────────┐ │Suffix  │ Meaning                     │ ├────────┼─────────────────────────────┤ │-set    │ Set a list of filters       │ │        │ (using , as separator)      │ ├────────┼─────────────────────────────┤ │-append │ Append single filter        │ ├────────┼─────────────────────────────┤ │-add    │ Append 1 or more filters    │ │        │ (same syntax as -set)       │ ├────────┼─────────────────────────────┤ │-pre    │ Prepend 1 or more filters   │ │        │ (same syntax as -set)       │ ├────────┼─────────────────────────────┤ │-clr    │ Clear the option (remove    │ │        │ all filters)                │ ├────────┼─────────────────────────────┤ │-remove │ Delete filter if present    │ ├────────┼─────────────────────────────┤ │-del    │ Delete 1 or more filters by │ │        │ integer index or filter     │ │        │ label (deprecated)          │ ├────────┼─────────────────────────────┤ │-toggle │ Append a filter, or remove  │ │        │ if if it already exists     │ ├────────┼─────────────────────────────┤ │-help   │ Pseudo operation that       │ │        │ prints a help text to the   │ │        │ terminal                    │ └────────┴─────────────────────────────┘
General Without suffix, the operation used is normally -set.
Although some operations allow specifying multiple items, using this is strongly discouraged and deprecated, except for -set. There is a chance that operations like -add and -pre will work like -append and accept a single, unescaped item only (so the , separator will not be interpreted and is passed on as part of the value).
Some options (like --sub-file, --audio-file, --glsl-shader) are aliases for the proper option with -append action. For example, --sub-file is an alias for --sub-files-append.
Options of this type can be changed at runtime using the change-list command, which takes the suffix (without the -) as separate operation parameter.
Location and Syntax You can put all of the options in configuration files which will be read every time mpv is run. The system-wide configuration file 'mpv.conf' is in your configuration directory (e.g. /etc/mpv or /usr/local/etc/mpv), the user-specific one is ~/.config/mpv/mpv.conf. For details and platform specifics (in particular Windows paths) see the FILES section.
User-specific options override system-wide options and options given on the command line override either. The syntax of the configuration files is option=value. Everything after a # is considered a comment. Options that work without values can be enabled by setting them to yes and disabled by setting them to no. Even suboptions can be specified in this way.
# Use GPU-accelerated video output by default. vo=gpu # Use quotes for text that can contain spaces: term-status-msg="Time: ${time-pos}"
Escaping spaces and special characters This is done like with command line options. The shell is not involved here, but option values still need to be quoted as a whole if it contains certain characters like spaces. A config entry can be quoted with ", as well as with the fixed-length syntax (%n%) mentioned before. This is like passing the exact contents of the quoted string as command line option. C-style escapes are currently _not_ interpreted on this level, although some options do this manually. (This is a mess and should probably be changed at some point.)
Putting Command Line Options into the Configuration File Almost all command line options can be put into the configuration file. Here is a small guide:
┌──────────────────┬──────────────────────────┐ │Option            │ Configuration file entry │ ├──────────────────┼──────────────────────────┤ │--flag            │ flag                     │ ├──────────────────┼──────────────────────────┤ │-opt val          │ opt=val                  │ ├──────────────────┼──────────────────────────┤ │--opt=val         │ opt=val                  │ ├──────────────────┼──────────────────────────┤ │-opt "has spaces" │ opt="has spaces"         │ └──────────────────┴──────────────────────────┘
File-specific Configuration Files You can also write file-specific configuration files. If you wish to have a configuration file for a file called 'video.avi', create a file named 'video.avi.conf' with the file-specific options in it and put it in ~/.config/mpv/. You can also put the configuration file in the same directory as the file to be played. Both require you to set the --use-filedir-conf option (either on the command line or in your global config file). If a file-specific configuration file is found in the same directory, no file-specific configuration is loaded from ~/.config/mpv. In addition, the --use-filedir-conf option enables directory-specific configuration files.  For this, mpv first tries to load a mpv.conf from the same directory as the file played and then tries to load any file-specific configuration.
Profiles To ease working with different configurations, profiles can be defined in the configuration files. A profile starts with its name in square brackets, e.g. [my-profile]. All following options will be part of the profile. A description (shown by --profile=help) can be defined with the profile-desc option. To end the profile, start another one or use the profile name default to continue with normal options.
You can list profiles with --profile=help, and show the contents of a profile with --show-profile=<name> (replace <name> with the profile name). You can apply profiles on start with the --profile=<name> option, or at runtime with the apply-profile <name> command.
Example mpv config file with profiles
# normal top-level option fullscreen=yes
# a profile that can be enabled with --profile=big-cache [big-cache] cache=yes demuxer-max-bytes=123400KiB demuxer-readahead-secs=20
[slow] profile-desc="some profile name" # reference a builtin profile profile=gpu-hq
[fast] vo=vdpau
# using a profile again extends it [slow] framedrop=no # you can also include other profiles profile=big-cache
Runtime profiles Profiles can be set at runtime with apply-profile command. Since this operation is "destructive" (every item in a profile is simply set as an option, overwriting the previous value), you can't just enable and disable profiles again.
As a partial remedy, there is a way to make profiles save old option values before overwriting them with the profile values, and then restoring the old values at a later point using apply-profile <profile-name> restore.
This can be enabled with the profile-restore option, which takes one of the following options:
default Does nothing, and nothing can be restored (default).
copy   When applying a profile, copy the old values of all profile options to a backup before setting them from the profile. These options are reset to their old values using the backup when restoring.
Every profile has its own list of backed up values. If the backup already exists (e.g. if apply-profile name was called more than once in a row), the existing backup is no changed. The restore operation will remove the backup.
It's important to know that restoring does not "undo" setting an option, but simply copies the old option value. Consider for example vf-add, appends an entry to vf. This mechanism will simply copy the entire vf list, and does _not_ execute the inverse of vf-add (that would be vf-remove) on restoring.
Note that if a profile contains recursive profiles (via the profile option), the options in these recursive profiles are treated as if they were part of this profile. The referenced profile's backup list is not used when creating or using the backup. Restoring a profile does not restore referenced profiles, only the options of referenced profiles (as if they were part of the main profile).
copy-equal Similar to copy, but restore an option only if it has the same value as the value effectively set by the profile. This tries to deal with the situation when the user does not want the option to be reset after interactively changing it.
[something] profile-restore=copy-equal vf-add=rotate=90
Then running these commands will result in behavior as commented:
set vf vflip apply-profile something vf-add=hflip apply-profile something # vf == vflip,rotate=90,hflip,rotate=90 apply-profile something restore # vf == vflip
Conditional auto profiles Profiles which have the profile-cond option set are applied automatically if the associated condition matches (unless auto profiles are disabled). The option takes a string, which is interpreted as Lua condition. If evaluating the expression returns true, the profile is applied, if it returns false, it is ignored. This Lua code execution is not sandboxed.
Any variables in condition expressions can reference properties. If an identifier is not already defined by Lua or mpv, it is interpreted as property.  For example, pause would return the current pause status. You cannot reference properties with - this way since that would denote a subtraction, but if the variable name contains any _ characters, they are turned into -. For example, playback_time would return the property playback-time.
A more robust way to access properties is using p.property_name or get("property-name", default_value). The automatic variable to property magic will break if a new identifier with the same name is introduced (for example, if a function named pause() were added, pause would return a function value instead of the value of the pause property).
Note that if a property is not available, it will return nil, which can cause errors if used in expressions. These are logged in verbose mode, and the expression is considered to be false.
Whenever a property referenced by a profile condition changes, the condition is re-evaluated. If the return value of the condition changes from false or error to true, the profile is applied.
This mechanism tries to "unapply" profiles once the condition changes from true to false. If you want to use this, you need to set profile-restore for the profile. Another possibility it to create another profile with an inverse condition to undo the other profile.
Recursive profiles can be used. But it is discouraged to reference other conditional profiles in a conditional profile, since this can lead to tricky and unintuitive behavior.
Make only HD video look funny:
[something] profile-desc=HD video sucks profile-cond=width >= 1280 hue=-50
If you want the profile to be reverted if the condition goes to false again, you can set profile-restore:
[something] profile-desc=Mess up video when entering fullscreen profile-cond=fullscreen profile-restore=copy vf-add=rotate=90
This appends the rotate filter to the video filter chain when entering fullscreen. When leaving fullscreen, the vf option is set to the value it had before entering fullscreen. Note that this would also remove any other filters that were added during fullscreen mode by the user. Avoiding this is trickier, and could for example be solved by adding a second profile with an inverse condition and operation:
[something] profile-cond=fullscreen vf-add=@rot:rotate=90
[something-inv] profile-cond=not fullscreen vf-remove=@rot
WARNING: Every time an involved property changes, the condition is evaluated again.  If your condition uses p.playback_time for example, the condition is re-evaluated approximately on every video frame. This is probably slow.
This feature is managed by an internal Lua script. Conditions are executed as Lua code within this script. Its environment contains at least the following things:
(function environment table) Every Lua function has an environment table. This is used for identifier access. There is no named Lua symbol for it; it is implicit.
The environment does "magic" accesses to mpv properties. If an identifier is not already defined in _G, it retrieves the mpv property of the same name. Any occurrences of _ in the name are replaced with - before reading the property. The returned value is as retrieved by mp.get_property_native(name). Internally, a cache of property values, updated by observing the property is used instead, so properties that are not observable will be stuck at the initial value forever.
If you want to access properties, that actually contain _ in the name, use get() (which does not perform transliteration).
Internally, the environment table has a __index meta method set, which performs the access logic.
p      A "magic" table similar to the environment table. Unlike the latter, this does not prefer accessing variables defined in _G - it always accesses properties.
get(name [, def]) Read a property and return its value. If the property value is nil (e.g.  if the property does not exist), def is returned.
This is superficially similar to mp.get_property_native(name). An important difference is that this accesses the property cache, and enables the change detection logic (which is essential to the dynamic runtime behavior of auto profiles). Also, it does not return an error value as second return value.
The "magic" tables mentioned above use this function as backend. It does not perform the _ transliteration.
In addition, the same environment as in a blank mpv Lua script is present. For example, math is defined and gives access to the Lua standard math library.
WARNING: This feature is subject to change indefinitely. You might be forced to adjust your profiles on mpv updates.
Legacy auto profiles Some profiles are loaded automatically using a legacy mechanism. The following example demonstrates this:
Auto profile loading
[extension.mkv] profile-desc="profile for .mkv files" vf=vflip
The profile name follows the schema type.name, where type can be protocol for the input/output protocol in use (see --list-protocols), and extension for the extension of the path of the currently played file (not the file format).
This feature is very limited, and is considered soft-deprecated. Use conditional auto profiles.
There are three choices for using mpv from other programs or scripts:
1. Calling it as UNIX process. If you do this, do not parse terminal output.  The terminal output is intended for humans, and may change any time. In addition, terminal behavior itself may change any time. Compatibility cannot be guaranteed.
Your code should work even if you pass --no-terminal. Do not attempt to simulate user input by sending terminal control codes to mpv's stdin.  If you need interactive control, using --input-ipc-server is recommended. This gives you access to the JSON IPC  over unix domain sockets (or named pipes on Windows).
Depending on what you do, passing --no-config or --config-dir may be a good idea to avoid conflicts with the normal mpv user configuration intended for CLI playback.
Using --input-ipc-server is also suitable for purposes like remote control (however, the IPC protocol itself is not "secure" and not intended to be so).
2. Using libmpv. This is generally recommended when mpv is used as playback backend for a completely different application. The provided C API is very close to CLI mechanisms and the scripting API.
Note that even though libmpv has different defaults, it can be configured to work exactly like the CLI player (except command line parsing is unavailable).
See EMBEDDING INTO OTHER PROGRAMS (LIBMPV).
3. As a user script (LUA SCRIPTING, JAVASCRIPT, C PLUGINS). This is recommended when the goal is to "enhance" the CLI player. Scripts get access to the entire client API of mpv.
This is the standard way to create third-party extensions for the player.
All these access the client API, which is the sum of the various mechanisms provided by the player core, as documented here: OPTIONS, List of Input Commands, Properties, List of events (also see C API), Hooks.