neulab/tldr huggingface dataset:
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.
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)
• The current time position in HH:MM:SS format (playback-time property)
• The total file duration (absent if unknown) (duration property)
• 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.)
• 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.)
• 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 0. If it's growing, it might indicate a playback problem. (avsync property.)
• 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.)
• Encoding state in {...}, only shown in encoding mode.
• 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.
• 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.)
• 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-state properties.)
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-buffers 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:
• --opengl-glfinish=yes, can reduce buffering in the graphics driver
• --opengl-swapinterval=0, same
• --vo=xv, same
• without audio --framedrop=no --speed=1.01 may help for live sources (results can be mixed)
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 lavf:// or ffmpeg://.
ytdl://... By default, the youtube-dl hook script only looks at http(s) URLs. Prefixing an URL with ytdl:// 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/<number> (selects <number>.mpls playlist); <number> (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.
lavf://... 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.
mpv av://v4l2:/dev/video0 --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.
mpv slice://1g-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://1g-+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 null 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.
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:
• if started using the mpv.desktop file on Linux (e.g. started from menus or file associations provided by desktop environments)
• if started from explorer.exe on Windows (technically, if it was started on Windows, and all of the stdout/stderr/stdin handles are unset)
• started out of the bundle on macOS
• if you manually use --player-operation-mode=pseudo-gui on the command line
This mode applies options from the builtin profile builtin-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.
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.
Track Selection --alang=<languagecode[,languagecode,...]> 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.
• mpv dvd://1 --alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.
• mpv --alang=jpn example.mkv plays a Matroska file with Japanese audio.
--slang=<languagecode[,languagecode,...]> 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.
• 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.
--aid=<ID|auto|no> 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 playback, 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_1_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=<ID|auto|no> Display the subtitle stream specified by <ID>. 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=<ID|auto|no> 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=<ID|auto> (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=<yes|no> 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=<yes|no> 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=<relative time> 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).
--start=+56, --start=00:56 Seeks to the start time + 56 seconds.
--start=-56, --start=-00:56 Seeks to the end time - 56 seconds.
--start=01:10:00 Seeks to 1 hour 10 min.
--start=50% Seeks to the middle of the file.
--start=30 --end=40 Seeks to 30 seconds, plays 10 seconds, and exits.
--start=-3:20 --length=10 Seeks to 3 minutes and 20 seconds before the end of the file, plays 10 seconds, and exits.
--start='#2' --end='#4' Plays chapters 2 and 3, and exits.
--end=<relative time> Stop at given time. Use --length if the time should be relative to --start. See --start for valid option values and examples.
--length=<relative time> 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=<yes|no> 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=<auto|index> Set which file on the internal playlist to start playback with. The index is an integer, with 0 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=<filename> 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=filename --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=<number> 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=<seconds> 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=<no|absolute|yes|default> 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=<seconds> 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=<yes|no> 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=<mode> 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-unsafe-playlists 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.
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=<yes|no> 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=<N|inf|force|no>, --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=<N|inf|no>, --loop=<N|inf|no> 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=<time>, --ab-loop-b=<time> Set loop points. If playback passes the b timestamp, it will seek to the a timestamp. Seeking past the b point doesn't loop (this is intentional).
If a is after b, the behavior is as if the points were given in the right order, and the player will seek to b after crossing through a. This is different from old behavior, where looping was disabled (and as a bug, looped back to a on the end of the file).
If either options are set to no (or unset), looping is disabled. This is different from old behavior, where an unset a implied the start of the file, and an unset b the end of the file.
The loop-points can be adjusted at runtime with the corresponding properties. See also ab-loop command.
--ab-loop-count=<N|inf> Run A-B loops only N times, then ignore the A-B loop points (default: inf).  Every finished loop iteration will decrement this option by 1 (unless it is set to inf or 0). inf means that looping goes on forever. If this option is set to 0, A-B looping is ignored, and even the ab-loop command will not enable looping again (the command will show (disabled) on the OSD message if both loop points are set, but ab-loop-count is 0).
--ordered-chapters, --no-ordered-chapters Enabled by default.  Disable support for Matroska ordered chapters. mpv will not load or search for video segments from other files, and will also ignore any chapter order specified for the main file.
--ordered-chapters-files=<playlist-file> Loads the given file as playlist, and tries to use the files contained in it as reference files when opening a Matroska file that uses ordered chapters. This overrides the normal mechanism for loading referenced files by scanning the same directory the main file is located in.
Useful for loading ordered chapter files that are not located on the local filesystem, or if the referenced files are in different directories.
Note: a playlist can be as simple as a text file containing filenames separated by newlines.
--chapters-file=<filename> Load chapters from this file, instead of using the chapter metadata found in the main file.
This accepts a media file (like mkv) or even a pseudo-format like ffmetadata and uses its chapters to replace the current file's chapters. This doesn't work with OGM or XML chapters directly.
--sstep=<sec> Skip <sec> seconds after every frame.
NOTE: Without --hr-seek, skipping will snap to keyframes.
--stop-playback-on-init-failure=<yes|no> Stop playback if either audio or video fails to initialize (default: no).  With no, playback will continue in video-only or audio-only mode if one of them fails. This doesn't affect playback of audio-only or video-only files.
--play-dir=<forward|+|backward|-> Control the playback direction (default: forward). Setting backward will attempt to play the file in reverse direction, with decreasing playback time. If this is set on playback starts, playback will start from the end of the file. If this is changed at during playback, a hr-seek will be issued to change the direction.
+ and - are aliases for forward and backward.
The rest of this option description pertains to the backward mode.
NOTE: Backward playback is extremely fragile. It may not always work, is much slower than forward playback, and breaks certain other features. How well it works depends mainly on the file being played. Generally, it will show good results (or results at all) only if the stars align.
mpv, as well as most media formats, were designed for forward playback only. Backward playback is bolted on top of mpv, and tries to make a medium effort to make backward playback work. Depending on your use-case, another tool may work much better.
Backward playback is not exactly a 1st class feature. Implementation tradeoffs were made, that are bad for backward playback, but in turn do not cause disadvantages for normal playback. Various possible optimizations are not implemented in order to keep the complexity down. Normally, a media player is highly pipelined (future data is prepared in separate threads, so it is available in realtime when the next stage needs it), but backward playback will essentially stall the pipeline at various random points.
For example, for intra-only codecs are trivially backward playable, and tools built around them may make efficient use of them (consider video editors or camera viewers). mpv won't be efficient in this case, because it uses its generic backward playback algorithm, that on top of it is not very optimized.
If you just want to quickly go backward through the video and just show "keyframes", just use forward playback, and hold down the left cursor key (which on CLI with default config sends many small relative seek commands).
The implementation consists of mostly 3 parts:
• Backward demuxing. This relies on the demuxer cache, so the demuxer cache should (or must, didn't test it) be enabled, and its size will affect performance. If the cache is too small or too large, quadratic runtime behavior may result.
• Backward decoding. The decoder library used (libavcodec) does not support this. It is emulated by feeding bits of data in forward, putting the result in a queue, returning the queue data to the VO in reverse, and then starting over at an earlier position. This can require buffering an extreme amount of decoded data, and also completely breaks pipelining.
• Backward output. This is relatively simple, because the decoder returns the frames in the needed order. However, this may cause various problems because filters see audio and video going backward.
Known problems:
• It's fragile. If anything doesn't work, random non-useful behavior may occur. In simple cases, the player will just play nonsense and artifacts.  In other cases, it may get stuck or heat the CPU. (Exceeding memory usage significantly beyond the user-set limits would be a bug, though.)
• Performance and resource usage isn't good. In part this is inherent to backward playback of normal media formats, and in parts due to implementation choices and tradeoffs.
• This is extremely reliant on good demuxer behavior. Although backward demuxing requires no special demuxer support, it is required that the demuxer performs seeks reliably, fulfills some specific requirements about packet metadata, and has deterministic behavior.
• Starting playback exactly from the end may or may not work, depending on seeking behavior and file duration detection.
• Some container formats, audio, and video codecs are not supported due to their behavior. There is no list, and the player usually does not detect them. Certain live streams (including TV captures) may exhibit problems in particular, as well as some lossy audio codecs. h264 intra-refresh is known not to work due to problems with libavcodec. WAV and some other raw audio formats tend to have problems - there are hacks for dealing with them, which may or may not work.
• Backward demuxing of subtitles is not supported. Subtitle display still works for some external text subtitle formats. (These are fully read into memory, and only backward display is needed.) Text subtitles that are cached in the subtitle renderer also have a chance to be displayed correctly.
• Some features dealing with playback of broken or hard to deal with files will not work fully (such as timestamp correction).
• If demuxer low level seeks (i.e. seeking the actual demuxer instead of just within the demuxer cache) are performed by backward playback, the created seek ranges may not join, because not enough overlap is achieved.
• Trying to use this with hardware video decoding will probably exhaust all your GPU memory and then crash a thing or two. Or it will fail because --hwdec-extra-frames will certainly be set too low.
• Stream recording is broken. --stream-record may keep working if you backward play within a cached region only.
• Relative seeks may behave weird. Small seeks backward (towards smaller time, i.e. seek -1) may not really seek properly, and audio will remain muted for a while. Using hr-seek is recommended, which should have none of these problems.
• Some things are just weird. For example, while seek commands manipulate playback time in the expected way (provided they work correctly), the framestep commands are transposed. Backstepping will perform very expensive work to step forward by 1 frame.
Tuning:
• Remove all --vf/--af filters you have set. Disable hardware decoding. Disable idiotic nonsense like SPDIF passthrough.
• Increasing --video-reversal-buffer might help if reversal queue overflow is reported, which may happen in high bitrate video, or video with large GOP. Hardware decoding mostly ignores this, and you need to increase --hwdec-extra-frames instead (until you get playback without logged errors).
• The demuxer cache is essential for backward demuxing. Make sure to set --cache=yes. The cache size might matter. If it's too small, a queue overflow will be logged, and backward playback cannot continue, or it performs too many low level seeks. If it's too large, implementation tradeoffs may cause general performance issues. Use --demuxer-max-bytes to potentially increase the amount of packets the demuxer layer can queue for reverse demuxing (basically it's the --video-reversal-buffer equivalent for the demuxer layer).
• Setting --vd-queue-enable=yes can help a lot to make playback smooth (once it works).
• --demuxer-backward-playback-step also factors into how many seeks may be performed, and whether backward demuxing could break due to queue overflow. If it's set too high, the backstep operation needs to search through more packets all the time, even if the cache is large enough.
• Setting --demuxer-cache-wait may be useful to cache the entire file into the demuxer cache. Set --demuxer-max-bytes to a large size to make sure it can read the entire cache; --demuxer-max-back-bytes should also be set to a large size to prevent that tries to trim the cache.
• If audio artifacts are audible, even though the AO does not underrun, increasing --audio-backward-overlap might help in some cases.
--video-reversal-buffer=<bytesize>, --audio-reversal-buffer=<bytesize> For backward decoding. Backward decoding decodes forward in steps, and then reverses the decoder output. These options control the approximate maximum amount of bytes that can be buffered. The main use of this is to avoid unbounded resource usage; during normal backward playback, it's not supposed to hit the limit, and if it does, it will drop frames and complain about it.
Use this option if you get reversal queue overflow errors during backward playback. Increase the size until the warning disappears. Usually, the video buffer will overflow first, especially if it's high resolution video.
This does not work correctly if video hardware decoding is used. The video frame size will not include the referenced GPU and driver memory. Some hardware decoders may also be limited by --hwdec-extra-frames.
How large the queue size needs to be depends entirely on the way the media was encoded. Audio typically requires a very small buffer, while video can require excessively large buffers.
(Technically, this allows the last frame to exceed the limit. Also, this does not account for other buffered frames, such as inside the decoder or the video output.)
This does not affect demuxer cache behavior at all.
See --list-options for defaults and value range. <bytesize> options accept suffixes such as KiB and MiB.
--video-backward-overlap=<auto|number>, --audio-backward-overlap=<auto|number> Number of overlapping keyframe ranges to use for backward decoding (default: auto) ("keyframe" to be understood as in the mpv/ffmpeg specific meaning).  Backward decoding works by forward decoding in small steps. Some codecs cannot restart decoding from any packet (even if it's marked as seek point), which becomes noticeable with backward decoding (in theory this is a problem with seeking too, but --hr-seek-demuxer-offset can fix it for seeking).  In particular, MDCT based audio codecs are affected.
The solution is to feed a previous packet to the decoder each time, and then discard the output. This option controls how many packets to feed. The auto choice is currently hardcoded to 0 for video, and uses 1 for lossy audio, 0 for lossless audio. For some specific lossy audio codecs, this is set to 2.
--video-backward-overlap can potentially handle intra-refresh video, depending on the exact conditions. You may have to use the --vd-lavc-show-all option as well.
--video-backward-batch=<number>, --audio-backward-batch=<number> Number of keyframe ranges to decode at once when backward decoding (default: 1 for video, 10 for audio). Another pointless tuning parameter nobody should use. This should affect performance only. In theory, setting a number higher than 1 for audio will reduce overhead due to less frequent backstep operations and less redundant decoding work due to fewer decoded overlap frames (see --audio-backward-overlap). On the other hand, it requires a larger reversal buffer, and could make playback less smooth due to breaking pipelining (e.g. by decoding a lot, and then doing nothing for a while).
It probably never makes sense to set --video-backward-batch. But in theory, it could help with intra-only video codecs by reducing backstep operations.
--demuxer-backward-playback-step=<seconds> Number of seconds the demuxer should seek back to get new packets during backward playback (default: 60). This is useful for tuning backward playback, see --play-dir for details.
Setting this to a very low value or 0 may make the player think seeking is broken, or may make it perform multiple seeks.
Setting this to a high value may lead to quadratic runtime behavior.
Program Behavior --help, --h Show short summary of options.
You can also pass a string to this option, which will list all top-level options which contain the string in the name, e.g. --h=scale for all options that contain the word scale. The special string * lists all top-level options.
-v     Increment verbosity level, one level for each -v found on the command line.
--version, -V Print version string and exit.
--no-config Do not load default configuration files. This prevents loading of both the user-level and system-wide mpv.conf and input.conf files. Other configuration files are blocked as well, such as resume playback files.
NOTE: Files explicitly requested by command line options, like --include or --use-filedir-conf, will still be loaded.
See also: --config-dir.
--list-options Prints all available options.
--list-properties Print a list of the available properties.
--list-protocols Print a list of the supported protocols.
--log-file=<path> Opens the given path for writing, and print log messages to it. Existing files will be truncated. The log level is at least -v -v, but can be raised via --msg-level (the option cannot lower it below the forced minimum log level).
A special case is the macOS bundle, it will create a log file at ~/Library/Logs/mpv.log by default.
--config-dir=<path> Force a different configuration directory. If this is set, the given directory is used to load configuration files, and all other configuration directories are ignored. This means the global mpv configuration directory as well as per-user directories are ignored, and overrides through environment variables (MPV_HOME) are also ignored.
Note that the --no-config option takes precedence over this option.
--save-position-on-quit Always save the current playback position on quit. When this file is played again later, the player will seek to the old playback position on start. This does not happen if playback of a file is stopped in any other way than quitting. For example, going to the next file in the playlist will not save the position, and start playback at beginning the next time the file is played.
This behavior is disabled by default, but is always available when quitting the player with Shift+Q.
--watch-later-directory=<path> The directory in which to store the "watch later" temporary files.
The default is a subdirectory named "watch_later" underneath the config directory (usually ~/.config/mpv/).
--dump-stats=<filename> Write certain statistics to the given file. The file is truncated on opening. The file will contain raw samples, each with a timestamp. To make this file into a readable, the script TOOLS/stats-conv.py can be used (which currently displays it as a graph).
This option is useful for debugging only.
--idle=<no|yes|once> Makes mpv wait idly instead of quitting when there is no file to play.  Mostly useful in input mode, where mpv can be controlled through input commands. (Default: no)
once will only idle at start and let the player close once the first playlist has finished playing back.
--include=<configuration-file> Specify configuration file to be parsed after the default ones.
--load-scripts=<yes|no> If set to no, don't auto-load scripts from the scripts configuration subdirectory (usually ~/.config/mpv/scripts/). (Default: yes)
--script=<filename>, --scripts=file1.lua:file2.lua:... Load a Lua script. The second option allows you to load multiple scripts by separating them with the path separator (: on Unix, ; on Windows).
--scripts is a path list option. See List Options for details.
--script-opts=key1=value1,key2=value2,... Set options for scripts. A script can query an option by key. If an option is used and what semantics the option value has depends entirely on the loaded scripts. Values not claimed by any scripts are ignored.
This is a key/value list option. See List Options for details.
--merge-files Pretend that all files passed to mpv are concatenated into a single, big file. This uses timeline/EDL support internally.
--no-resume-playback Do not restore playback position from the watch_later configuration subdirectory (usually ~/.config/mpv/watch_later/). See quit-watch-later input command.
--resume-playback-check-mtime Only restore the playback position from the watch_later configuration subdirectory (usually ~/.config/mpv/watch_later/) if the file's modification time is the same as at the time of saving. This may prevent skipping forward in files with the same name which have different content.  (Default: no)