Home

Awesome

Metadata OSD script for mpv player

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

<picture> <source media="(prefers-color-scheme: dark)" srcset="sshots/sshot_osd_1_dark.png"> <source media="(prefers-color-scheme: light)" srcset="sshots/sshot_osd_1_light.png"> <img alt="OSD-1 Screenshot" src="sshots/sshot_osd_1_light.png"> </picture>

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

Installation & Configuration

Download & place metadata_osd.lua script into

for autoload.

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

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:

KeyActionConfig Option NameBinding Name (for input.conf)
<kbd>F1</kbd>Master enable / disable (killswitch)key_toggleenabletoggleenable
<kbd>F5</kbd>Enable / disable the autohide featurekey_toggleautohidetoggleautohide
unassignedShow / hide OSD-1key_toggleosd_1toggleosd_1
unassignedShow / hide OSD-2key_toggleosd_2toggleosd_2
<kbd>F6</kbd>Reset any user-toggled switcheskey_reset_usertoggledreset_usertoggled
unassignedShow status OSDkey_showstatusosdshowstatusosd

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:

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:

Program Architecture

See ARCHITECTURE.md.

License

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