Commit Graph
1141 Commits
Author SHA1 Message Date
Guido Cella a58e9e596b Revert "ytdl_hook: add chapters by parsing video's description"
This reverts commit e9c43258b8.

yt-dlp implemented its own parsing to extract chapters from the
descriptions of videos without chapter markers in the player over 3
years ago in https://github.com/yt-dlp/yt-dlp/commit/0fe51254 (the PR is
even inspired by mpv). Actually it was present even earlier in
youtube-dl but was removed for unknown reasons in
https://github.com/ytdl-org/youtube-dl/commit/67299f23d8b1894120e875edf97440de87e22308.
So we can remove our parsing code, as it is dead code that never runs if
yt-dlp's JSON already contains chapters.

And it seems that such videos without chapter markers are rare or
non-existing by now anyway - we can't find any.
https://www.youtube.com/watch?v=1v_4dL8l8pQ is linked from the yt-dlp PR
with the above commit, but now yt-dlp returns the Key moments as
chapters, so it can't be used for testing.

Our parsing was actually worse than yt-dlp's, because #16085 added an
option to disable it to fix the misdetection reported in #16081, but
yt-dlp correctly returns no chapter for that video
(https://www.youtube.com/watch?v=1v_4dL8l8pQ). So this code branch was
only running for misdetections, and by removing it that option is not
needed.
2025-12-19 18:06:14 +01:00
Guido Cella acd3378c9b Revert "ytdl_hook: add option to extract chapters"
This reverts commit df1e71a7cc.

The next commit will make this unused since chapters will only be taken
from yt-dlp's JSON.
2025-12-19 18:06:14 +01:00
llyyr 4623a0a7e8 osc.lua: remove flags from disable_key_bindings
disable-section doesn't accept flags, and has no need for it either.

Fixes: c209d4f73b
2025-12-18 13:06:46 +01:00
Kacper Michajłow d3ec15bca8 stats.lua: remove prefix from display luminance metadata
People are getting confused about "HDR10" part.
2025-10-31 12:53:43 +01:00
Guido Cella 1abd2a05f1 console.lua: don't clip items if OSD dimensions are not initialized
If you open the menu at startup, e.g. with --input-commands, it rarely
clips items completely because OSD dimensions are still 0, or as if they
were 100 because those are the default values before receiving property
notifications. Avoid this.
2025-10-31 12:53:31 +01:00
Guido Cella e2bd1c6a88 {console/context_menu}.lua: don't apply --osd-blur to menu backgrounds 2025-10-29 15:36:35 +01:00
nanahi 7b660a5de9 console.lua: use clipboard property for x11 2025-10-27 20:01:47 +01:00
Guido Cella 0a53407a48 context_menu.lua: prevent some rare crashes
Fix crashes that won't happen in regular usage:

- If you open the menu with an empty menu-data and use keybindings
- If you open the menu with menu-data only containing hidden items
- If you invoke script-message-to context_menu select with the menu
  closed
2025-10-11 10:32:29 +02:00
Guido Cella 6e8283d377 context_menu.lua: add a missing return
The space key selects the current item so it shouldn't also try to
activate items with titles starting with space.
2025-10-11 10:32:29 +02:00
Guido Cella 67330ba2de select.lua: don't go beyond the max line length
Fixes 7be6095c23.
2025-10-10 08:44:03 +02:00
Kacper Michajłow 0fb40b654d stats.lua: split lines to make them shorter
Fixes: 92aeb63479
2025-10-10 06:14:42 +02:00
Kacper Michajłow 43b230b089 stats.lua: skip codec params if they are not available
Fixes: 2fd88ffbae
2025-10-10 06:14:42 +02:00
rach-md 7be6095c23 select.lua: rename some menus with proper name 2025-10-10 06:14:07 +02:00
llyyr 92aeb63479 stats.lua: make video block even when no video track
fixes formatting with `mpv --idle --force-window` with no files loaded
2025-10-10 05:41:56 +02:00
nanahi 67378b9c52 commands.lua: update screenshot commands flags 2025-10-06 04:27:13 +02:00
Kacper Michajłow cf393b12ac osc.lua: add indicator for buffering/loading 2025-09-29 01:45:47 +02:00
Guido Cella cabee53ebd context_menu.lua: make gap a percentage of the font_size
Avoids having to update the gap for most users who just want to change
the font size.
2025-09-27 19:26:54 +02:00
Guido Cella eac9ab275d console.lua: add gap script-opt 2025-09-27 19:26:54 +02:00
Guido Cella d8123d81bd console.lua: increase the gap between menu items
Make it less cluterred.
2025-09-27 19:26:54 +02:00
Guido Cella f147b133f0 select.lua: add online documentation menu entry 2025-09-20 18:10:23 +02:00
Guido Cella 7c1a4acdb2 select.lua: add edit-config-file and edit-input-conf
Add script bindings to edit mpv.conf and input.conf, and add them to the
menu. These are useful as shortcuts, but the main motivation is that new
users often ask why they can't find mpv.conf and input.conf, so this
creates them if they don't exist.
2025-09-20 18:10:23 +02:00
Guido Cella 8406834075 context_menu.lua: add this script
This implements a ASS context menu to be used on platforms other than
Windows.

The select script message will allow selecting an item with a single
click when releasing a mouse button, like in native context menus. This
is mainly useful to cycle pause with one click.
2025-09-15 04:12:57 +02:00
Guido Cella b9ceaf243d console.lua: don't autoselect the wrong completion
The first completion is automatically inserted when Tab was not pressed,
but this is unwanted when you already typed one of the completions which
is not the first one, move back the cursor and press Enter.

e.g. if the line is "set vid", you place the cursor before "v" and press
Enter, it runs "set ab-loop-avid".

Fix this by aborting when the text in front of the cursor matches one of
the completions.
2025-09-02 21:43:20 +02:00
NotMithical 6269f4ffce ytdl_hook.lua: add support for VP9 profile 2 2025-09-02 21:42:14 +02:00
Kacper Michajłow 0e966ba071 stats.lua: show also min_luma if max_luma is nominal SDR
Useful to see set black point.
2025-08-24 01:21:35 +02:00
sfan5 80d2a6a7ed ytdl_hook.lua: don't crash if playlist entries don't have an usable URL
see #16717
2025-08-23 15:02:46 +02:00
Kacper Michajłow 01b7edcc71 stats.lua: round max-cll to integer
In source-dynamic mode this can be converted from PQ, round it to
integer, same as max-luma already is.
2025-08-09 20:42:17 +02:00
sfan5 a6f3236c3a ytdl_hook.lua: don't pass any format to youtube-dl by default
yt-dlp changed its default format from `bv+ba/b` to `bv*+ba/b`, which we want to follow
since it fixes the behavior with some streaming sites.

The note that "sometimes youtube-dl returns a format that mpv cannot use" was added in
43c13e5ea2 but it's not clear what it refers to.

fixes #16388
2025-07-28 11:22:13 +02:00
sfan5 2168e3d82c ytdl_hook.lua: get rid of outdated youtube-dl hint
It has never worked for yt-dlp anyway and the relevant error messages
already tell people to update.
2025-07-28 11:22:13 +02:00
Kacper Michajłow 5b1df3c5d9 command: add video-params/prim-* properies
Available if raw primaries differ than named primaries value.
2025-07-11 21:53:58 +02:00
dyphire 3f6038f6cc select.lua: refactor subtitle parse
Avoid repeated display of the same content at the same subtitle time

Keep blank lines for both lrc and srt formats
2025-07-06 17:18:10 +02:00
Guido Cella 614e3c4223 console.lua: bind Ctrl+y to copy
Make Ctrl+y copy the input line to the clipboard, or the currently
selected item in the menu.

The vi key to copy is used because Ctrl+c is already bound.

Alternative bindings are:
Ctrl+x to cut, but this also clears the line.
Ctrl+shift+c like in terminals, but this is harder to press, and this
commit works differently from terminals anyway since you don't manually
highlight characters, it just copies the whole line.
Alt+w, the emacs copy binding, but unless you use emacs this is weird
and unfamiliar.
2025-07-05 01:20:02 +02:00
MarieVelter42 89427a4201 osc.lua: fix volume icon not updating while paused
Volume icon in the OSC did not update when mute toggled or
volume changed while playback was paused and mouse was idle.

This commit adds observers for mute and volume properties to
request_tick(), ensuring OSC updates immediately on mute or
volume changes, even if playback is paused and mouse is idle.
2025-07-04 10:17:04 +02:00
nanahi a043624ea6 osc.lua: fix element touch handling
On some compositors, when all touch points disappear the compositors
reset the mouse position, which moves the mouse out of the osc element
trigger area so mouse up events do not happen.

Fix this by tracking the last touch position and use that as the virt
mouse position if the screen is recently touched.
2025-06-29 18:16:54 +02:00
nanahi 18defc8530 stats.lua: fix append_property exclusions
f676a9ff20 changed some append_property
calls to append, but append does not support the exclusion feature
which results in "HW: no" shown when no hwdec is active when this
was not displayed before.

Fix this by adding option to append_property to use get_property_cached.

Fixes: f676a9ff20
2025-06-20 16:13:14 +02:00
Kacper Michajłow 47bc7b2a07 ytdl_hook.lua: add support for HEVC 2025-06-10 17:52:25 +02:00
Guido Cella d702e5fec8 console.lua: set compute_bounds and hidden at startup
There is no need to set them every time the width is calculated.
2025-05-03 22:45:10 +02:00
Guido Cella 4194522344 console.lua: rename option_color_to_ass to color_option_to_ass
It is more correct English.
2025-05-03 22:45:10 +02:00
Guido Cella 3600c716ea console.lua: fix crash when pressing Ctrl+l
Pressing Ctrl+l with selectable items without having called input.get()
earlier caused a crash.

Fixes a6024b562a.
2025-04-18 12:02:47 +02:00
yumcookiez df1e71a7cc ytdl_hook: add option to extract chapters 2025-04-17 00:37:13 +02:00
Guido Cella 498a9bf464 console.lua: center correctly within OSC margins
Center in the middle of the rectangle surrounded by the OSC instead of
in the center of the window.
2025-04-17 00:17:01 +02:00
Guido Cella 4dfe92fa27 console.lua: replace font script-opt with monospace_font
Allow configuring the monospace font without also changing the
proportional font. The proportional font is configured with the standard
--osd-font.
2025-04-17 00:13:19 +02:00
Guido Cella 42660a8c23 console.lua: say focused instead of selected
The selected term was causing confusion e.g. in
https://github.com/mpv-player/mpv/pull/15711#issuecomment-2676060139.
Saying either focused or current makes more sense since the item is not
actually selected until you click or press Enter.
2025-04-17 00:08:16 +02:00
Guido Cella b554d43cde select.lua: display editions when before the first edition
When the first edition is not at the start of the file but after the
current time position, the current-edition property is -1, which
prevented displaying any edition.

Fixes https://github.com/mpv-player/mpv/issues/16073#issuecomment-2787316609
2025-04-17 00:07:22 +02:00
Guido Cella d059f648fa console.lua: repurpose case_sensitive to only affect exact searches
case_sensitive originally only affected Tab completion. It defaulted to
yes outside of Windows just to emulate the bad defaults of bash and zsh
(not fish, which has better defaults and defaults to case-insensitive
completion). This was already silly, but then it affected the fuzzy
autocompletion and case-sensitive fuzzy completion is even more silly.
And since 0b3cc3a167, it accidentally stopped affecting even that,
because the completion via script message never checked for the option.
Nobody even noticed this, meaning that nobody was relying on fuzzy
autocompletion being case-sensitive.

Just make case_sensitive only affect the new exact search, and make it
default to no on all platforms. Though IMO the search could just always
be case-insensitive.
2025-04-17 00:01:27 +02:00
Guido Cella 4cb5f7aa1f console.lua: implement exact matching
Allow matching items exactly instead of fuzzily when prefixing the
search with ' (like in fzf) or with
--script-opt=console-exact_match=yes.

This is mainly useful to filter history entries chronologically.

You can also specify multiple search terms delimited by spaces. But '
makes every term an exact match, unlike fzf where you need to place it
before every word, since we can't hook into fzy's algorithm.

Closes #14587.
2025-04-17 00:01:27 +02:00
Kacper Michajłow bff0d59cbe stats.lua: set plot_{perfdata,vsync_ratio,vsync_jitter} to no
Disables perf graphs from stats.lua. They are relatively expensive to
render, causes a lot of memory to be used for caches which are never
reused because graph is rarely the same. And most importantly those
graphs are not that useful beyond quick visual inspection of jitter.

Can be enable in script-opt if needed. Cache graph is left enabled,
because it shows if cache readhead grows or not nicely.
2025-04-16 23:58:46 +02:00
Kacper Michajłow fd1007260c stats.lua: add stats-plot_cache script-opt
Allows to disable cache graphs on page 3 of stats.lua.

Fixes: #13894
2025-04-16 23:58:46 +02:00
Mike Will d1d2d9a0bb osc.lua: update OSC on playlist position changes
Fixes: 168fb56fe8
2025-04-16 23:58:28 +02:00
showergum 44816ef8ff console.lua: default prompt to an empty string
Calling input.select() without a prompt argument was failing due to
attempting to concatenate a nil value.

Before mpv 0.40 the prompt defaulted to ">" so this is expected to
work as evident from the example code.
2025-04-12 20:55:34 +02:00