Awesome
quality-menu
A userscript for MPV that allows you to change the streamed video and audio quality (ytdl-format) on the fly.
Simply open the video or audio menu, select your prefered format and confirm your choice. The keybindings for opening the menus are configured in input.conf, and everthing else is configured in quality-menu.conf.
Note: Version 4.2.0 and later require mpv 0.39.0. Anyone on an older version of mpv can use version 4.1.2 instead.
Features
- Currently playing format is marked and selected when opening the menu
- Remembers selected format for every url in the current session (e.g. going back to previous playlist item automatically selects the prefered format)
- Controllable entirely by mouse or keyboard (opening by mouse requires either the OSC extension, uosc or an additional entry in
input.conf
) - All format related information from yt-dlp/youtube-dl can be shown
- Columns that are identical for all formats are automatically hidden
- Formats can be sorted based on resolution, fps, bitrate, etc.
- Simple reload functionality
- Columns and their order are configurable
- (optional) Graphical menu via uosc integration
Note: Requires uosc 5.0.0 or newer.
OSC extension
(optional) An extended version of the OSC is available that includes a button to display the quality menu.
PLEASE NOTE: This conflicts with other scripts that modify the OSC. Merging this OSC modification others is certainly possible. Depending on how the osc is modified, the osc.patch might apply cleanly, but you have to make sure the filename in the patch lines up with the filename of your files.
Installation
-
Save the
quality-menu.lua
into your scripts directory -
Set key bindings in
input.conf
F script-binding quality_menu/video_formats_toggle Alt+f script-binding quality_menu/audio_formats_toggle
(optional)
Ctrl+r script-binding quality_menu/reload
-
(optional) Save the
quality-menu.conf
into yourscript-opts
directory (next to the scripts directory, create if it doesn't exist) -
(optional) UI integration (pick one)
- For OSC: Save the
quality-menu-osc.lua
into your scripts directory and putosc=no
in your mpv.conf - For uosc (each is optional)
- Add the video and audio menu to the uosc menu by appending
#! ...
to your key bindings ininput.conf
F script-binding quality_menu/video_formats_toggle #! Stream Quality > Video Alt+f script-binding quality_menu/audio_formats_toggle #! Stream Quality > Audio
- quality-menu already overwrites the builtin uosc command
stream-quality
, so it already works well out of the box. For even deeper UI integration you can add buttons to thecontols=
option in youruosc.conf
<!has_many_video,video,stream>command:theaters:script-binding quality_menu/video_formats_toggle#@vformats>1?Video
<!has_many_audio,has_audio,stream>command:graphic_eq:script-binding quality_menu/audio_formats_toggle#@aformats>1?Audio
- Add the video and audio menu to the uosc menu by appending
- For OSC: Save the
Plans For Future Enhancement
- Visual indication of what the current quality level is
- Option to populate the quality list automatically with the exact formats available for a given video
- Optional OSC extension
- uosc integration
- [your suggestion here]
Credit
- reload.lua, for the function to reload a video while preserving the playlist.
- mpv-playlistmanager, for the menu formatting config.
- ytdl_hook.lua, much of the code to fetch the format list with youtube-dl came from there.
- somebody on /mpv/ for the idea