input.conf key bindings, the JSON IPC protocol, Lua/JavaScript scripts, and the libmpv C API all use the same commands and property names.
input.conf
Theinput.conf file maps keys to commands. It lives at ~/.config/mpv/input.conf.
https://github.com/mpv-player/mpv/blob/master/etc/input.conf.
List all available key names:
Syntax
- Multiple commands can be chained with
; #begins a comment (outside quoted strings); useSHARPto bind the#key- Strings with spaces or special characters must be quoted:
"...",'...', or`X...X`(custom quotes)
Multiple commands on one key
Key sequences
Key modifiers
Shift+. For example, @ instead of Shift+2 on a US keyboard. ASCII letters are an exception: Shift+a is interpreted as A.Special key names (selected)
Input command prefixes
Prefixes go between the key name and the command ininput.conf. Multiple prefixes are separated by spaces.
Property system
Properties allow reading and writing player state at runtime. They are used by:set,add,cycle,multiplycommands${property}expansion inshow-text,print-text- Scripting APIs (
mp.get_property,mp.observe_property, etc.) - IPC
get_property/set_propertycommands
--). Properties marked (RW) can be written; others are read-only.
Key properties
Playback state
Audio / video
File information
Playlist
Command reference
Playback control
seek <target> [<flags>]
seek <target> [<flags>]
+):keyframes is used for relative seeks and exact for absolute seeks. Combine flags:revert-seek [<flags>]
revert-seek [<flags>]
mark (mark current position for revert), mark-permanent (always revert to this position until changed).frame-step [<frames>] [<flags>]
frame-step [<frames>] [<flags>]
play (default — play then pause), seek (precise seek), mute (like play but muted). Does not work with audio-only playback.frame-back-step
frame-back-step
frame-step -1 seek. Does not work with audio-only playback.stop [<flags>]
stop [<flags>]
keep-playlist, the playlist is not cleared.Property manipulation
set <name> <value>
set <name> <value>
add <name> [<value>]
add <name> [<value>]
value (default: 1) to a property, clamping at min/max. Scalable: on high-precision inputs (touchpads), the value is scaled to finer steps automatically.multiply <name> <factor>
multiply <name> <factor>
cycle <name> [up|down]
cycle <name> [up|down]
up.cycle-values [!reverse] <property> <value1> [<value2> ...]
cycle-values [!reverse] <property> <value1> [<value2> ...]
!reverse argument (must come first) cycles in reverse order.del <name>
del <name>
change-list <name> <operation> <value>
change-list <name> <operation> <value>
append, prepend, remove, clr, etc.Playlist
loadfile <url> [<flags> [<index> [<options>]]]
loadfile <url> [<flags> [<index> [<options>]]]
opt=value list of per-file options.loadlist <url> [<flags> [<index>]]
loadlist <url> [<flags> [<index>]]
loadfile (replace, append, insert-next, insert-at, play).playlist-next [<flags>]
playlist-next [<flags>]
weak (default — do nothing on last entry), force (quit on last entry).playlist-prev [<flags>]
playlist-prev [<flags>]
playlist-next.playlist-play-index <index|current|none> [preserve-options]
playlist-play-index <index|current|none> [preserve-options]
current replays the current entry; none stops playback.playlist-clear
playlist-clear
playlist-remove <index>
playlist-remove <index>
current removes the currently playing entry and starts the next.playlist-move <index1> <index2>
playlist-move <index1> <index2>
index1 to the position of index2.playlist-shuffle
playlist-shuffle
playlist-unshuffle
playlist-unshuffle
playlist-shuffle. Works only once.Screenshot
screenshot [<flags>]
screenshot [<flags>]
+):filename set to the saved path.screenshot-to-file <filename> [<flags>]
screenshot-to-file <filename> [<flags>]
filename.OSD and text
show-text <text> [<duration>|-1 [<level>]]
show-text <text> [<duration>|-1 [<level>]]
${playback-time}). no-osd prefix has no effect on this command.duration is in milliseconds (default: --osd-duration). level is the minimum OSD level required to show the text.show-progress
show-progress
print-text <text>
print-text <text>
Scripting and messaging
script-message [<arg1> [<arg2> ...]]
script-message [<arg1> [<arg2> ...]]
mp.register_script_message("my-event", fn).script-message-to <target> [<arg1> ...]
script-message-to <target> [<arg1> ...]
script-message, but send only to the named client. The target name is the script’s internal name (as returned by mp.get_script_name()).script-binding <name> [<arg>]
script-binding <name> [<arg>]
mp.add_key_binding. Useful for remapping script bindings.load-script <filename>
load-script <filename>
--script. Returns a client_id field in the result.Execution
run <command> [<arg1> ...]
run <command> [<arg1> ...]
subprocess when you need to wait for the result or capture output.subprocess
subprocess
status, stdout, stderr, error_string, and killed_by_us.Quit
Track manipulation
Filter commands
Configuration commands
Miscellaneous
Property expansion
Properties can be embedded in string arguments with${property-name}. Use ${=property-name} for the raw (unformatted) value.
raw prefix or $> within the string:
input.conf commands but not in scripting API calls (use expand-properties prefix to enable it there).
Events
Events are notifications sent from the player core to scripts and IPC clients. See also: Lua scripting events.start-file
playlist_entry_id.file-loaded
end-file
reason (eof, stop, quit, error, redirect), playlist_entry_id.seek
playback-restart
shutdown
property-change
name, data.log-message
prefix, level, text.video-reconfig
audio-reconfig
client-message
script-message was received. Fields: args (string array).Hooks
Hooks block the player until all registered handlers callcont() (or return if defer() was not called). They provide synchronous control at specific points.