Commit Graph
235 Commits
Author SHA1 Message Date
Guido Cella ea40f07d2d DOCS/interface-changes: add newline at end of file 2026-04-01 16:47:26 +02:00
zenodity ae2384bce0 player/command: add default-value/choices arg fields to command-list
Add optional 'default-value' and 'choices' fields where appropriate
for command arguments in the 'command-list' property. Update
documentation to reflect the command-list schema change.

DOCS/interface-changes/command-list: add changes
2026-04-01 16:08:26 +02:00
Kacper Michajłow 39302caae4 osc.lua: use window title for window controls from mpv core 2026-04-01 16:07:27 +02:00
NRK d79c4ad1e3 player/command: add env property
mainly so that env vars can be accessed from within config files.
2026-03-31 18:44:10 +00:00
Dudemanguy 90985bb826 vo: officially deprecate vo_vaapi
Using vo_vaapi has already been heavily discouraged for years since
years since 5c313f1f59. More importantly,
it's just fundamentally broken on most hardware, serves no real purpose,
and well we shouldn't just ship broken stuff. vo_vaapi largely only ever
worked correctly on some intel hardware. The VO relies on certain API
calls that other vendors never implemented so things like the OSD and
subtitles are just never going to work. This largely has no reason to
exist either. If you're looking for efficient playback, you can use
vo_gpu/vo_gpu_next in dumb mode with vaapi decoding. You can also use
vo_dmabuf_wayland with vaapi as well to avoid even more GPU to CPU
copies and theoretically be even more efficient.
2026-03-30 00:34:31 +00:00
Kacper Michajłow 793ab6dcb0 options: target-gamut now accepts custom CIE xy primaries
Fixes: #17633
2026-03-25 02:01:03 +01:00
Kacper Michajłow 7466a9f9f3 video/out/win_state: don't move window when force-window-position=no
When force-window-position=no place window on requested position only on
init (when VO requests `force_pos`), except that keep existing
position on auto resizes.

This applies to both user provided geometry and default center
position.

Fixes: #17588
2026-03-23 15:05:01 +01:00
nanahi f7f7cf18f3 command: add update-clipboard command
This uses the update_data request for clipboard backends that require it.
When clipboard monitoring is disabled, the backends will no longer
fetch data when it detects data change, and will now only do that when
receiving the update_data request.

The client now needs to run this command to update the clipboard content,
otherwise the property value is outdated.

This makes sure that applications that depend on "paste once" behavior
work correctly.

This command runs in a separate worker thread so that it can be used
as a "blocking" way to update clipboard until the update notification
arrives without blocking the playback core. It accepts a maximum timeout
parameter. This uses the existing mp_cancel mechanism to make sure this
command can be aborted and the worker threads will not stall the player
too much when quitting mpv.

For backends that do not support update_data, this command does nothing.
2026-03-21 16:05:36 +01:00
Kacper Michajłow 8bf384fe6d osc.lua: add osc-icon_style option 2026-03-13 19:14:39 +01:00
Kacper Michajłow 7b2feb9429 osc.lua: add osd-margin option
Fixes: #17539
2026-03-10 19:45:03 +01:00
Kacper Michajłow e1e6eb8b6e osc.lua: add sub-margin option 2026-03-10 19:45:03 +01:00
Kacper Michajłow aa8966a50f osc.lua: add dynamic_margins option 2026-03-10 19:45:03 +01:00
nanahi 9bb5a0b705 osc.lua: add audioonlyscreen script option
Allows rendering mpv logo when there is no video, instead of
black screen. osc is still available at the same time for playback
control.
2026-03-08 13:07:37 +01:00
nanahi ba30c8c175 player/loadfile: add on_loaded hook
Currently, there is no hook which happens when the playback actually
starts. The on_preloaded hook is insufficient for many cases, as many
track information are unavailable at that stage. This makes it impossible
to act on certain track metadata before the media is shown to the user,
so the user will see the media before action for a brief moment before the
properties are notified and options are changed.

This adds the on_loaded hook which allows the mentioned information
available.
2026-03-08 13:07:05 +01:00
CogentRedTester 429fdcf21d mp.input: allow clients to override console.lua script-opts
This commit allows a table of script-opt overrides to be passed to
`mp.input.get()` and `mp.input.select()`, which console.lua will use
instead of the its own.

To minimise required changes, metatables are used to allow console.lua
to seamlessly fall back on the original script-opts if the client does
not provide an override.
To prevent exceptions, the incoming opts must be of the same type.
2026-03-07 12:31:50 +01:00
Kacper Michajłow f9190e57f9 vo_gpu_next: add scRGB support
Fixes: #17076
2026-03-06 16:17:58 +01:00
Kacper Michajłow eda3b89278 osc.lua: make top/bottom bar show independently on mouse proximity
Controlled by `windowcontrols_independent` opt.
2026-03-05 12:44:11 +01:00
Kacper Michajłow e54cee1b23 player/command: apply expand-properties modifier also for string lists 2026-02-27 20:18:42 +01:00
Guido Cella 3b555c349c command: let playlist-play-index current preserve file-local-options
If you set file-local-options/foo at runtime and run playlist-play-index
current or playlist-play-index $current_pos, file-local-options/foo is
reset. Add a flag to make it preserve file-local-options.

The advantage of this change is that it allows binding Ctrl+r set
file-local-options/start ${=time-pos}; playlist-play-index current yes
to reload the current file while preserving all options, independently
of --no-config, --watch-later-options or --reset-on-next-file, and
without writing watch later files to disk. It also preserves
file-local-options set on the CLI unlike loadfile.
2026-02-27 09:21:14 +01:00
CogentRedTester 9902e84e20 DOCS/interface-changes: change how mp.input completions are returned 2026-02-24 20:19:24 +01:00
nanahi 4e2f3ce4b9 command: add track-list/N/demux-duration property 2026-02-24 19:36:33 +01:00
nanahi ccdb098fb4 stats.lua: add track_info_selected_only script option
Allow displaying info for all tracks rather than only selected tracks.
2026-02-24 19:36:33 +01:00
Kacper Michajłow 626f1344c8 vf_d3d11vpp: rename ivctc to ivtc
This was a typo. Although this changes the user option name, this
filter, especially this option, is so niche that I fix it without a
deprecation period.
2026-02-18 18:13:18 +01:00
Guido Cella 1f686769cd mp.input: deprecate log_error()
This was a mistake. It's too situational and it's not worth complicating
the API and every mp.input client with it. It made some sense before I
implemented input.select() because you could use input.get() to input a
choice and validate it, but in general for input.get() clients it's
better to show an error with input.set_log() instead of adding new lines
to the log everytime. This is what e.g.
https://framagit.org/Midgard/mpv-subber/-/blob/master/subber.lua does.

So this is only marginally useful for REPL scripts that keep adding
lines to the log, and the only such scripts are commands.lua and my
lua-repl.lua. commands.lua never used it and I already removed it from
lua-repl.lua. Cloning all scripts in the wiki reveals that **nobody** is
using log_error(), confirming that it is safe to deprecate.
2026-02-08 11:51:17 +01:00
Mohammad AlSaleh 313beaf241 player: make effective image_display_duration playback_speed aware
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2026-01-21 11:40:20 +01:00
Dudemanguy 11c020f526 player/command: refactor loadfile and loadlist commands to use flags
We should have done this ages ago. These commands essentially consist of
a combination of a load action and whether or not playback should be
started. The old `-play` aliases are kept for backwards compatibility.
2026-01-10 01:00:58 +00:00
nanahi a3350e2fbb command: add libplacebo-version property
Similar to other core library dependencies.
2026-01-02 20:04:32 +01:00
Kacper Michajłow cb1b6a54f2 video/filter/vf_amf: add AMD Frame Rate Conversion filter
D3D11 only for now. Documentation says that only D3D11 and D3D12 is
supported, but it looks like Vulkan is possible too. But I realized this
after implementing this version. Vulan may be added later.

Fixes: #16613
2025-12-23 07:06:34 +01:00
Kacper Michajłow c0433f064e vf_format: deprecate --vf=format=sig-peak 2025-12-22 10:19:38 +01:00
sfan5 41f6a64506 Release 0.41.0 2025-12-21 20:08:20 +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 1a802b1810 ao_pipewire: avoid setting any media.role by default
This adds option `--audio-set-media-role` to configure whether mpv
should set media roles to supported audio APIs or not. Disabled by
default.

By default, WirePlumber restores the volume of each application to
whatever the last application with the same media role used. This is
completely insane behavior, and I couldn’t find any way for a user to
opt out of it on my end. The `state-stream.lua` script responsible for
this mess only uses media.role if the property is present, so the only
reliable workaround is simply not to set one at all.

This WirePlumber behavior is inherited from PulseAudio, which also
exhibits the same behavior to this day.

This commit also mirrors the same change made to ao_pulse in 2015:
b7325b2f64

See also: https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/489
2025-12-13 14:46:55 +01:00
nanahi 6756e86384 player/command: fix playlist-remove argument requirement
playlist-remove has a required index argument, as indicated by the
documentation. However, in 332907e1d7
MP_CMD_OPT_ARG was mistakenly added, making it optional.
The effect of not specifying the argument is defaulting the index to 0
and always removing the first element in the playlist, which is not
expected.

Fix this by making the argument required.

Fixes: 332907e1d7
2025-11-30 14:21:09 +01:00
Kacper Michajłow 9b4341643f video/out/gpu/video: add --sdr-adjust-gamma 2025-10-29 15:36:15 +01:00
Kacper Michajłow 3e628c8d64 vo_gpu_next: linearize sRGB as a pure 2.2 power function
sRGB reference display is defined a 2.2 gamma device. To preserve the
look of the sRGB as mastered on such device, linearize it as such.

Note that sRGB encoding is piecewise with linear segment, which creates
mismatch to pure power 2.2 function, but this is intended to be viewed
on such display.

See:
IEC 61966-2-1-1999
https://community.acescentral.com/t/srgb-piece-wise-eotf-vs-pure-gamma/4024
https://github.com/KhronosGroup/DataFormat/issues/19
https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/12
https://github.com/dylanraga/win11hdr-srgb-to-gamma2.2-icm
2025-10-29 15:36:15 +01:00
nanahi 1fec44cc6c clipboard: add --clipboard-xwayland option
On Wayland envitonments with Xwayland available but without
ext-data-control-v1, mpv will fall back to the X11 backend instead of
VO backend. This may result in clipboard not working properly between
mpv and native Wayland clients.

Fix this by disabling X11 backend on Wayland envitonments by default
and adding the --clipboard-xwayland option for manual override.
2025-10-27 20:01:47 +01:00
nanahi 4f03bc1779 clipboard-x11: add x11 clipboard backend
This adds the x11 clipboard backend and native clipboard support to x11.
Clipboard monitoring is supported.
2025-10-27 20:01:47 +01:00
Kacper Michajłow b5c538a9c7 vo_gpu_next: add --hdr-reference-white 2025-10-10 06:12:35 +02:00
Kacper Michajłow 7dd035e937 vf_format: add some basic HDR10 metadata
Can be extended if needed.
2025-10-07 07:56:18 +02:00
Kacper Michajłow 96ce2d199d vf_format: add --vf=format=transfer alias 2025-10-07 07:56:18 +02:00
Kacper Michajłow 33f38423b3 vo_gpu_next: add --border-background=blur and --background-blur-radius 2025-10-06 16:27:50 +02:00
nanahi d89add6eb2 screenshot: add osd and scaled flags to screenshot commands
Currently, screenshot being scaled and the presence of OSD and subtitles
cannot be independently controlled. This adds osd and scaled flags to
screenshot commands that make it possible to e.g. take screenshots with
only OSD without subtitles, or take screenshots at scaled resolution
without OSD or subtitles.

The "window" flag is now an alias of scaled+subtitles+osd, and is kept
for convenience.
2025-10-06 04:27:13 +02:00
llyyr be5e606377 sub: make --sub-fix-timing configurable
Instead of hardcoding the threshold and keep duration in a header,
expose them as options for users to configure and set old hardcoded
values as the new defaults for those options.
2025-10-05 21:35:20 +02:00
Kacper Michajłow db2b4362c7 vo_gpu_next: add --target-colorspace-hint-strict option 2025-09-27 22:16:59 +02:00
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