Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Hardware & Software > Software players

Thread Tools Search this Thread Display Modes
Old 13th December 2023, 11:50   #161  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv-menu-plugin: customizable native context menu for mpv on windows , requires mpv v0.37 or later.
previous v1.10 release: 100% C, some dynamic submenus available.
EDIT-2: The current version (v2.0-dev) delegates the dynamic menu updates to a lua script. Without script the menu will be purely static. The default script adds some new dynamic submenus (ex: #@tracks, #@playlist, #@profiles) and it is possible to create your own (by forking the code).

This recent C-plugin project (GPLv2 license) provides mpv with a customizable right-click menu with submenus and commands (the corresponding hotkeys are displayed).
Installation: unzip menu.zip. Put the plugin (the file menu.dll) into mpv's portable_config/scripts dir. Then edit (or create) your portable_config/input.conf file to show the menu. #menu: is used to indicate menu entries.
The following input.conf example binds a dynamic context-menu (navigate chapters, select audio channel and subtitles) to right-click:
# The default syntax is similar to mpv.net:
 _	show-text hello  #menu: mpv-plugin
 Ctrl+a  show-text hello	#menu: Foo > bar #this here is a user comment. The following line is a separator.
_       ignore    #menu: -
_       ignore    #menu: Audio      #@tracks/audio
_       ignore    #menu: Subtitle   #@tracks/sub
_       ignore    #menu: Chapters #@chapters
 j	cycle sub              	#menu: Subtitle > Cycle/Next
 v	cycle sub-visibility   	#menu: Subtitle > / Visibility
 f	cycle fullscreen       	#menu: / fullscreen
 _ ignore             #menu: -
 Ctrl+w quit                    #menu: X Quit
MBTN_RIGHT script-message-to menu show
Here is a screenshot demonstrating a small (static) context menu and a pause-indicator in the window titlebar (discussed in next post).

Last edited by butterw2; 12th January 2024 at 17:15. Reason: +v2-dev version #@playlist
butterw2 is offline   Reply With Quote
Old 19th December 2023, 17:40   #162  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
# mpv: how to create and display a shaders-On indicator ()

Knowing whether shaders are loaded can be useful. Here's what is currently possible in mpv (v0.37):
- The shader list is stored in the property glsl-shaders (a list of file-path strings).
- The simplest is just to display glsl-shaders ${glsl-shaders}, but this is often not practical because this property can be long and typically needs to be parsed for display.
- Using property-expansion and based on the content of glsl-shaders we can display a single character shaders-On indicator ().
- This indicator can be used in various places: window title, OSD, terminal-status, etc. It is typically initialized in mpv.conf or via command-line, but these properties can also be changed via input.conf commands.
- Once set the display will automatically update when glsl-shaders changes.
- Unfortunately there are 2 possible values for an empty shader list which evaluate differently. Always (re-)initialize shaders to "", otherwise you need to check for 2 values here instead of just one (this also avoids the default osd display being (error) when toggling off the last shader).
- my shaders-On indicator: ${!glsl-shaders==:} evaluates to "" if glsl-shaders is not an empty string, otherwise "".

- Other indicators are of course possible, ex: a pause indicator, which I use in the mpv window title: ${?pause==yes:|| } this evaluate to "|| " if paused, otherwise "".
playlist indicator: ${!playlist-count==1:${!playlist-count==0: #${playlist-pos-1}/${playlist-count}}} evaluates to ", 1/5" if the playlist has a greater than one length, otherwise "".
Indicators can be combined and displayed via the following string properties (they support property-expansion):
title, term-status-msg
osd-msg1, etc.
osd-playing-msg, term-playing-msg (only displayed when a new video is loaded, default: "")

ex mpv.conf or command-line, --title="${!glsl-shaders==:}${?pause==yes:|| }${?media-title:${media-title}}${!media-title:No file}${!playlist-count==1:${!playlist-count==0: #${playlist-pos-1}/${playlist-count}}}"

Last edited by butterw2; 12th January 2024 at 17:22. Reason: +playlist indicator
butterw2 is offline   Reply With Quote
Old 19th December 2023, 23:22   #163  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv: shaders-On but shader not applied !

setting glsl-shaders in mpv does not guarantee that the shader will be applied. Here are the possible issues:
1) Fails to open shader file, likely because the file-path is wrong, ex: Cannot open file 'abba.glsl': No such file or directory.
This can happen when typing shader names at command-line or because the shader has been renamed. This type of error can be displayed on OSD with a script.
2) Shader compilation error (from vo, ex: [vo/gpu/d3d11]), likely because of a syntax error.
With vo=gpu the video output is blue (helpful for shader developers), but this is not the case with gpu-next. The compiler output printed in red in the terminal is quite long.
3) No errors, but shader not applied because there are no active shader HOOKs.
Mpv shaders can contain multiple HOOKs that are executed conditionally. For instance a LUMA hook will only run if the input is YUV. Prescalers are often only applied for some scaling ratios (specified in WHEN conditions expressed in reverse polish notation). The active shader passes can viewed on page 2 of the built-in stats display. The same information is available in the property vo-passes. The pass names are taken from the hook's DESC line and don't always reference the name of the shader.

Conclusions about troubleshooting shader issues:
- first check the shader is loaded in glsl-shaders.
- look at the terminal output for any errors (they are displayed in red).
- display stats page2 to check whether there are active shader passes. If not check the conditions under which the desired shader HOOK is supposed to be executed.
- If paused, toggling fullscreen forces a screen refresh.
- If all seems OK, make sure the user parameter values used by the shader are correct.
- If you've modified (and saved) the shader source code you need to restart mpv to recompile the shader.

Last edited by butterw2; 21st December 2023 at 15:53. Reason: ..
butterw2 is offline   Reply With Quote
Old 21st December 2023, 16:21   #164  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
Dynamic mpv-menu example in dark mode, the played video file has an audio track, but no subtitles or chapters:

In the mpv/portable_config for A-pack, I will be using mpv-menu as a command launcher/hotkey memo for useful commands that may not be used frequently, but also as a way to use mpv with only the mouse when required.
The menu contains different types of commands. Here I used a prefix symbol to identify them: / indicates that the command toggles between 2 states, ex: fullscreen can be on or off. : indicates a permanent (until disabled) osd, ' indicates a limited duration osd. + or - increase or decrease value, = reset to default value (ex: 100 for volume). X indicates that the command quits mpv.

[EDIT] This is a standard windows menu, it supports standard hotkeys and can be navigated with the keyboard: Arrow keys can be used to navigate, Return/enter to execute command or exit menu. Alt/Esc closes an open menu. The first letter of commands/submenus can be used as accelerators, so use different starting letters for items of a same (sub)menu when possible.

Depending on your preference, you could include a fair number of commands in the menu using 2 levels of submenus, or you could just go with a minimalist launcher.

Last edited by butterw2; 6th January 2024 at 21:08. Reason: +keyboard menu navigation.
butterw2 is offline   Reply With Quote
Old 26th December 2023, 14:00   #165  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv: Disable (--no-osc) or Hide the On screen Controller

By default, mpv overlays (and auto-hides) a seekbar+buttons at the bottom of the screen. This feature is called the On-Screen-Controller and is based on a built-in script called osc.lua. The OSC offers only limited configuration options through script-opts/osc.conf. The default OSC is bad, the result is maybe passable after tuning the config. If you are decidedly not impressed with the OSC, you can disable it completely with --no-osc (input.conf or command-line option). The drawback is you won't have a seekbar available unless you get a replacement script. It's not difficult to do a better design, the problem is that Osc.lua is 3000 lines and gets regular commits, so any replacement fork requires regular updates. I present my own custom seekbar in the next post (not osc-based).

The alternative is to change the OSC visibility (hiding it when it is not required).
This can be done via a hotkey, ex input.conf: DEL script-binding osc/visibility #menu: View > OSC # OSC visibility: auto, always, never

You can override default OSC visibility (priority: script defaults < portable_config\script-opts\osc.conf < mpv.conf < command-line)
--script-opts-add=osc-visibility=never # <always, auto, never> default: auto
--script-opts-add=osc-showwindowed=no #default: yes. no: the OSC is not displayed in windowed mode

Last edited by butterw2; 14th January 2024 at 23:42. Reason: Osc.lua
butterw2 is offline   Reply With Quote
Old 1st January 2024, 23:56   #166  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv --no-osc: custom seekbar using a (kick-ass) overlay. Intro: showing custom OSD text in mpv

The mpv OSD is rendered with libass (also used for displaying subtitles). ASS_Tags can be used to render:
- text (font, color, position on screen).
- shapes (ex: the mpv logo) and of particular interest here rectangles (color, position).
For this, I would recommend to first create an overlay with mp.create_osd_overlay() in a script. I am doing this with basic (mpv uses mujs, ES 5.1) javascript.

Objective: I am trying to do a modern seekbar, colored bar with transparency similar to youtube.
UI elements associated with a hidable seekbar:
- seek time tooltip (for seeking with the mouse)
- playback-time / duration display.
- an optional status bar for information display, possibly with some command buttons.
I don't really need on screen buttons, as I typically use (keyboard /mouse) keybindings +right-click context menu. I do want to use a short time display format.

Mpv limitations:
- The built-in OSC... but we can disable it using --no-osc
- No built-in support for custom time formats.
- Mpv has a built-in progress bar feature called the osd-bar. It looks terrible by default, but it is fairly customizable. However, there are no options to change the fill color of the osd-bar (it uses the main osd color).
- The mpv text OSD default is (Font: sans-serif -> Arial), large size (=55), White color, thick black borders (size=3), transparent back-color. The OSD scales with window size, this only really works in fullscreen or with a large window. The big font causes some serious issues at small sizes and it doesn't work so well on light pictures either (the reason for the thick text borders).
Interestingly VLC uses a similar default and achieves a much nicer result using Freetype2 Font renderer (white text, small, black outline, shadow opacity 128). The time OSD display is shown at the top-right. It's readable (but a bit ugly) down to 50% zoom.

Overall it's easy to get a nice text display on a large dark background (just use a large white font). The difficult cases are:
1) white or grey pictures.
2) when you have to scale the display to a 360p (or less) window.
My preference for OSD text is to use a smaller font and not to scale the OSD with window size: Segoe UI (size=44), light font on dark background.
- To be able to keep small text readable (ex time-display) you probably need to use light text on dark background, ex: mpc-hc in dark mode has a nice hidable seekbar+status bar. This doesn't work with a modern transparent design though.
- When displaying text with a dark background in mpv, you will likely want some extra padding. This is true for regular OSD and overlay. Here are 2 ways to do it:
1) Add padding with a space char before and after. Use nbsp char (rather than regular space char, which only works with show-text and only before the text).
ex, input.conf: a show-text " Hello " #text padded with nbsp. Ass has a not very readable "\\h" tag.
2) With show-text, you can use --osd-shadow-offset=4
- Youtube does achieve acceptable results with gray time display text on a shaded background (this is the only case where they don't use a dark background for text). However I have not been able to achieve the same level of quality in mpv, maybe because of inferior font border rendering ?
- Youtube uses the google font Robota Medium (before that it used Arial). These fonts are good for a small time display (ex: size 16, bold). Specifically for time-readouts it is important that the font should have constant width digits (this is the case for Segoe UI, but not for ex: Segoe UI Semibold !).

my OSD text display and red seekbar:

EDIT: a simple javascript script showing overlay features: overlay0.js, the release version will have a hideable seekbar and custom time display.
Note: The script observes changes in the percent-pos property, triggering updates to the overlay for each new frame. This is overkill for just displaying a progress bar / custom playtime on screen. Updates using a (ex: 1 second) periodic timer would be sufficient here.

Last edited by butterw2; 9th January 2024 at 16:12. Reason: +overlay0.js demo script, 1/2
butterw2 is offline   Reply With Quote
Old 2nd January 2024, 12:19   #167  |  Link
Registered User
stax76's Avatar
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
To be continued...
I find it interesting how other users use mpv, thanks for sharing.
stax76 is offline   Reply With Quote
Old 5th January 2024, 11:52   #168  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
# Ass_Tags in mpv

The Ass_Tags format consists in a combination of \tag strings to display a text element or a shape. There are some quirks, so expect some trial and error:
- Each \tag needs to be escaped to "\\tag" for use in javascript strings.
- A simplified syntax seems to work fine ex: &AA rather than &HAA& in the doc.
- Color is specified as hexa &BBGGRR
- !!! alpha &OO is opacity not transparency: 00 is solid color and FF is transparent. 80 is mid-transparency.
\\c \\alpha : global color and alpha
\\1c \\1a : primary fill color, osd-color
\\3c \\3a : border color, osd-border-color
\\4c \\4a : shadow color, osd-shadow-color
- The background color itself cannot be modified in tags* (uses osd-back-color). You can specify global \\alpha or you can revert to the \\rDefault style which has transparent background.
- Font is changed with "\\fnSegoe UI\\fs18\\b1" (Segoe UI, size 18, bold). OSD style: osd-font, osd-font-size, osd-bold.
- Font size is the height of the characters in osd pixels. Unless you explicitly specify font size (\\fs18), the text will scale with the window.
- In addition to text, fonts are used to display icons on screen. Many useful characters/symbols are available in the windows standard fonts (if you can use a large fontsize), and there also dedicated iconic fonts available.
- You can use system installed fonts or fonts in portable_config/fonts.
- for text, you can specify just an anchor, osd-margins will be applied (--osd-margin-x, --osd-margin-y ). If you don't specify an anchor the default will be used, this isn't recommended as it will cover standard osd.
- You can specify precise position with \\pos(x,y), but you also need to consider the anchor point. It uses numpad numbering. The default \\an7 anchors the top right corner of the bounding box to position.
- The default (x,y) coordinate system is normalized to a display height of 720. The overlay will scale with the window size and the coordinates include any black bar padding.
- \\pos(0,0) is top-left of the OSD.
- I've chosen to switch to displayed osd pixels coordinates. It's simpler to use and the overlay doesn't scale with window size.
- For shapes you need to specify a \\p1 scale-factor, ! Do not specify it for text.
- Rectangles are filled. You can specify you don't want any border or shadow with \\bord0\\shad0.
- The overlay data consists in the concatenation with "\n" of all text and shape strings. The order in which you draw can have a visual impact.
- The overlay is always on top of the normal OSD (ex: show-text commands) when displayed. It can be hidden.
*It seems mpv messes with OSD parameter values for background fill. The shadow parameter can be used either to pad text background color or for actual font shadows depending on the alpha value of osd-back-color ? In mpv, text borders and shadows don't look so good, just set a non completely transparent alpha value to osd-back-color and avoid the nonsense.

Last edited by butterw2; 9th January 2024 at 16:06. Reason: 2/2
butterw2 is offline   Reply With Quote
Old 8th January 2024, 06:29   #169  |  Link
Registered User
stax76's Avatar
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Is learning and using Lua not an option? Most script authors prefer it.

Here is a short intro:

stax76 is offline   Reply With Quote
Old 8th January 2024, 13:08   #170  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
if ("" and 0) then print("lua is great") end

Good video, but no I don't think someone who wants to write a simple script for mpv needs to learn lua. Lua is the default in mpv, it's probably the better solution for advanced mpv scripts if you know it (and don't hate it), but both can work. Javascript is widely used and it's syntax is going to be easy for anyone who has ever done any c/java/python. Lua is also supposed to be faster, the mpv ES5 Javascript engine is old (meaning some useful functions are missing) and it's true that most available mpv scripts are in .lua.
Modifying existing scripts is the preferred approach if working code is already available. Typically you only need to write a few lines of new code, which can be done with a text editor with syntaxic coloring like notepad++. When debugging scripts you can just print your (number or string) variables to console or screen, but it doesnt work so well when you have to deal with objects (ex: lua table). A tool such as https://github.com/tsl0922/mpv-debug-plugin can be useful to visualize the content of mpv properties (including user-data properties).
A simple color progress-bar OSD overlay script is 100 lines of code, the final version with a hidable seekbar and custom time-format support isn't going to be huge, so the language used doesn't matter that much.

printd("x:", x), an enhanced print function for the purpose of debugging scripts: can print tables, differentiates string values from regular values.
- in js: function printd(pre, x) { print(pre, JSON.stringify(x)) }
- in lua: local utils = require('mp.utils')
local function printd(pre, x) print(pre, utils.to_string(x)) end

Last edited by butterw2; 16th January 2024 at 15:58. Reason: +printd
butterw2 is offline   Reply With Quote
Old 14th January 2024, 16:36   #171  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv script: short time format OSD btime.js v0.40 (2024-01-19).
Now configurable via portable_config/script-opts/btime.conf
Install: Copy script to portable_config/scripts, portable_config/input.conf: F11 script-binding btime/show

playtime / duration for the different supported formats:
00:00:08 / 00:01:12 (mpv default)
00:08 / 01:12 (mpc-hc, symetrical)
0:08 / 1:12 (btime, youtube)
-1.04 / 1:12 (alt + btime)

00:06:04 / 01:27:09 (mpv default, mpc-hc)
0:06:04 / 1:27:09 (symetrical)
06:04 / 1:27:09 (btime)
6:04 / 1:27:09 (youtube)
-1:21:05 / 1:27:09 (alt + btime)

01:02:08 / 01:27:09 (mpv default, mpc-hc)
1:02:08 / 1:27:09 (btime, youtube, symetrical)
-25:01 / 1:27:09 (alt + btime)

The OSD time format can be customized by the user via the format option. by default, uses a short time format similar to youtube, but better suited for movies (format=btime).
- You can switch to mpc-hc or youtube format.
- alt option allows to switch to remaining-time display.
- displays via standard OSD either using a keybinding or on seek (with seek=yes).
- the duration of the display can be configured (ms option). The text readout message isn't updated on screen, so duration (ms=1500) shouldn't be set too long.
- the custom duration string is updated each time a new file is loaded. It could be made available to other script by saving it in the property user-data/duration.

# format=btime <youtube, btime, symetrical, mpc-hc, mpv> time format: playback-time / duration
# alt=no <yes, no> alternative format: - remaining-time / duration
# percent=no <yes, no> percent progress format: (percent-pos%) time-pos, OR with alt: -remaining-time (percent-pos%)
# seek=yes <yes, no> display on seek event
# ms=-1 <-1, value> duration of OSD display in milliseconds ex:1500, -1: standard OSD duration

Added in v0.40 percent=yes, a percent progress format with playback-time or remaining-time:
(40%) 2:25 (percent, btime)
(100%) 1:35:25
-25:15 (75%)
-1:01:25 (23%) (alt+btime, percent)

Last edited by butterw2; 19th January 2024 at 11:09. Reason: +btime.js v0.40, percent=yes
butterw2 is offline   Reply With Quote
Old 16th January 2024, 18:15   #172  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv-menu-plugin: custom dynamic menus
menu_window_scale.lua: custom window-scale submenu, with checkmark for current value.
Edit: Using the new (dyn_menu v2.1) message interface, a script (lua or js) now has full control over menu items and dynamic submenus tagged with a predefined or user-created #@keyword in input.conf, without needing to fork dyn_menu.lua. You can dynamically change the title, the displayed hotkeys, the command, the checked state, and the disabled (grayed) state of menu items.

mpv-menu-plugin v2.1 (req mpv 0.37 on windows) has been released.
- static menus are simple and work fine.
- dyn_menu.lua provides a few useful dynamic submenus: #@tracks, #@chapters, #@playlist
#@audio-devices is also available if needed.
- dyn_menu.lua has a new message interface to allow user scripts to create custom dynamic submenus. Advantage of this approach: dyn_menu.lua doesn't need to be modified, allowing independent updates of user scripts and dyn_menu.lua.
- By default menu items are unchecked. The addition of a state-based checkmark for specific menu entries can improve menu readability significantly. However, this requires a dynamic update when the value changes.
#@property:check syntax, ex: #@mute:check is easy to use, but currently only works for a few (boolean) properties: mute, pause, fullscreen, border, ontop, deband, deinterlace, sub-visibility.

How custom dynamic menus work
at startup mpv loads scripts menu.dll and dyn_menu.lua > parses #:menu entries + associated keybindings in input.conf > creates user-data/menu/items (a nested table)
- the menu (user-data/menu/items) is displayed by win32 c-plugin (menu.dll)
- the default script dyn_menu.lua handles:
-- #@keyword dynamic menu updates
-- messaging to third party plugins (ex: recentmenu.lua) with data in json format.

Displayed keybindings vs actual keybindings
- There is no mechanism in mpv to change runtime input.conf keybinding: what you define in input.conf always applies.
- By default, the menu displays the keybindings associated to menu entries exactly as defined in input.conf. The menu doesn't check the keybindings work.
If you can launch a command from the menu, but not from the keybinding this would indicates some keybinding conflict, ex:
-- the key is not what you thought, ex: CTRL+O isn't the same as CTRL+o
-- you may have redefined the keybinding further down in input.conf.
-- or the key is getting stolen ex: by the OS (ex: you can't use printscreen on windows).
- It is possible to change the keybindings displayed in the menu. However what is displayed in the menu doesn't affect actual keybindings.
-- Why you might want to change what is displayed in the menu: some mpv keynames are a bit long or mpv uses local key names which are sometimes un-intuitive on non US-keyboard.

I created a custom dynamic submenu #@window-scale, this allows full control over the submenu and its entries. A checkmark for the current value is useful here.
Items created in dynamic submenus do not have associated hotkeys from input.conf. In input.conf, I do have hotkeys associated with the window-scale commands. But trying to retrieve them would not be simple, it is much simpler to display no hotkeys. I decided to display fake hotkeys (position is consistent with US keyboard keys, and more meaningful than the local key names).

- I've displayed my time readout in the screenshot (using the short format=btime from previous post).
- To dismiss the menu use Alt/Esc keys, or left-click on an empty command (ex: --- menu space in my screenshot).
- add _ ignore at the end of input.conf to avoid binding _.

Last edited by butterw2; 18th January 2024 at 13:40. Reason: ..#@property:check +menu_window_scale.lua link +TLDR
butterw2 is offline   Reply With Quote
Old 19th January 2024, 15:27   #173  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv (on win10/11): my Tips

mpv is a cross-plaform open-source, ffmpeg-based, command-line video player. By default, it uses a glsl shader-based renderer (and libplacebo with the option --vo=gpu-next). Mpv has extensive configuration options and generally good documentation. It can be scripted (using either lua or javascript) and supports c-plugins.

My tips for mpv newbies:
- create your mpv folder: with no spaces in path and with user write permissions.
- on windows, current mpv0.37-dev build (ex: Shinchiro x86_64 weekly) works well. Just download and unzip the build to mpv folder. You can update when you want using updater.bat.
-- Create mpv/portable_config for your .conf files and the portable_config/scripts subfolder.
- Get a copy of an existing config or create your own, no .conf files are provided by default.
- Start mpv from terminal in the mpv folder, you can use drag&drop. mpv pathto.myvideo.mp4
-- On windows the command prompt (cmd) will uses mpv.com, use a shortcut to mpv.exe if you don't want a terminal window (you can still use the console if needed).
- Startup options: user default startup options are configured in mpv.conf file. Command-line options have higher priority if specified.
- It is possible to define multiple configuration [profiles] in mpv.conf. Select the profiles to apply with the option --profile=
- For info on mpv options, check out the mpv.io/manual, some decent configuration guides are also available on the web but might not be 100% up-to-date.
- ! hardware decoder isn't enabled by default. I use --hwdec=d3d11va
- For old igpu: you likely need options from --profile=fast
- mpv isn't a GUI-based player and the On-Screen-Controler (built-in osc.lua) is probably the weakest feature. Fortunately it can be hidden, disabled (--no-osc) then replaced.
- For runtime commands you can use keybindings, it also possible to use the console (but the syntax isn't always simple). On windows, a custom context menu is available with context-menu-plugin.
- Define all your hotkeys in portable_config/input.conf, disable default keybindings with --no-input-default-bindings
-- the format is: KEY command1; command2 #:menu for context-menu entries #comments
- mpv is easy to script with .lua or .js (javascript ES5.1).
- Keep only the scripts you need in portable_config/scripts as they are autoloaded by default. You can manually load scripts with --scripts=
- I keep shaders and manually loaded scripts in mpv/s subfolder. It's also possible to use portable_config/shaders, the path can use ~~ for portable_config.
glsl-shaders property is a path list (if you have multiple shaders the separator is ; on windows, : elsewhere). ex: ---glsl-shaders=s/bw.hk;s/x_10_240.glsl Vs =~~/shaders/bw.hk;~~/shaders/x10_240.glsl
- Scripts can support configuration via portable_config/script-opts, myScript.conf is the configuration file for myScript.lua, ! option syntax must be strictly respected. Script configuration options can also be specified in mpv.conf or via command-line.
- Use _ rather than - in script names.
- mpv-debug-plugin is a mpv GUI tool that can help you make sense of mpv commands, properties and options.
- if you have questions reddit r/mpv is a good place to ask.

Last edited by butterw2; 21st January 2024 at 15:37. Reason: .
butterw2 is offline   Reply With Quote
Old 22nd January 2024, 20:21   #174  |  Link
Registered User
Join Date: Jun 2020
Posts: 303
mpv: seek menu

I'm using a static context-menu with some relative jumps/seeks (10, 30, 60, 300s), and like youtube some absolute percent seeks (10, 25, 50, 75, 90%). When the menu is displayed the first letter of menu entries acts as an accelerator, this allows to get more hotkeys without having to permanently define them. To block unwanted accelerators, you can add a space in front of the title. I also use input.conf: kp0 no-osd seek 0 absolute; set pause no #menu: Play > from start.
Some keys names in mpv aren't great (also, not very consistent), so there are a couple cases where I wanted key name substitutions in the menu, Ex: Ctrl+WHEEL_DOWN >> ctrl+WhDn. The length of the displayed menu titles and keybindings set the width of the context menu and some key combination are quite long, ex:Ctrl+Shift+KP_ENTER, another reason for changing displayed hotkeys would be to show multiple hotkeys for the same command on the same line.

One feature that is sometimes useful is the ability to define one or more seek-points by setting a time marker. A custom Markers menu with some user-data/markers properties should allow to do this (currently you could set ab-loop-a, or use revert-seek mark). The next release of context-menu-plugin will support copy/paste to clipboard, meaning a Go to Time feature becomes possible (at runtime: copy a timestamp to clipboard, then seek to it).

Last edited by butterw2; 22nd January 2024 at 20:34. Reason: .
butterw2 is offline   Reply With Quote

hlsl, mpc-be, mpc-hc, mpv, pixel shaders

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 22:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.