Skip to content

vc-01/metadata-osd

Repository files navigation

Metadata OSD script for mpv player

This script adds metadata OSD (on-screen display) to mpv.

OSD-1 Screenshot

* Screenshot taken on a packaged mpv on Arch Linux; font type and size may vary on other platforms.

Installation & Configuration

Download & place metadata_osd.lua script into

  • $XDG_CONFIG_HOME/mpv/scripts (it will be most of the times ~/.config/mpv/scripts) on Linux, or
  • %APPDATA%\mpv\scripts on Windows

for autoload.

(Optional) Config file with user settings named metadata_osd.conf can be created in

  • $XDG_CONFIG_HOME/mpv/script-opts on Linux, or
  • %APP‐DATA%\mpv\script-opts on Windows

See the example configuration file metadata_osd.conf in this repo for available user config options.

Key Bindings

The following table summarizes the script's default key bindings and their config options:

Key Action Config Option Name Binding Name (for input.conf)
F1 Master enable / disable (killswitch) key_toggleenable toggleenable
F5 Enable / disable the autohide feature key_toggleautohide toggleautohide
unassigned Show / hide OSD-1 key_toggleosd_1 toggleosd_1
unassigned Show / hide OSD-2 key_toggleosd_2 toggleosd_2
F6 Reset any user-toggled switches key_reset_usertoggled reset_usertoggled
unassigned Show status OSD key_showstatusosd showstatusosd

Key bindings can be configured either via script's config file, see metadata_osd.conf example with pre-filled defaults, or via input.conf.

Default bindings in input.conf format are listed below again for clarity:

F1 script-binding metadata_osd/toggleenable
F5 script-binding metadata_osd/toggleautohide
#<unassigned> script-binding metadata_osd/toggleosd_1
#<unassigned> script-binding metadata_osd/toggleosd_2
F6 script-binding metadata_osd/reset_usertoggled
#<unassigned> script-binding metadata_osd/showstatusosd

Per media-type enable / autohide

OSD enabled state or auto-hiding after a delay can be triggered either manually by pressing the relevant key (see key_toggleenable and key_toggleautohide above) or determined algorithmically based on the currently playing media type and its related config options settings.

OSD is enabled by default for audio and video media, disabled while viewing pictures. Autohide feature is enabled for video, autohide is disabled (that is, the OSD will stay visible) while playing music, as well as for music files with cover art image.

Currently recognizable media types are namely: audio, audio_withalbumart, video, image.

Config options for per media-type OSD enable and autohide are cumulatively:

  • enable_for_<media_type> (yes/no)
  • autohide_for_<media_type> (yes/no)

If user presses a button to toggle enable / disable the OSD or the autohide feature, it will override the automatic determining until reset back by presssing a key specified by:

  • key_reset_usertoggled / reset_usertoggled (F6) (see above)

Program Architecture

See ARCHITECTURE.md.

License

This project is licensed under the terms of the MIT license. See LICENSE.