291 Commits

Author SHA1 Message Date
Guido Cella eac9ab275d console.lua: add gap script-opt 2025-09-27 19:26:54 +02:00
ikas 0bbcc91e1b video/out/d3d11: add changing size support for composition mode 2025-09-19 02:26:08 +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
arch1t3cht 31bd176357 stream_bluray: add bluray-angle option
1-index angles to be consistent with DVD angles in mpv and with the
1-indexing in other applications like libbluray's example programs.

The three existing calls to bd_get_title_info all only access the
duration, the playlist, and the number of angles, which do not depend on
the passed angle, so they can keep being called with angle 0 for
simplicity.

Documentation taken from before
35e8b6c1e6.

Fixes #5012.
2025-09-15 03:52:35 +02:00
Kacper Michajłow 4f08802ff1 osdep/w32_register: add register/unregister options for Windows
On Linux, we have `mpv.desktop`, and on macOS, we have `osxbundle`, both
of which handle file associations and protocol registration in the
system environment.

On Windows, this information is stored in the registry, so this commit
adds support for it.

It registers the application, supported file types, and supported
protocols, and adds an uninstall entry so users can remove all
registrations via the control panel. Note that this does not remove the
binary itself.

The implementation is fully portable. There are no external installers,
as mpv handles everything automatically. This should improve usability
when moving binaries and so on.

- `mpv --register` registers mpv (see verbose output for a list of actions).
- `mpv --unregister` reverts all changes made during installation.
- `mpv --register-rpath <string>` allows specifying a string to be
  prepended to `PATH` before running mpv. This is useful when using
external dependencies that shouldn't be added globally to `PATH`.
2025-09-15 03:47:35 +02:00
nanahi 7a5ecf1c06 video/out/w32_common: support --wid=0
Similar to X11, this makes mpv attach to the desktop wallpaper window
(make the system create one if it does not yet exist) as parent,
which makes mpv display as desktop wallpaper behind desktop icons.

Lika an actual wallpaper, mpv will not receive any keyboard or mouse
input in this mode. It can still be controlled through terminal and IPC.
2025-09-07 18:19:44 +02:00
Kacper Michajłow dbda70a11c vd_lavc: add --hwdec-threads
No reason to not enable threads if lavc supports them, same as for
software decoding. Might help with pipelining of decoding and filtering.

Performance difference may vary, but in my testing everything is working
as expected and I didn't notice any regressions.

Set to 2 threads by default as conservative value that should resolve
stalling issue, while also not spawn too many cpu threads, which won't
help with hwdec anyway and only can cause too deep queue of hardware
surfaces.

Fixes: #16578
2025-08-15 20:24:19 +02:00
Dudemanguy ed7b1aca0b DOCS/interface-changes: add backticks to tls-options
It's what is normally done.
2025-08-08 01:07:00 +00:00
Dudemanguy b5c629fd12 filter_sdh: convert --sub-sdh-enclosures to a string list
This lets users specify any possible pair of characters to remote text
from in the SDH filter as opposed to the old way which would
automatically map ( to ) internally.

Additionally, this fixes #16597 because the old implementation relied on
looping over a single string using strlen for matching chars. That
doesn't work because strlen loops over bytes and non-ASCII characters
can have multiple bytes leading to false positives since the bytes could
match. There's various ways to deal with this, but simply using mpv's
internal stringlist type sidesteps that problem.
2025-08-06 13:57:38 +00:00
Jens Peters 4d12a60be2 docs: document tablet input 2025-07-14 22:07:24 +00:00
Dudemanguy 08d7d049d1 build: install encoding-profiles.conf into the system data directory
fd4e3af740 originally started installing
it, and we've been doing it ever since then. The value of having all of
these encoding profiles predefined by default is pretty dubious since a
lot of them are pretty old ('MP4 for Nokia N900' being a shining
example) and mpv is not really a good encoding tool anyways. Let's treat
it like the other conf files in etc and install it in the data directory
for reference. If someone really uses these, they can copy the file over
locally to their mpv config directory and it'll still work fine.
2025-07-12 14:01:54 +00:00
Kacper Michajłow c5c1477eb4 vo_gpu_next: change --target-colorspace-hint to auto by default
Auto mode will also enable hint for SDR formats if target metadata is
reported by current output context.
2025-07-11 21:53:58 +02:00
Kacper Michajłow ce076de31f vo_gpu_next: add --target-colorspace-hint-mode option
Useful to actually set target display paramters to colorspace hint.
2025-07-11 21:53:58 +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
ourfor 7df09125f3 video/out/d3d11: add d3d11 composition mode support 2025-07-07 00:09:08 +02:00
dyphire f7707e4dd9 vo_gpu_next: add options to control subtitles peak for HDR output
Users may want to have darker subtitle brightness for HDR viewing

Closed https://github.com/mpv-player/mpv/issues/13680
2025-07-06 16:00:51 +02:00
dyphire cbea6013e4 player/command: add a default flag to the track add commands 2025-07-06 12:52:22 +02:00
nanahi 11d3ad635f DOCS/interface-changes: add --prefetch-playlist default change 2025-07-05 21:29:37 +02:00
nanahi 63defa7708 video/out/gpu/video: add options to control background tile appearance
Add options to control background tile colors and size and vo_gpu
implementation.
This allows a dark mode tile pattern.
2025-07-05 01:17:25 +02:00
Patrick Wang 43e83dc74b options: parse tls-related options as path 2025-05-21 14:43:24 +00:00
sfan5 e663cbc037 vo: move vo_mediacodec_embed to not be the default on Android 2025-05-03 18:13:35 +03:00
Guido Cella 01b51d1f72 options: add cue to --playlist-exts's defaut value 2025-04-17 21:40:04 +02:00
yumcookiez df1e71a7cc ytdl_hook: add option to extract chapters 2025-04-17 00:37:13 +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 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
llyyr f24611980c sub/osd: add osd-shaper and set it to simple by default
This is a change in default for libass with harfbuzz enabled, previously
it would choose the best available shaper.

Harfbuzz isn't really needed for mpv's OSD and it comes with a
significant performance penalty, so use simple instead
2025-04-16 23:58:02 +02:00
llyyr efba6e7e5a sub/sd_ass: add sub-{glyph-limit,bitmap-max-size} 2025-04-16 23:58:02 +02:00
llyyr fc972d2049 sub/osd: add osd-{glyph-limit,bitmap-max-size} 2025-04-16 23:58:02 +02:00
llyyr ad61018294 sub/osd: add osd-prune-delay 2025-04-16 23:58:02 +02:00
Tom Grimwood-Taylor a407e13f83 misc/language: add a forced flag to the track add commands 2025-03-31 11:47:52 +02:00
한승민 513ccb9227 DOCS/interface-changes/kitty-passthrough: option addition notice 2025-03-26 18:25:49 +01:00
Guido Cella e88864aef3 commands.lua: add remember_input script-opt
Allow clearing the input line on close. Fixes #16104.
2025-03-26 14:56:48 +01:00
sfan5 e48ac7ce08 Release 0.40.0 2025-03-25 18:33:27 +01:00
Guido Cella 0b3cc3a167 commands.lua: split this script out of console.lua
It was suggested by CogentRedTester in
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858727729 and
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858809580 and
by avih that making running commands an mp.input client is a better
architecture.

A practical advantage is that completions are calculated in a different
thread, which prevents hanging when completing slow/network filesystems.

script-binding console/enable becomes script-binding commands/open,
though the console one is kept as an alias. I took the opportunity to
rename this because open makes more sense for a graphical modal, and it
is the word used in mp.input and user-data.

script-message-to console type becomes script-message-to commands type,
though the console one is kept as an alias. It is also changed to
automatically close on submit without having to append '; keypress ESC'
as you don't need to keep the console open after running prefilled
commands.

Also convert to double quotes like other scripts and rename some
inconsistent functions.
2025-03-08 19:09:23 +00:00
Guido Cella ce6a52d40a console.lua: add history_path field to mp.input.get
This allows saving the history to all mp.input.get clients.

Needed to split running commands out of console.lua.
2025-03-08 19:09:23 +00:00
Guido Cella 05438fc081 console.lua: add autoselect_completion field to mp.input.get
This selects the first completion when pressing Enter when one wasn't
already manually selected.

Needed to split running commands out of console.lua.
2025-03-08 19:09:23 +00:00
Kacper Michajłow ecc31ecab3 player/command: add attached-picture flags to track add command 2025-03-08 00:21:06 +01:00
Kacper Michajłow 7b9290f620 player/command: add visual-impaired flags to track add command 2025-03-08 00:21:06 +01:00
Kacper Michajłow 3147eca943 player/command: convert flags to OPT_FLAGS for track add commands 2025-03-08 00:21:06 +01:00
Kacper Michajłow 7df3f442ea misc/language: parse hi/sdh/cc tags from external subtitle tracks
This also adds `hearing-impaired` argument to `sub-add` command.

Fixes: #14805
2025-03-08 00:21:06 +01:00
Kacper Michajłow 93ea3df0a9 player: add mpv:// protocol
This is useful to run mpv from URL handler. Can be used to start mpv
from you web browser or anything that would trigger url handler for
given protocol. Only safe protocols are allowed.

Current solutions to run mpv in such context are to spawn IPC proxy and
run mpv when requested, but this is in most cases not necessary.

Currently the protocol is added in mpv.desktop. Windows related
registration will follow in future changes.
2025-03-07 00:15:23 +01:00
Kacper Michajłow d2e3fd9383 auto_profiles.lua: make profiles apply with higher priority
This increases the priority from 50 (which is neutral) to ensure that
profiles are applied before other scripts.

In general, applying profiles before other scripts makes sense. This was
already the case for external scripts with default priority because they
would load after auto_profiles.

This commit primarily fixes ytdl_hook.lua to respond to profile changes.
In most cases, profile conditions are triggered by external conditions,
not the output from the ytdl hook, so this is fine.

I acknowledge that this will change the order if a script previously had
a priority lower than 50. However, injecting itself before profiles are
evaluated is a very obscure use case, if there is even a valid one.
2025-03-07 00:08:10 +01:00
Kacper Michajłow 1582705f27 demux_mkv: add demuxer-mkv-crop-compat option
I don't expect the Matroska specification to be adjusted for this to
work soon, so in the meantime, follow the spec as written and add an
option to support most files in the wild.

I would prefer this to never be an option, but it looks like it's
unavoidable.

Recently, FFmpeg added cropping support for Matroska, so we don’t want
to be the odd one out by doing it differently...

See for more details:
https://github.com/ietf-wg-cellar/matroska-specification/pull/947
https://gitlab.com/mbunkus/mkvtoolnix/-/issues/2389
https://github.com/mpv-player/mpv/pull/13446

Fixes: #15800
2025-03-04 19:33:27 +01:00
Guido Cella 996c098725 console.lua: add a keep_open flag to mp.input
With input.select this allows building nested submenus without the
flicker of console quickly closing and reopening, and also doing
multiple selections, to e.g. cycle through different values of a
property, or increase a property multiple times.

With input.get this is used to change the default behavior to closing by
default on submit. It was argued by avih that this is more useful, and
indeed Github code search shows that everybody is calling
input.terminate() unconditionally on submit, so the impact of the change
should be low, and restoring the old behavior is as easy as passing
keep_open = true, which is just ignored in older mpv versions.
2025-02-24 16:26:58 +01:00
nanahi 7dd5154971 clipboard: remove --clipboard-enable
Clipboard can be now disabled with --clipboard-backends-clr so
--clipboard-enable is redundant.
2025-02-24 16:23:41 +01:00
nanahi 8368d55282 clipboard: add --clipboard-backends option
This allows specifying a priority list of clipboard backends
to use. This is mostly useful on Linux where multiple clipboard
backends exist.
2025-02-24 16:23:41 +01:00