mpv a media player Copyright: GPLv2+ Manual 1 section: Manual group: multimedia Table of Contents SYNOPSIS DESCRIPTION INTERACTIVE CONTROL Keyboard Control Mouse Control USAGE Legacy option syntax Escaping spaces and other special characters Paths Per-File Options List Options String list and path list options Key/value list options Filter options General CONFIGURATION FILES Location and Syntax Escaping spaces and special characters Putting Command Line Options into the Configuration File File-specific Configuration Files Profiles Runtime profiles Conditional auto profiles Legacy auto profiles Using mpv from other programs or scripts TAKING SCREENSHOTS TERMINAL STATUS LINE LOW LATENCY PLAYBACK PROTOCOLS PSEUDO GUI MODE Linux desktop issues Disabling Screensaver OPTIONS Track Selection Playback Control Program Behavior + oOo ON O 12 12 13 14 14 14 15 15 16 17 17 17 17 17 18 18 19 21 23 24 25 26 27 30 31 31 32 32 34 42 Video Audio Subtitles Window Disc Devices Equalizer Demuxer Input OSD Screenshot Software Scaler Audio Resampler Terminal Cache Network DVB ALSA audio output options GPU renderer options Miscellaneous Debugging AUDIO OUTPUT DRIVERS VIDEO OUTPUT DRIVERS AUDIO FILTERS VIDEO FILTERS ENCODING COMMAND INTERFACE input.conf input.conf syntax Key names Flat command syntax Commands specified as arrays Named arguments List of Input Commands Input Commands that are Possibly Subject to Change List of events Hooks Input Command Prefixes Synchronous vs. Asynchronous 47 59 65 77 85 86 86 91 94 97 99 101 101 103 106 108 108 109 132 137 138 142 153 157 170 173 173 173 174 175 175 176 176 184 192 195 196 197 Asynchronous command details 197 Input Sections 197 Properties 198 Property list 198 Inconsistencies between options and properties 220 Property Expansion 221 Raw and Formatted Properties 222 ON SCREEN CONTROLLER 223 Using the OSC 223 The Interface 223 Key Bindings 224 Configuration 224 Config Syntax 224 Command-line Syntax 225 Configurable Options 225 Script Commands 228 STATS 229 Usage 229 Font 229 Configuration 229 Configurable Options 229 Different key bindings 231 Internal stuff page 231 CONSOLE 233 Keybindings 233 Commands 233 Known issues 234 Configuration 234 Configurable Options 234 LUA SCRIPTING 235 Example 235 Script location 235 Details on the script initialization and lifecycle 236 mp functions 236 Advanced mp functions 242 mp.msg functions 243 mp.options functions 243 mp.utils functions 244 Events Extras JAVASCRIPT Example Similarities with Lua Differences from Lua Language features - ECMAScript 5 Unsupported Lua APIs and their JS alternatives Scripting APIs - identical to Lua Additional utilities Timers (global) CommonJS modules and require (id) Custom initialization The event loop JSON IPC Socat example Command Prompt example Protocol Data flow Asynchronous commands Commands with named arguments Commands UTF-8 JSON extensions Alternative ways of starting clients CHANGELOG EMBEDDING INTO OTHER PROGRAMS (LIBMPV) C PLUGINS C plugins location API Linkage to libmpv Examples ENVIRONMENT VARIABLES EXIT CODES FILES FILES ON WINDOWS 247 247 248 248 248 248 248 248 249 250 251 252 252 252 254 254 254 255 256 256 256 256 258 258 259 260 261 262 262 262 262 262 263 265 266 268 SYNOPSIS mpv [options] [file| URL|PLAYLIST]-] mpv [options] files DESCRIPTION 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. Usage examples to get you started quickly can be found at the end of this man page. INTERACTIVE CONTROL 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. 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. 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. Toggle fullscreen (see also --fs). ESC Exit fullscreen mode. 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. (0) Toggle OSD states between normal and playback time/duration. Toggle subtitle visibility. jand J Cycle through the available subtitles. zand Z Adjust subtitle delay by +/- 0.1 seconds. The x key does the same as z currently, but use is discouraged. Set/clear A-B loop points. See ab-1oop command for details. 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%. 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. Toggle subtitle VSFilter aspect compatibility mode. See --sub-ass-vsfilter-aspect-compat for more info. randR Move subtitles up/down. The t key does the same as R currently, but use is discouraged. 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.) 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 Ul window is used, broken on the terminal). F9 Show the list of audio and subtitle streams (useful only if a Ul 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 Cycles 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.) 1and 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). (The following keys are valid if you have a keyboard with multimedia keys.) 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/restor 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. old-bindings.conf in the mpv git USAGE 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. If an option is marked as (XXX only), it will only work in combination with the XXX option or if XXX is compiled in. 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 £.txt, but now this command line fails, as --log-file expects an option value, and f .t xt 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="Wwindow 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:optionl=valuel:option2:option3=value3,bar This passes option1 and option3 to the foo filter, with option2 as flag (implicitly opt ion2=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:optionl="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: Snsstring_of_length_n Examples mpv '--vf=foo:optionl=%S1l1l%quoted text test.avi Or in a script: mpv -—-vf=foo:optionl=% expr length "SNAME"*’ S"SNAME" test.avi 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. sn%string_of_length_n (see above). Some mpv options interpret paths starting with ~. Currently, the prefix ~~/ 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 ~ mpv config dir (for example ~/ .config/mpv/) ~/ user home directory root (similar to shell, $HOME) ~~home / same as ~~/ ~~global/ the global config path, if available (not on win32) ~~osxbundle/ the macOS bundle resource path (macOS only) Name Meaning ~~desktop/ the path to the desktop (win32, macOS) ~-exe_dir win32 only: the path to the directory containing the exe (for config file purposes; SMPV_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: mow ——g cle mky 9 salle miky =e File Active options file1.mkv =a = =-€ 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: mov —-a filel.mkv b NG e file2.:mky =a kile- mky =a ——\} willed mky ie File Active options file1.mkv =-a ~b -f file2.mkv a b f € d file3.mkv a b fe G d 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, interprets escapes) -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. They support the following operations: 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 -adad 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) Suffix Meaning -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 -adad 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. CONFIGURATION FILES 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. Example configuration file # 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 (sn%) 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 == ilag lag -opt val opt=val —— oprt = val] OpE=viall -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= (replace with the profile name). You can apply profiles on start with the --profile= option, or at runtime with the apply-profile 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 irant 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 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. Example [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. Example Make only HD video look funny: [something] profile-desc=HD video sucks profile-cond=width >= 1280 ihue=- 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. 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. Using mpv from other programs or scripts 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). . 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). . As auser 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. TAKING SCREENSHOTS Screenshots of the currently played file can be taken using the 'screenshot' input mode command, which is by default bound to the s key. Files named mpv-shotNNNN. jpg will be saved in the working directory, using the first available number - no files will be overwritten. In pseudo-GUI mode, the screenshot will be saved somewhere else. See PSEUDO GUI MODE. A screenshot will usually contain the unscaled video contents at the end of the video filter chain and subtitles. By default, s takes screenshots without subtitles, while s includes subtitles. Unlike with MPlayer, the screenshot video filter is not required. This filter was never required in mpv, and has been removed. TERMINAL STATUS LINE During playback, mpv shows the playback status on the terminal. It looks like something like this: AV: 00:03:12 / 00:24:25 (13%) A-V: -0.000 The status line can be overridden with the --term-status-msg option. The following is a list of things that can show up in the status line. Input properties, that can be used to get the same information manually, are also listed. * AV: or V: (video only) or A: (audio only) e The current time position in HH: MM: SS format (playback-—time property) e The total file duration (absent if unknown) (duration property) e Playback speed, e.g. © x2.0°°. Only visible if the speed is not normal. This is the user-requested speed, and not the actual speed (usually they should be the same, unless playback is too slow). (speed property.) e Playback percentage, e.g. (13%). How much of the file has been played. Normally calculated out of playback position and duration, but can fallback to other methods (like byte position) if these are not available. (percent-—pos property.) e The audio/video sync as A-V: 0.000. This is the difference between audio and video time. Normally it should be 0 or close to O. If it's growing, it might indicate a playback problem. (avsync property.) e Total A/V sync change, e.g. ct: -0.417. Normally invisible. Can show up if there is audio "missing", or not enough frames can be dropped. Usually this will indicate a problem. (total-avsync-change property.) e Encoding state in {...}, only shown in encoding mode. e Display sync state. If display sync is active (display-sync-active property), this shows DS: 2.500/13, where the first number is average number of vsyncs per video frame (e.g. 2.5 when playing 24Hz videos on 60Hz screens), which might jitter if the ratio doesn't round off, or there are mistimed frames (vsync-ratio), and the second number of estimated number of vsyncs which took too long (vo-delayed-frame-count property). The latter is a heuristic, as it's generally not possible to determine this with certainty. e Dropped frames, e.g. Dropped: 4. Shows up only if the count is not 0. Can grow if the video framerate is higher than that of the display, or if video rendering is too slow. May also be incremented on "hiccups" and when the video frame couldn't be displayed on time. (frame-drop-count property.) If the decoder drops frames, the number of decoder-dropped frames is appended to the display as well, e.g.: Dropped: 4/34. This happens only if decoder frame dropping is enabled with the --framedrop options. (decoder-frame-drop-count property.) e Cache state, e.g. Cache: 2s/134KB. Visible if the stream cache is enabled. The first value shows the amount of video buffered in the demuxer in seconds, the second value shows the estimated size of the buffered amount in kilobytes. (demuxer-cache-duration and demuxer-cache-stat properties.) LOW LATENCY PLAYBACK mpv is optimized for normal video playback, meaning it actually tries to buffer as much data as it seems to make sense. This will increase latency. Reducing latency is possible only by specifically disabling features which increase latency. The builtin low-latency profile tries to apply some of the options which can reduce latency. You can use --profile=low-latency to apply all of them. You can list the contents with --show-profile=low-latency (some of the options are quite obscure, and may change every mpv release). Be aware that some of the options can reduce playback quality. Most latency is actually caused by inconvenient timing behavior. You can disable this with --untimed, but it will likely break, unless the stream has no audio, and the input feeds data to the player at a constant rate. Another common problem is with MJPEG streams. These do not signal the correct framerate. Using untimed or -—no-correct-pts fps=60 might help. For livestreams, data can build up due to pausing the stream, due to slightly lower playback rate, or "buffering" pauses. If the demuxer cache is enabled, these can be skipped manually. The experimental drop-buf fers command can be used to discard any buffered data, though it's very disruptive. In some cases, manually tuning TCP buffer sizes and such can help to reduce latency. Additional options that can be tried: e --opengl-glfinish=yes, can reduce buffering in the graphics driver e --opengl-swapinterval=0, same e —-vo=xv, Same e without audio -- framedrop=no speed=1.01 may help for live sources (results can be mixed) PROTOCOLS http://...,https://,... Many network protocols are supported, but the protocol prefix must always be specified. mpv will never attempt to guess whether a filename is actually a network address. A protocol prefix is always required. Note that not all prefixes are documented here. Undocumented prefixes are either aliases to documented protocols, or are just redirections to protocols implemented and documented in FFmpeg. data: is supported in FFmpeg (not in Libav), but needs to be in the format data: //. This is done to avoid ambiguity with filenames. You can also prefix it with Llavf:// or ffmpeg: //. ytahis syz By default, the youtube-dl hook script only looks at http(s) URLs. Prefixing an URL with ytdl1:// forces it to be always processed by the script. This can also be used to invoke special youtube-dl functionality like playing a video by ID or invoking search. Keep in mind that you can't pass youtube-dl command line options by this, and you have to use --ytdl-raw-options instead. Play data from stdin. smb: //PATH Play a path from Samba share. (Requires FFmpeg support.) bd:// [title] [/device] --bluray-device=PATH Play a Blu-ray disc. Since libbluray 1.0.1, you can read from ISO files by passing them to —-bluray-device title can be: longest or first (selects the default playlist); mpls/ (selects .mpls playlist); (select playlist with the same index). mpv will list the available playlists on loading. bluray: // is an alias. dvd:// [title] [/device] dvd-device=PATH Play a DVD. DVD menus are not supported. If no title is given, the longest title is auto-selected. Without --dvd-device, it will probably try to open an actual optical drive, if available and implemented for the OS. dvdnav:// is an old alias for dvd: // and does exactly the same thing. dvb://[cardnumber@] channel --dvbin-... Digital TV via DVB. (Linux only.) mf://[filemask|@listfile] --mf-... Play a series of images as video. cdda:// [device] cdrom-device=PATH --cdda-... Play CD. avf (hs Access any FFmpeg/Libav libavformat protocol. Basically, this passed the string after the // directly to libavformat. av://type:options This is intended for using libavdevice inputs. type is the libavdevice demuxer name, and options is the (pseudo-)filename passed to the demuxer. Example mpv av://v412:/dev/videoO --profile=low-latency untimed This plays video from the first v4l input with nearly the lowest latency possible. It's a good replacement for the removed tv: // input. Using --untimed is a hack to output a captured frame immediately, instead of respecting the input framerate. (There may be better ways to handle this in the future.) avdevice:// is an alias. file://PATH A local path as URL. Might be useful in some special use-cases. Note that PATH itself should start with a third / to make the path an absolute path. appending: //PATH Play a local file, but assume it's being appended to. This is useful for example for files that are currently being downloaded to disk. This will block playback, and stop playback only if no new data was appended after a timeout of about 2 seconds. Using this is still a bit of a bad idea, because there is no way to detect if a file is actually being appended, or if it's still written. If you're trying to play the output of some program, consider using a pipe (something | mpv -). If it really has to be a file on disk, use tail to make it wait forever, e.g. tail -f -c +0 file.mkv | mpv -. fd://123 Read data from the given file descriptor (for example 123). This is similar to piping data to stdin via -, but can use an arbitrary file descriptor. mpv may modify some file descriptor properties when the stream layer "opens" it. fdclose://123 Like fd://, but the file descriptor is closed after use. When using this you need to ensure that the same fd URL will only be used once. edl://[edl specification as in edl-mpv.rst] Stitch together parts of multiple files and play them. slice://start [-end] @URL Read a slice of a stream. start and end represent a byte range and accept suffixes such as KiB and MiB. end is optional. if end starts with +, it is considered as offset from start. Only works with seekable streams. Examples: mpv slice://lg-2g@cap.ts This starts reading from cap.ts after seeking 1 GiB, then reads until reaching 2 GiB or end of file. mpv slice://lg-+2g@cap.ts This starts reading from cap.ts after seeking 1 GiB, then reads until reaching 3 GiB or end of file. mpv slice://100m@appending://cap.ts This starts reading from cap.ts after seeking 100MiB, then reads until end of file. null:// Simulate an empty file. If opened for writing, it will discard all data. The nu11 demuxer will specifically pass autoprobing if this protocol is used (while it's not automatically invoked for empty files). memory://data Use the data part as source data. hex://data Like memory: //, but the string is interpreted as hexdump. PSEUDO GUI MODE mpv has no official GUI, other than the OSC (ON SCREEN CONTROLLER), which is not a full GUI and is not meant to be. However, to compensate for the lack of expected GUI behavior, mpv will in some cases start with some settings changed to behave slightly more like a GUI mode. Currently this happens only in the following cases: e if started using the mpv . desktop file on Linux (e.g. started from menus or file associations provided by desktop environments) e if started from explorer.exe on Windows (technically, if it was started on Windows, and all of the stdout/stderr/stdin handles are unset) e started out of the bundle on macOS e if you manually use --player-operat ion-mode=pseudo-gui on the command line This mode applies options from the builtin profile built in-pseudo-gui, but only if these haven't been set in the user's config file or on the command line, which is the main difference to using —-profile=builtin-pseudo-gui. The profile is currently defined as follows: [builtin-pseudo-gui] terminal=no force-window=yes idle=once screenshot-—directory=~~desktop/ The pseudo-gui profile exists for compatibility. The options in the pseudo-gui profile are applied unconditionally. In addition, the profile makes sure to enable the pseudo-GUI mode, so that —-profile=pseudo-gui works like in older mpv releases: [pseudo-gui] player-operation-mode=pseudo-gui Warning Currently, you can extend the pseudo-gui profile in the config file the normal way. This is deprecated. In future mpv releases, the behavior might change, and not apply your additional settings, and/or use a different profile name. Linux desktop issues This subsection describes common problems on the Linux desktop. None of these problems exist on systems like Windows or macOS. Disabling Screensaver By default, mpv tries to disable the OS screensaver during playback (only if a VO using the OS GUI API is active). --stop-screensaver=no disables this. A common problem is that Linux desktop environments ignore the standard screensaver APIs on which mpv relies. In particular, mpv uses the Screen Saver extension (XSS) on X11, and the idle-inhibit on Wayland. GNOME is one of the worst offenders, and ignores even the now widely supported idle-inhibit protocol. (This is either due to a combination of malice and incompetence, but since implementing this protocol would only take a few lines of code, it is most likely the former. You will also notice how GNOME advocates react offended whenever their sabotage is pointed out, which indicates either hypocrisy, or even worse ignorance.) Such incompatible desktop environments (i.e. which ignore standards) typically require using a DBus API. This is ridiculous in several ways. The immediate practical problem is that it would require adding a quite unwieldy dependency for a DBus library, somehow integrating its mainloop into mpv, and other generally unacceptable things. However, since mpv does not officially support GNOME, this is not much of a problem. If you are one of those miserable users who want to use mpv on GNOME, report a bug on the GNOME issue tracker: https://gitlab.gnome.org/groups/GNOME/-/issues Alternatively, you may be able to write a Lua script that calls the xdg-screensaver command line program. (By the way, this a command line program is an utterly horrible kludge that tries to identify your DE, and then tries to send the correct DBus command via a DBus CLI tool.) If you find the idea of having to write a script just so your screensaver doesn't kick in ridiculous, do not use GNOME, or use GNOME video software instead of mpv (good luck). Before mpv 0.33.0, the X11 backend ran xdg-screensaver reset in 10 second intervals when not paused. This hack was removed in 0.33.0. OPTIONS Track Selection —-alang= Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also --aid. This is a string list option. See List Options for details. Examples e mpv dvd://1 --alang=hu, en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available. e mpv --alang=jpn example.mkv plays a Matroska file with Japanese audio. —-slang= Specify a priority list of subtitle languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two letter language codes, Matroska uses ISO 639-2 three letter language codes while OGM uses a free-form identifier. See also --sid. This is a string list option. See List Options for details. Examples *mpv dvd://1 --slang=hu,en chooses the Hungarian subtitle track on a DVD and falls back on English if Hungarian is not available. *mpv --slang=jpn example.mkv plays a Matroska file with Japanese subtitles. —-vlang=<...> Equivalent to --alang and --slang, for video tracks. This is a string list option. See List Options for details. —-aid= Select audio track. auto selects the default, no disables audio. See also --alang. mpv normally prints available audio tracks on the terminal when starting playback of a file. —-audio is an alias for --aid. aid=no or --audio=no or --no-audio disables audio playback. (The latter variant does not work with the client API.) Note The track selection options (-—aid but also --sid and the others) sometimes expose behavior that may appear strange. Also, the behavior tends to change around with each mpv release. The track selection properties will return the option value outside of playback (as expected), but during playbac, the affective track selection is returned. For example, with --aid=auto, the aid property will suddenly return 2 after playback initialization (assuming the file has at least 2 audio tracks, and the second is the default). At mpv 0.32.0 (and some releases before), if you passed a track value for which a corresponding track didn't exist (e.g. --aid=2 and there was only 1 audio track), the aid property returned no. However if another audio track was added during playback, and you tried to set the aid property to 2, nothing happened, because the aid option still had the value 2, and writing the same value has no effect. With mpv 0.33.0, the behavior was changed. Now track selection options are reset to auto at playback initialization, if the option had tries to select a track that does not exist. The same is done if the track exists, but fails to initialize. The consequence is that unlike before mpv 0.33.0, the user's track selection parameters are clobbered in certain situations. Also since mpv 0.33.0, trying to select a track by number will strictly select this track. Before this change, trying to select a track which did not exist would fall back to track default selection at playback initialization. The new behavior is more consistent. Setting a track selection property at runtime, and then playing a new file might reset the track selection to defaults, if the fingerprint of the track list of the new file is different. Be aware of tricky combinations of all of all of the above: for example, mpv --aid=2 file_with_2_audio_tracks.mkv file_with_1l_audio_track.mkv would first play the correct track, and the second file without audio. If you then go back the first file, its first audio track will be played, and the second file is played with audio. If you do the same thing again but instead of using --aid=2 you run set aid 2 while the file is playing, then changing to the second file will play its audio track. This is because runtime selection enables the fingerprint heuristic. Most likely this is not the end. —-sid= Display the subtitle stream specified by . auto selects the default, no disables subtitles. --sub is an alias for --sid. sid=no or --sub=no or -—no-sub disables subtitle decoding. (The latter variant does not work with the client API.) -—-vid= Select video channel. auto selects the default, no disables video. —-video is an alias for --vid. vid=no Or --video=no or --no-video disables video playback. (The latter variant does not work with the client API.) If video is disabled, mpv will try to download the audio only if media is streamed with youtube-dl, because it saves bandwidth. This is done by setting the ytdl_format to "bestaudio/best" in the ytdl_hook.lua script. —-edition= (Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first. If set to auto (the default), mpv will choose the first edition declared as a default, or if there is no default, the first edition defined. track-auto-selection= Enable the default track auto-selection (default: yes). Enabling this will make the player select streams according to -—aid, --alang, and others. If it is disabled, no tracks are selected. In addition, the player will not exit if no tracks are selected, and wait instead (this wait mode is similar to pausing, but the pause option is not set). This is useful with --lavfi-complex: you can start playback in this mode, and then set select tracks at runtime by setting the filter graph. Note that if --lavfi-complex is set before playback is started, the referenced tracks are always selected. —-subs-with-matching-audio= When autoselecting a subtitle track, select a non-forced one even if the selected audio stream matches your preferred subtitle language (default: yes). Disable this if you'd like to only show subtitles for foreign audio or onscreen text. Playback Control start= Seek to given time position. The general format for times is [+|-] [ [hh:]mm:]ss[.ms]. If the time is prefixed with —, the time is considered relative from the end of the file (as signaled by the demuxer/the file). A + is usually ignored (but see below). The following alternative time specifications are recognized: pp% seeks to percent position pp (0-100). c seeks to chapter number c. (Chapters start from 1.) none resets any previously set option (useful for libmpv). If --rebase-start-time=no is given, then prefixing times with + makes the time relative to the start of the file. A timestamp without prefix is considered an absolute time, i.e. should seek to a frame with a timestamp as the file contains it. As a bug, but also a hidden feature, putting 1 or more spaces before the + or - always interprets the time as absolute, which can be used to seek to negative timestamps (useful for debugging at most). Examples start=+56, start=00:56 Seeks to the start time + 56 seconds. start=—56, start=—00:56 Seeks to the end time - 56 seconds. = Sere Oil S iLO) se Seeks to 1 hour 10 min. —-start=50% Seeks to the middle of the file. start=30 nd=40 Seeks to 30 seconds, plays 10 seconds, and exits. Stage 3:20 length=10 Seeks to 3 minutes and 20 seconds before the end of the file, plays 10 seconds, and exits. start='#2' nd='#4' Plays chapters 2 and 3, and exits. nd= Stop at given time. Use --length if the time should be relative to --start. See --start for valid option values and examples. length= Stop after a given time relative to the start time. See --start for valid option values and examples. If both --end and --length are provided, playback will stop when it reaches either of the two endpoints. Obscurity note: this does not work correctly if --rebase-start-time=no, and the specified time is not an "absolute" time, as defined in the -—-start option description. rebase-start—time= Whether to move the file start time to 00:00:00 (default: yes). This is less awkward for files which start at a random timestamp, such as transport streams. On the other hand, if there are timestamp resets, the resulting behavior can be rather weird. For this reason, and in case you are actually interested in the real timestamps, this behavior can be disabled with no. speed=<0.01-100> Slow down or speed up playback by the factor given as parameter. If --audio-pitch-correction (on by default) is used, playing with a speed higher than normal automatically inserts the scaletempo2 audio filter. —-pause Start the player in paused state. --shuffle Play files in random order. —-playlist-start= Set which file on the internal playlist to start playback with. The index is an integer, with O meaning the first file. The value auto means that the selection of the entry to play is left to the playback resume mechanism (default). If an entry with the given index doesn't exist, the behavior is unspecified and might change in future mpv versions. The same applies if the playlist contains further playlists (don't expect any reasonable behavior). Passing a playlist file to mpv should work with this option, though. E.g. mpv playlist.m3u --playlist-start=123 will work as expected, as long as playlist.m3u does not link to further playlists. The value no is a deprecated alias for auto. —-playlist= Play files according to a playlist file. Supports some common formats. If no format is detected, it will be treated as list of files, separated by newline characters. You may need this option to load plaintext files as a playlist. Note that XML playlist formats are not supported. This option forces --demuxer=playlist to interpret the playlist file. Some playlist formats, notably CUE and optical disc formats, need to use different demuxers and will not work with this option. They still can be played directly, without using this option. You can play playlists directly, without this option. Before mpv version 0.31.0, this option disabled any security mechanisms that might be in place, but since 0.31.0 it uses the same security mechanisms as playing a playlist file directly. If you trust the playlist file, you can disable any security checks with load-unsafe-playlists. Because playlists can load other playlist entries, consider applying this option only to the playlist itself and not its entries, using something along these lines: mpv --{ -—-playlist=filenam load-unsafe-playlists --} Warning The way older versions of mpv played playlist files via --playlist was not safe against maliciously constructed files. Such files may trigger harmful actions. This has been the case for all verions of mpv prior to 0.31.0, and all MPlayer versions, but unfortunately this fact was not well documented earlier, and some people have even misguidedly recommended the use of --playlist with untrusted sources. Do NOT use --playlist with random internet sources or files you do not trust if you are not sure your mpv is at least 0.31.0. In particular, playlists can contain entries using protocols other than local files, such as special protocols like avdevice: // (which are inherently unsafe). chapter-merge-threshold= Threshold for merging almost consecutive ordered chapter parts in milliseconds (default: 100). Some Matroska files with ordered chapters have inaccurate chapter end timestamps, causing a small gap between the end of one chapter and the start of the next one when they should match. If the end of one playback part is less than the given threshold away from the start of the next one then keep playing video normally over the chapter change instead of doing a seek. chapter-seek-threshold= Distance in seconds from the beginning of a chapter within which a backward chapter seek will go to the previous chapter (default: 5.0). Past this threshold, a backward chapter seek will go to the beginning of the current chapter instead. A negative value means always go back to the previous chapter. —-hr-seek= Select when to use precise seeks that are not limited to keyframes. Such seeks require decoding video from the previous keyframe up to the target position and so can take some time depending on decoding performance. For some video formats, precise seeks are disabled. This option selects the default choice to use for seeks; it is possible to explicitly override that default in the definition of key bindings and in input commands. no: Never use precise seeks. absolute: Use precise seeks if the seek is to an absolute position in the file, such as a chapter seek, but not for relative seeks like the default behavior of arrow keys (default). default: Like absolute, but enable hr-seeks in audio-only cases. The exact behavior is implementation specific and may change with new releases. yes: Use precise seeks whenever possible. always: Same as yes (for compatibility). hr-seek-demuxer-offset= This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead. The value of this option is subtracted from the time stamp given to the demuxer. Thus, if you set this option to 1.5 and try to do a precise seek to 60 seconds, the demuxer is told to seek to time 58.5, which hopefully reduces the chance that it erroneously goes to some time later than 60 seconds. The downside of setting this option is that precise seeks become slower, as video between the earlier demuxer position and the real target may be unnecessarily decoded. hr-seek-framedrop= Allow the video decoder to drop frames during seek, if these frames are before the seek target. If this is enabled, precise seeking can be faster, but if you're using video filters which modify timestamps or add new frames, it can lead to precise seeking skipping the target frame. This e.g. can break frame backstepping when deinterlacing is enabled. Default: yes index= Controls how to seek in files. Note that if the index is missing from a file, it will be built on the fly by default, so you don't need to change this. But it might help with some broken files. default: use an index if the file has one, or build it if missing recreate: don't read or use the file's index Note This option only works if the underlying media supports seeking (i.e. not with stdin, pipe, etc). load-unsaf Load URLs from playlists which are considered unsafe (default: no). This includes special protocols and anything that doesn't refer to normal files. Local files and HTTP links on the other hand are always considered safe. playlists In addition, if a playlist is loaded while this is set, the added playlist entries are not marked as originating from network or potentially unsafe location. (Instead, the behavior is as if the playlist entries were provided directly to mpv command line or loadfile command.) access-—references= Follow any references in the file being opened (default: yes). Disabling this is helpful if the file is automatically scanned (e.g. thumbnail generation). If the thumbnail scanner for example encounters a playlist file, which contains network URLs, and the scanner should not open these, enabling this option will prevent it. This option also disables ordered chapters, mov reference files, opening of archives, and a number of other features. On older FFmpeg versions, this will not work in some cases. Some FFmpeg demuxers might not respect this option. This option does not prevent opening of paired subtitle files and such. Use --autoload-files=no to prevent this. This option does not always work if you open non-files (for example using dvd: //directory would open a whole bunch of files in the given directory). Prefixing the filename with . / if it doesn't start with a / will avoid this. —-loop-playlist=, --loop-playlist Loops playback N times. A value of 1 plays it one time (default), 2 two times, etc. inf means forever. no is the same as 1 and disables looping. If several files are specified on command line, the entire playlist is looped. --loop-playlist is the same as --loop-playlist=inf. The force mode is like inf, but does not skip playlist entries which have been marked as failing. This means the player might waste CPU time trying to loop a file that doesn't exist. But it might be useful for playing webradios under very bad network conditions. —-loop-file=, --Loop= Loop a single file N times. inf means forever, no means normal playback. For compatibility, --loop-file and loop-file=yes are also accepted, and are the same as —-loop-file=inf. The difference to --loop-playlist is that this doesn't loop the playlist, just the file itself. If the playlist contains only a single file, the difference between the two option is that this option performs a seek on loop, instead of reloading the file. Note --loop-file counts the number of times it causes the player to seek to the beginning of the file, not the number of full playthroughs. This means --loop-file=1 will end up playing the file twice. Contrast with --loop-playlist, which counts the number of full playthroughs. —-loop is an alias for this option. ab-loop-a=