Compare commits

...
719 Commits
Author SHA1 Message Date
Kacper Michajłow 4013a3c9b6 ci/build.yml: add publish job for git prerelease 2026-06-04 19:44:44 +02:00
nanahi 1d82932cce various: use fopen wrapper for cloexec handling 2026-06-04 04:58:16 +02:00
nanahi 1f150567ac osdep/io: fix fdopen mode flag
In both C11 standard and Microsoft documentation, '+' must be placed
immediately after mode, so placing 'b' between them is incorrect.
2026-06-04 04:58:16 +02:00
nanahi f1a42eff01 osdep/io: use mp_fopen on all platforms
Currently, all fopen uses in mpv do not set cloexec flag, resulting
in fd leak whenever mpv creates a process.

This makes mpv use mp_fopen on all platforms, and always set O_CLOEXEC
on the opened fd. This is required because the "e" flag for fopen is
nonstandard and UB in C11, and unsupported on macOS.

This had been done similarly in other projects. e.g.
https://gitlab.com/graphviz/graphviz/-/merge_requests/3797
2026-06-04 04:58:16 +02:00
NRK 6d5c8591eb osc: reevaluate mouse state after leaving never
currently mouse processing only happens on mouse movement which
causes cases where going from never -> auto does not show the
osc even though the cursor might be in proximity.

move mouse processing code to a function and refresh it when
leaving visibility never to avoid such issues.

Fixes: https://github.com/mpv-player/mpv/pull/17954#discussion_r3286015305
2026-06-04 00:18:55 +02:00
NRK 048c5ec351 osc: fix thumbnails clearing on visibility change
currently hide_bar() bypasses set_visible when visibility was
changed to `never`, this can leave the thumbnail hanging.

instead of scattering disable_thumbnail() calls around, just
call set_visible(false) instead.

Fixes: 9ce79bcaa
2026-06-04 00:18:47 +02:00
NRK 31ee4f99e5 osc: only clear thumbnails when hiding
this currently disables thumbnail even on set_visible(true)
calls which was causing flickering due when scrubbing through
the timeline. only disable thumbnail when hiding the osc.

Fixes: 9ce79bcaa
2026-06-04 00:18:47 +02:00
arch1t3cht 20ec48b717 menu.conf: make quit-watch-later item name more user-friendly
The name "Quit watch later" is hard to understand for users that don't
already know about the quit-watch-later command.

For what it's worth, this does also have some downsides:

1. It makes the context menu even wider, since "Quit watch later" was
   already the longest option.
2. The meaning of the "Open > Watch later" option may now be slightly
   less obvious to users. But this option does not work by default
   anyway, so the user will need to read the manual either way before
   using this option.

But these are fairly minor issues.
2026-06-04 00:16:54 +02:00
verygoodlee 3d709c731c console.lua: take position indicator into account when calculating width
sometimes the position indicator takes up a large portion of the input area, leaving almost no space for input.
2026-06-04 00:16:23 +02:00
Kacper Michajłow bdbeecbc11 demux_lavf: select non-empty edition by default
Some files, that are stripped from programs without edition program
table expose all old programs, that are not usable. Try to select the
one that actually has tracks.

Fixes: https://github.com/mpv-player/mpv/issues/18053#issuecomment-4607524402
2026-06-03 18:56:23 +02:00
Kacper Michajłow 7ae4846c17 player/misc: rate limit taskbar progress update rate
Rate-limit progress-only updates. The win32 backend forwards these to
the shell (explorer.exe), we don't want to spam it too much to avoid
performance issues, when stealing cpu time from the shell thread. In
normal playback, this doesn't update at all, but in live streams the
duration can change, even on every frame.

Fixes: #18053
2026-06-03 18:56:05 +02:00
Kacper Michajłow 448de741f9 DOCS/compile-windows.md: update guide to mention missing pieces 2026-06-03 05:06:14 +02:00
Kacper Michajłow 02273e9d9e ci: fix comment workflow permissions
We are commenting on pull requests.
2026-06-02 12:05:07 +02:00
Kacper Michajłow ad119d9dc9 stream_curl: expose redirect location to lavf
Some demuxers like DASH and HLS, query the location through the
"location" av option, this is how http.c in lavf exposes it. Respect
this interface and expose effective url.

Fixes: https://github.com/mpv-player/mpv/pull/18044
2026-06-02 08:36:21 +02:00
Kacper Michajłow 18d38d4f3e demux: don't mark mid-stream cache ranges as BOF
queue->is_bof is set optimistically after a seek to start, assuming
demuxing began at the start of the file. That is wrong for streams
opened mid-content, which can happen in unfinished event HLS playlists,
which starts at live-edge, but the seekable range in the past is still
valid.

For full support this also require change in lavf [1] to fix the overall
duration of the stream and seeking.

[1] https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/6d98a9a2e8757d6eb616501ade06877389a31597

Fixes: #11990
2026-06-02 08:35:31 +02:00
Kacper Michajłow 1c29507822 ci/msys2: workaround crashing whisper.cpp after unload
When FFmpeg is built with whisper.cpp, the libmpv-lifetime test fails
with `GGML_ASSERT(prev != ggml_uncaught_exception)`. Avoid this by
disabling the problematic backtrace code.
2026-06-02 02:11:07 +02:00
Kacper Michajłow f5d4d9b029 swresample: pass input layout in mpv's order via custom channel order
Drop the swr_set_channel_mapping() + transpose_order() + reorder_in[]
plumbing. Instead, build the swr input channel layout directly from the
mpv chmap as AV_CHANNEL_ORDER_CUSTOM, so the labels in the layout already
match the positions of the channels in the input data.

For all unknown map, we return all UNSPEC, so the swr expands to default
layout for this channel number.
2026-06-01 16:53:48 +02:00
Kacper Michajłow 43a2d9ac0d swresample: remove dead fudge_layout_conversion
Since 9ef614d6a3 this helper has been a no-op. fudge_layout_conversion()
returned the modified uint64_t channel-layout bitmask, but the new
AVChannelLayout path builds out_layout from the unfudged out_lavc and
feeds that to swr.

Even when it was wired up, libswresample handles the BL/BR <-> SL/SR
mapping if needed. SDL/SDR is not currently handled, but I would rather
patch the swr/rematrix.c for those too, instead of having custom glue
here.

Note that SDL/SDR are not that common in-practice.
2026-06-01 16:53:48 +02:00
Kacper Michajłow f239c2dd76 demux_lavf: migrate to AVStreamGroupLayeredVideo 2026-06-01 12:28:16 +02:00
Chainik 44a9b03f24 vf_vapoursynth: improve backward compatibility
The previous commit to dynamically load VapourSynth R74 would fail to work
for VapourSynth R73 and before on Linux due to load mode RTLD_LOCAL. To
make it work on all VapourSynth version, switch to use RTLD_GLOBAL mode.
2026-05-31 18:16:18 +02:00
Chainik 3650c67b6d Revert "vf_vapoursynth: improve backward compatibility"
This reverts commit 8aabba933b.
2026-05-31 18:16:18 +02:00
Ricardo Fonseca 74271a7d80 sub/sd_ass: subtitle timing rounding errors
Use floor(pts * 1000 + 1e-6) instead of llrint() for all timestamp
conversions to avoid floating-point precision errors causing early
subtitle presentation on boundry frames.

Fixes: #17453
Signed-off-by: Ricardo Fonseca <ricardofonseca94321@tecnico.ulisboa.pt>
2026-05-31 03:29:50 +02:00
Kacper Michajłow 13a3e3ad0e stream_curl: log user friendly message when TLS verification fails 2026-05-28 20:14:35 +02:00
Kacper Michajłow ee3d72ce02 options: enable tls-verify by default
We shouldn't default to no verification in current year. User can
opt-out if needed.

Keep it disable for builds without libcurl when libavformat is older
than 63.0.100. This is done to match ffmpeg's timeline for enabling
tls_verify by default in lavf, also to ensure we the default verify
locations will be loaded on such version.
2026-05-28 20:14:35 +02:00
Kacper Michajłow ca89a744c9 stream_curl: tell libcurl to use the native CA store
This is independent of other CA certificate locations set at run time or
build time. Those locations are searched in addition to the native CA
store.
2026-05-28 20:14:35 +02:00
llyyr cce65c722c wayland: map ICtCp coefficients to BT.2100 HLG as well
H.273 defines a single ICtCp matrix coefficients for both BT.2100 PQ and
HLG.
2026-05-27 15:21:19 +02:00
Philip Langdale d05814ceef hwdec_vulkan: fix partial failure edge cases in error paths
This is another file where the slopbot identified a problem, but I was
surprised to see it fix it in a poor way and also miss an adjacement
problem.

`mapper_map` calls `mapper_unmap` with the intention of using it to clean
up partial failure after some planes are wrapped and released while others
are not. But the current code would actually segfault in that situation.

There are two fixes required:

* Ensure `p->vkf` is set by `mapper_map` early so that its available to
  `mapper_unmap` in the error path
* Don't call `vkfc->unlock_frame` in the `mapper_map` error path, as
  this will be called by `mapper_unmap`

Fixes #17977
2026-05-26 18:22:04 -07:00
Philip Langdale 89b95243ef hwdec_cuda: fix partial failure edge cases in error paths
The slopbot spam did find valid issues in the error paths in this code, and as
part of verifying them, I have additional fixes.

* ensure that the return value -1 from `cuda_init()` if `ext_init()` fails
* zero alloc the `ext_vk` and `ext_gl` structs so that we have a known initial
  state
* explicitly initialise the `sem_handle.fd` to -1 to ensure we don't
  accidentally close stdin in the error path. But also don't do this on
  windows as an invalid Handle is 0.
* Don't do a double `cuCtxPopCurrent()` in the `ext_gl` init failure path

Fixes #17976, #17988, #17989
2026-05-26 18:22:04 -07:00
Kacper Michajłow 427e4bf25d stream_curl: support offset/end_offset passed in AVDictionary
lavf's http demuxer exposes initial/final byte offsets as AVOptions.
Some demuxers, like lavf/hls.c assume it is always available, even for
custom IO. We need to use those values for correct demuxing.

Fixes: https://github.com/mpv-player/mpv/pull/17879#issuecomment-4468476976
2026-05-26 19:32:02 +02:00
dependabot[bot] 1ac687d791 ci: bump cross-platform-actions/action from 1.0.0 to 1.1.0
Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v1.0.0...v1.1.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-24 15:59:02 +02:00
llyyr 9e06c3248a ao_pipewire: avoid passing NULL to mp_msg 2026-05-22 17:51:57 +00:00
llyyr 1a78f9fa8e ao_pipewire: avoid deadlock when starting thread loop
loop_start starts a thread which immediately acquires the thread loop
lock. Locking the loop before loop_start can therefore deadlock the
newly created thread during initialization.

Locking the thread loop before loop_start was always incorrect, but
Pipewire commit fb49e0795c28* made the issue visible by switching
pw_thread_loop_lock to the underlying SPA loop lock.

To fix this, we just avoid starting the loop until after we're connected
to the server.

* https://github.com/PipeWire/pipewire/commit/fb49e0795c28c892116b03369785ba86c27c968d
2026-05-22 17:51:57 +00:00
Kacper Michajłow db73857997 ytdl_hook.lua: map ass/srt subtitles 2026-05-21 21:47:45 +02:00
llyyr d521821573 demux_cue: fix audio file lookup inside subdirectory
The FILE field in a CUE sheet may contain a relative path with
subdirectories. It's not clear if this usecase is intended to be
supported, as none of the usual CD/DVD ripping tool generates this type
of FILE field in the CUE sheet. The specification is old and abandoned,
so this will likely never be clarified and it doesn't cost much to
support it so might as well...
2026-05-20 23:22:18 +02:00
Guido Cella 6eaf35866c command: add support for printing sub-lines
show-text ${sub-lines} can be used to print subtitle lines around the
current one and have them hide automatically.
2026-05-20 23:21:49 +02:00
NRK 59c91def55 osc: add back hover-sec in draw-preview
this was initially part of draw-preview but was later moved to a
separate property because it was deemed useful outside of just
thumbnail preview. however this causes bugs when a thumbnailer
observes draw-request and the draw rectangle doesn't change (e.g
due to getting clamped around the border).

add back hover-sec which makes the draw-request more self
contained and removes this footgun.

Fixes: https://github.com/mpv-player/mpv/pull/17518#discussion_r3256017469
2026-05-20 23:17:17 +02:00
Guido Cella 3d111fbf1e demux_libarchive: apply --directory-filter-types to files in archives
Fixes #17931.
2026-05-20 23:15:44 +02:00
Mikael Magnusson 7d603534de msg: don't allow any escapes in --term-title
Unlike --term-playing-msg, the --term-title string is printed in an
escape sequence already. If we print other escapes during this sequence,
it will abort the sequence and dump the rest of the title string as a
visible string to the user, and possibly beep as well, since the title
string can end with a bel character.

Also updates the manpage to remove a comment about win32, since
terminal-win.c does handle OSC title sequences, calling SetConsoleTitleW.
2026-05-20 10:56:08 +02:00
Mikael Magnusson 5f5839aadb video/out/x11_common: set the source indication to 1 in vo_x11_minimize
This was the only call that didn't do this.
2026-05-20 10:55:59 +02:00
Mikael Magnusson c0ef68904d video/out/x11_common: add --focus-on support in X11
Note that when the video params don't change, the check in
player/video.c does not call vo_reconfig2 and the _NET_ACTIVE_WINDOW
message is not sent. As far as I can tell, the same limitation is true
for the macOS implementation, but I can't test that.
2026-05-20 10:55:59 +02:00
Lynne 4c72a03546 video/decode: enable APV hwdec by default
Today, FFmpeg got an APV decoder written in Vulkan compute shaders.
2026-05-20 10:55:48 +02:00
sfan5 1fe37856cb ci: fix comment workflow permissions 2026-05-19 18:54:30 +02:00
Lynne 98c3ae4add vulkan/context: don't activate descriptor buffers after ffmpeg 8.1 2026-05-19 17:35:08 +02:00
Lynne 873a1e8a24 vulkan/context: activate runtime array indexing and non-uniform accesses
We use them everywhere in Vulkan in FFmpeg now.
2026-05-19 17:35:08 +02:00
llyyr a16b333eef meson: bump libcurl minimum version to 7.87.0
CURL_WRITEFUNC_ERROR is only avaialble from 7.87 onwards
2026-05-19 15:55:13 +02:00
sfan5 8fc1a10a44 ci: fix necessary permissions for cleanup_caches and comment
This undoes de5edca29c,
because I failed to read the documentation.
2026-05-18 21:13:09 +02:00
sfan5 de5edca29c ci: clarify that cleanup_caches and comment don't use token permissions 2026-05-18 20:53:29 +02:00
Clinton Phillips 35ae76daad docs/comments: fix more doubled-word typos
Follow-up to #17926, addressing the four additional instances flagged
by @garoto:

- DOCS/man/options.rst: "output size size is limited" -> "output size is limited"
- DOCS/man/input.rst: "Called after after a file" -> "Called after a file"
- video/out/gpu/video.c: "target target that needs to be written" -> "target that needs to be written"
- video/out/x11_common.c: "enable DPMS only we we disabled it before" -> "enable DPMS only if we disabled it before"
  (this one wasn't a pure duplicate — the first "we" was a typo for "if"; the comment now matches the conditional on the line above)
2026-05-18 16:47:14 +02:00
Kacper Michajłow 059bc7025b stream_curl: disable by default on libavformat < 62.15.101 2026-05-16 18:20:42 +02:00
Kacper Michajłow 724b76fe0a stream_curl: add --curl-enabled option 2026-05-16 18:20:42 +02:00
Kacper Michajłow f7e0fd8f0e meson: add curl to summary 2026-05-16 18:20:42 +02:00
Kacper Michajłow 9a9c890e23 stream_curl: use for ftp/ftps
It's significantly more stable than Lavf. Fixes seeking out of cached
ranges. Additionally correctly marks demuxer_is_network for ftp too.
2026-05-16 18:20:42 +02:00
Kacper Michajłow 4dc772c429 stream: don't drop data on stream_read_more
At the initial file open, the buffer may be populated with more data,
than later requested by decoder, but don't drop this data. This fixes
initial open to perform multiple reads of the area, especially for
images that are likelly fully read for probbing already.
2026-05-16 18:20:42 +02:00
Kacper Michajłow 0ae2214a7a ytdl_hook.lua: use the new curl-max-request-size option if needed
This is for stream_curl.
2026-05-16 18:20:42 +02:00
Kacper Michajłow 332764d909 stream_curl: build protocol list based on libcurl state
Allow only subset of supported protocols by libcurl.
2026-05-16 18:20:42 +02:00
Kacper Michajłow b14d8f5ee1 demux_lavf: route nested HTTP opens through the curl backend
Hook AVFormatContext.io_open so HLS/DASH segment fetches and other
nested FFmpeg I/O go through stream_http when libcurl is available.
This lets segments inherit the connection reuse, HTTP/2 multiplexing,
mid-stream resume and conditional compression of the top-level stream.

Falls back to FFmpeg's default I/O for non-HTTP URLs and when the curl
backend is not built in.
2026-05-16 18:20:42 +02:00
Kacper Michajłow f658223abb stream_curl: allow reading cookies not only from a local file 2026-05-16 18:20:42 +02:00
Kacper Michajłow c6833a9307 stream_curl: add libcurl-based stream backend
Introduces stream_http, an internal libcurl-driven backend for http://
and https:// URLs. Runs all transfers on a dedicated curl multi thread
with a producer-side ring buffer, and exposes HTTP/2 multiplexing,
QUIC/HTTP/3 (when libcurl supports it), HSTS and TCP keep-alive.

Should generally be more stable and faster than FFmpeg HTTP/1.1 impl,
additionally connections are kept-alive between files open, so if you
open playlist of network files and navigate through them, it will re-use
the same connection.

Build is gated on the new 'libcurl' meson option (auto). When disabled
or unavailable, mpv silently falls back to FFmpeg's HTTP implementation.
2026-05-16 18:20:42 +02:00
Kacper Michajłow 5936572e1e ci/build-win32.ps1: disable libpsl tests build 2026-05-16 18:20:42 +02:00
sfan5 ea12f8efc8 ci/mingw: add libcurl 2026-05-16 18:20:42 +02:00
Kacper Michajłow f90dfd033f ci: install curl 2026-05-16 18:20:42 +02:00
Kacper Michajłow cdd3f1197f stream: split shared network options into their own sub-options
Will be useful for future commits
2026-05-16 18:20:42 +02:00
Kacper Michajłow 96ade17428 options: fix stream_lavf options struct name 2026-05-16 18:20:42 +02:00
Kacper Michajłow 6017d1fd1c ytdl_hook.lua: write cookies via cookies-file instead of stream-lavf-o
stream-lavf-o[cookies] only feeds the lavf stream backend. Instead of
side-loading it, use core `--cookies-file` option.
2026-05-16 18:20:42 +02:00
Kacper Michajłow 893313e5af stream/cookies: allow reading cookies not only from a local file 2026-05-16 18:20:42 +02:00
Clinton Phillips 779378c248 docs/comments: fix doubled-word typos
Pure typo fixes in user-facing manpages, interface changelog, and
source comments. No behavior change.

- DOCS/man/encode.rst: "copying of the the comment" -> "copying of the comment"
- DOCS/man/options.rst: "visible takes the the menu bar" -> "takes the menu bar"
- DOCS/interface-changes.rst: "rename the the lua-settings/" -> "rename the lua-settings/"
- video/out/present_sync.c: "requires that that caller" -> "requires that the caller"
- player/lua.c: "try to get by by filtering" -> "try to get by filtering"
2026-05-16 05:26:02 +02:00
Kacper Michajłow 4498c0ff81 ci/build-win32.ps1: bump ffmpeg to 8.1 branch 2026-05-15 00:40:17 +02:00
llyyr f4d059b1d9 vd_lavc: disallow hwdec for grouped streams
44a2c33939 tried to do this in a cute way by unsetting the hwdev to
be used for hwdec, but this doesn't prevent -copy variants from being
probed. Instead explicitly disallow it for grouped streams
2026-05-13 22:24:07 +02:00
sfan5 7b70999b62 ci/mingw: cache tar downloads 2026-05-13 20:45:41 +02:00
llyyr 914114a2cf wayland: fix typo 2026-05-13 15:28:29 +00:00
llyyr 02b4f8ca69 wayland: remove stray spaces before function call parenthesis 2026-05-13 15:28:29 +00:00
llyyr 90f63675ce wayland: return bool values for bool type create_input function
Also invert the return value to better match the rest of the file, and
adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr bef4dc37db wayland: convert create_xdg_surface to bool
create_xdg_surface returns success/failure, so use bool instead of int
for its return type. Also invert the return values to better match the
style of the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr ff2d112132 wayland: convert create_viewports to bool
create_viewports returns success/failure, so use bool instead of int for
its return type. Also invert the return values to better match the style
of the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr e92538b1db wayland: convert spawn_cursor to bool
spawn_cursor returns success/failure, so use bool instead of int for its
return type. Also invert the return values to better match the style of
the rest of the file, also adjust callers accordingly.
2026-05-13 15:28:29 +00:00
llyyr d28bc02393 wayland: convert check_for_resize to bool
Only returns if a resize edge was found
2026-05-13 15:28:29 +00:00
llyyr ae811ddbbb wayland: log current preferred scale, not older stale one 2026-05-13 15:28:29 +00:00
llyyr 6c34c07b36 wayland: null-check before munmap call
munmap(NULL, 0) returns a failure, also this follows project style
2026-05-13 15:28:29 +00:00
llyyr db4506be45 wayland: fix resize edge boundary checks
The `>` checks exclude a pixel, which is asymmetric with the `<` checks.
Use `>=` for the right and bottom resize edge checks, to not skip a
pixel.
2026-05-13 15:28:29 +00:00
llyyr 3a5e05720e wayland: fix condition for tablet tool cursor shape device destroy 2026-05-13 15:28:29 +00:00
llyyr 0be060ed76 wayland: fix mapping for PAL/NTSC primaries
525 lines is NTSC, 625 lines is PAL. Previously we had them reversed.
2026-05-13 15:28:29 +00:00
Kacper Michajłow 37f4edffaf f_output_chain: don't lose EOF frame on filter failures 2026-05-13 15:44:03 +02:00
Guido Cella 631cdd3622 select.lua: preserve empty subtitle lines
Fixes e9fbf49466.
2026-05-13 15:43:38 +02:00
llyyrandGuido Cella 44a2c33939 f_decoder_wrapper: disable non-copy hardware decoding for stream groups
This allows playing tile grid images without manually disabling hardware
decoding. There is no other type of stream group known to support
hardware decoding so far.

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-05-13 14:55:48 +02:00
Guido Cella aa57714b63 video: merge the tiles of grid heif and avif images
Fixes #13585.
Fixes #14982.
Fixes #16486.
2026-05-13 14:55:48 +02:00
Kacper Michajłow c3f8acc10f f_decoder_wrapper: add support for N -> 1 stream merging
This allows to spin N decoder of dependent streams, and merge them in
single output using a filter. Currently only lavfi is supported, and
should be set as a string in the stream group definition.

In the future more advance merging can be implemented in place of lavfi,
but the grouping of the streams should be similar.

This will be useful for tile merging or LCEVC style enchantment support.
May even be useful for DV EL, but this is often not a separate track.
2026-05-13 14:02:10 +02:00
Kacper Michajłow 8c76342a52 demux: select all tracks represented by the stream group 2026-05-13 14:02:10 +02:00
Kacper Michajłow 1095d85b51 demux/stheader: add sh_stream_group representing stream group 2026-05-13 14:02:10 +02:00
Kacper Michajłow cdf77d9274 vo_gpu_next: always cache frames in paused state and never interpolate 2026-05-13 11:22:09 +02:00
Kacper Michajłow 0c4ad9adf6 vo_gpu_next: respect interpolation-preserve option for cache flush
Flush cache only if interpolation-preserve is off, or in paused state to
get immediate update.

Fixes unnecessary cache flushes when parameters of external hooks are
updated rapidly.
2026-05-13 11:22:09 +02:00
nanahi 21351a0580 options/m_property: only get m_option info when needed
Micro optimization.
2026-05-12 21:39:34 +02:00
nanahi f98b114d58 options/m_property: use mp_require for log
log cannot be null on write path which is true for multiply and switch.
2026-05-12 21:39:34 +02:00
nanahi ae23198144 options/m_property: simplify m_property_multiply/m_property_switch
M_PROPERTY_GET_CONSTRICTED_TYPE is already acquired, just pass m_option
directly.
2026-05-12 21:39:34 +02:00
nanahi 6320792f1b options/m_property: try to get constricted type in m_property_do
When setting properties via M_PROPERTY_SET_NODE, the property value
is limited by static declared range. However, some properties like
volume handle dynamic M_PROPERTY_GET_CONSTRICTED_TYPE requests and
return runtime determined limits. M_PROPERTY_SET_NODE in this case
does not respect that limit, and allows setting to a value out of
range.

Fix this by always trying to use M_PROPERTY_GET_CONSTRICTED_TYPE
first so that the dynamic limits will be used.
2026-05-12 21:39:34 +02:00
nanahi 27ec68fbd8 options/m_property: add log null check to m_property_multiply
Similar to m_property_switch, cannot be null for write paths.
2026-05-12 21:39:34 +02:00
nanahi 13550bd31d options/m_property: extract m_property_switch to a function
Similar to m_property_multiply.
2026-05-12 21:39:34 +02:00
Kacper Michajłow c411c6ea68 f_decoder_wrapper: output EOF when decoder is unavailable
When decoder is not available or failed to initialize, just signal EOF
and allow player to close, instead of spinning waiting for frame that
will never arrive.
2026-05-12 14:13:05 +02:00
Kacper Michajłow 6bdacac991 player/loadfile: fix stack-overflow on EDL metadata track
demux_edl allocates metadata track with type set to STREAM_TYPE_COUNT,
when counting track types this was not accounted for. Make room for this
"special" type of track. Add asserts while at it, just in case.

Note that other similar uses are gated behind track->selected, and
metadata track will never be marked as one.

This is not exploitable, as it was overriding only one integer value past
the allocated array, so worse thing that could happen is that we
misbehave during track selection or crash.

Side note, OSS-Fuzz was fuzzing this for few years now, and couldn't dig
into this specific case. I've validated that our fuzzer is in fact
reproducing this issue when provided the testcase, which I belive was a
basis for this report.

Fixes: GHSA-qpf4-42gw-f286

This vulnerability was discovered by Claude, Anthropic's AI assistant,
with OSS-Fuzz fuzzing and triaged by Ada Logics manually in
collaboration with Anthropic Research.
2026-05-12 13:09:22 +02:00
Guido Cella 7732c305a5 osc.lua: hide 0 duration
Restore the behavior before 3183ea99.
2026-05-12 00:06:35 +02:00
Guido Cella 8674222927 input.conf: make rotate keybindings repeatable
Needed because --video-rotate is OPT_CHOICE.
2026-05-10 20:46:31 +02:00
Hubert Głuchowski bba7c53a29 sub/sd_sbr: implement get_lines 2026-05-10 00:39:41 +02:00
Hubert Głuchowski a0ff557459 sub/sd_sbr: implement get_text 2026-05-10 00:39:41 +02:00
sfan5 003c5433f6 ci/mingw: switch to zlib-ng
gotta go fast
2026-05-10 00:02:19 +02:00
sfan5 373cfc6924 ci/mingw: refactor tar downloading 2026-05-10 00:02:19 +02:00
nanahi 7b057f66fa DOCS/man/mpv: add usage hint alternative for pseudo-gui profile
This has been deprecated for 9 years since
9eef41dec1.
With the previous commit, this can be replaced by conditional autoprofiles.
Add usage hint to the documentation.
2026-05-09 15:01:09 +02:00
nanahi ed2e55b941 options: make player-operation-mode readable as a property
Make it readable as a property so that scripts and conditional
autoprofiles can customize behavior depending if player is
launched as pseudo gui mode.
2026-05-09 15:01:09 +02:00
llyyr 4414547d62 wayland: use lrint for keepaspect window sizing
Avoid biasing sizes upwards
2026-05-09 14:50:17 +02:00
llyyr 1a1288184a wayland: force redraw on every configure when in toplevel resize state
This fixes stalled/slow resize when there's only an image being
displayed or no output at all. When there's a video playing, the video
implicitly causes a redraw but we need to redraw ourselves when there's
no video.

Fixes: https://github.com/mpv-player/mpv/issues/16744
2026-05-09 14:50:17 +02:00
sfan5 24fbc99701 ci/mingw: some small cleanups and updates
Note: zlib 1.3.2 breaks with -Werror=undef, so we don't update it.
<https://github.com/madler/zlib/issues/1169>
2026-05-09 12:07:53 +02:00
Guido Cella e9fbf49466 select.lua: split multi-line subtitles
Before 77ed8fef88 texts with multiple lines were split to multiple
items, after it only shows the text before any newline.

Split lines again.
2026-05-09 09:56:13 +02:00
Kacper Michajłow e0eb42c303 demux: add --demuxer-hysteresis-bytes
Fixes: https://github.com/mpv-player/mpv/discussions/17888#discussioncomment-16852506
2026-05-08 17:27:13 +02:00
Kacper Michajłow 09900a0ff0 demux/packet_pool: incrementally free old packets on pop
Until now the pool only released its packets on shutdown or when the
cache size was reduced at runtime, so it kept growing across a session.
The amount of packets would be indirectly bound by demuxer cache size,
else the packets are reused. Still over long playback or switching
files, this may give impression of elevated memory usage, or even memory
leak. This was particularly visible with cache-on-disk, where users
reasonably expect RAM usage to stay low.

Pop now keeps the first POOL_HOT_RESERVE packets at the head of the
freelist for fast reuse, and frees up to POOL_GC_BATCH packets from
beyond that on each call. Bulk pushes (e.g. cache reset on file end)
remain no-work policy. The pool drains across subsequent allocations
rather than stalling on a single huge free. Self-balancing without any
size tracking.

This drains the pool in steady state. Note that on file switch we
effectively reuse only ~N / POOL_GC_BATCH packets from the old cache,
because each pop reuses just one packet while freeing up to
POOL_GC_BATCH. That's fine, both free and alloc calls are throttled to
the same per-pop rate, so allocator pressure stays bounded even though
not all packets get reused.
2026-05-08 14:43:36 +02:00
Kacper Michajłow 2c8f449f1e ci/build-win32.ps1: update shaderc patch 2026-05-08 12:06:25 +02:00
Kacper Michajłow 4d944b2fad ytdl_hook.lua: remove track selection hack
This breaks HLS bitrate selection, as it uses track metadata in place of
HLS bitrate, which are most of the time different things.
2026-05-07 18:59:08 +02:00
Kacper Michajłow 8c26c0c1e9 TOOLS/matroska.py: plumb some type hints to make new mypy happy
We don't use strict mode still, so only few are typed.
2026-05-07 14:29:04 +02:00
Kacper Michajłow cfd818bcae ra_gl: fix memory leak 2026-05-05 20:17:24 +02:00
Kacper Michajłow 333857403f test/libmpv_common: wait for all clients and player to be destroyed
mpv_destroy() only detaches the client, while leaving the player alone.
Since this is exit cleanup, we should just wait and quit whole player.
2026-05-03 20:26:40 +02:00
llyyr 948c86d24c player/lua: fix autofree ctx leak on exit() call
Fixes LSAN leak when tests call fail() and exit(1) is called. We have
mpv_destroy set for atexit but data.ctx was null parented, so it had no
parent to be freed by. Parent it to script_ctx instead so it gets
cleaned up by mpv_destroy.

LSAN output:

Direct leak of 400 byte(s) in 5 object(s) allocated from:
    #\0 0x7f4c6c52c01f in malloc (/lib64/libasan.so.8+0x12c01f) (BuildId: db0aa5bf57ed53a5869a3a2cc49051292ceb6390)
    #\1 0x7f4c6b276388 in ta_alloc_size ../ta/ta.c:139
    #\2 0x7f4c6b2bf01f in script_autofree_trampoline ../player/lua.c:1310
    #\3 0x7f4c69373b15  (/lib64/libluajit-5.1.so.2+0xbb15) (BuildId: 182622c63dea3dd74173bbd5a810051a76bcf4d9)
2026-05-03 17:25:17 +02:00
Ivan Shapovalov ce71cd8aeb mp_image: refine check for supported Dolby Vision metadata
Improve the Dolby Vision metadata check to accept RPUs that indicate EL
usage (profiles 4 and 7) if the original bitstream and metadata are
MEL-only, instead of hardcoding a check for disable_residual_flag.

This needs libplacebo commit a4783f89 ("util/libav: do not bail on
MEL-only RPUs w/EL"), or libplacebo API version 359.
2026-05-03 11:49:47 +02:00
Kacper Michajłow 7c25b3e47c vo_gpu_next: fix upload synchronization
And make them actually async when copied from host ptr. The issue was
when we used DR buf upload, which is always async, it was not
synchronized in anyway.

Fixes: #13811
2026-05-03 08:47:34 +02:00
llyyr d8be86067c ao_pulse: fix subscribe_cb using wrong bitmask for event type
PA_SUBSCRIPTION_MASK_SINK is a pa_subscription_mask constant used when
registering with pa_context_subscribe(), not a
pa_subscription_event_type mask. Masking the event type with it would
never match PA_SUBSCRIPTION_EVENT_NEW or PA_SUBSCRIPTION_EVENT_REMOVE,
causing hotplug events to be silently dropped.

Fixes: e01750020d
2026-05-03 06:44:37 +02:00
nanahi 5e847889b3 osdep/win32/smtc: fix client handle leak 2026-05-01 13:42:57 +02:00
nanahi 0ec3015339 player/external_files: remove handling related to update sub exts
This is only used to update the list for player internal sub ext matching.
Since this handling now lives in the dnd client, it can be removed from
core, which also eliminates a global variable.
2026-05-01 13:42:57 +02:00
nanahi 675fb1229b input/dnd: move --drag-and-drop handling to dnd client
This unifies --drag-and-drop handling to a single place. All platforms
currently only support normal drop (mapped to "replace") and shift click
drop (mapped to "append").
2026-05-01 13:42:57 +02:00
nanahi 81611b4a4e input/dnd: move built-in drag and drop handling to mpv client
This moves the drag and drop handling to an internal mpv client,
removing the hardcoded handling from core.
2026-05-01 13:42:57 +02:00
nanahi 87ccb6022c command: add dropped-file property
This adds dropped-file property which contains a list of dropped files
and the type of the drop. This allows clients to implement custom drag
and drop handling.
2026-05-01 13:42:57 +02:00
nanahi e12ab84571 input: add --input-builtin-drag-and-drop option
This allows disabling the built-in drag and drop handler, while still
allowing VO to announce dropped files.
2026-05-01 13:42:57 +02:00
nanahi 544a56a148 input: rename notify_touch_update to notify_event_update
Will also be used to notify dnd updates.
2026-05-01 13:42:57 +02:00
nanahi 41fb7f9eb2 command: use string list helper for option-info 2026-05-01 13:42:57 +02:00
nanahi 777401d7de options/m_property: add SUB_PROP_STRING_LIST
Helper used in next commits.
2026-05-01 13:42:57 +02:00
nanahi 5e0932e785 input: rename mp_event_drop_files to mp_input_drop_files
Move it to input.c. Will be used in next commit.
2026-05-01 13:42:57 +02:00
Kacper Michajłow cdbe01c3db demux_lavf: add support for stream groups
Currently none of them are fully supported, but at least mark dependent
tracks as such.
2026-05-01 11:44:26 +02:00
Kacper Michajłow c0c7584342 etc/builtin.conf: change gui mode to idle=yes
It is more expected from GUI application to stay open, even after
playback. Additionally this gives user a chance to inspect possible load
failures, while previously mpv would disappear.
2026-05-01 11:42:04 +02:00
Kacper Michajłow dc59f3b399 test/libmpv_test_track_selection: add test for program mappings 2026-05-01 11:41:31 +02:00
Kacper Michajłow bf1a14e541 test/libmpv_common: print property in checks 2026-05-01 11:41:31 +02:00
Kacper Michajłow f5857d3b87 demux_lavf: support multiple program mappings per stream
Each stream can belong to multiple programs, we have to support that.
Previously track could belong only to single program.
2026-05-01 11:41:31 +02:00
Kacper Michajłow 28ce461a84 options/m_option: add m_option_type_prop_array
Add adaptor for arrays of properties, this is not used as real option,
as those are always string list. But as a connector struct for creating
typed node arrays, in (sub)_properties.
2026-05-01 11:41:31 +02:00
Kacper Michajłow eedadc24ae player/command: hide dependent tracks
They are unusable on thier own, and shouldn't be selected by the user.
Those tracks are ment to be used internally.
2026-05-01 10:42:00 +02:00
Kacper Michajłow 0c067f140e test/libmpv_test_track_selection: add test for --flatten-editions 2026-05-01 10:42:00 +02:00
Kacper Michajłow b4a7ea306e demux_{lavf,timeline}: add --flatten-editions
Lavf exposes programs/renditions as a flat track list tagged with
program_id. We respect this metadata and group tracks into their
respective programs, as tracks from different programs may be completely
unrelated to each other.

This commits adds an option to flatten the editions and ignore the
grouping.

Fixes: https://github.com/mpv-player/mpv/issues/17836#issuecomment-4345930205
2026-05-01 10:42:00 +02:00
Kacper Michajłow 44ceaa6498 vo_gpu_next: only flush cache on render options update
No need to reset input queue too.
2026-05-01 10:41:41 +02:00
Kacper Michajłow 8d04be2b85 mp_image: force stride to be multiple of bpp
Vulkan require all sizes in texels, so we have to make our image
multiple of them.

Fixes: #17743
2026-05-01 10:41:28 +02:00
Kacper Michajłow 8aef2c9162 demux_lavf: map comment to stream title
Lavf HLS demmuxer put rendition names into `comment`, this is basically
a title in our usage.
2026-05-01 06:09:27 +02:00
Kacper Michajłow ec03ef7e97 demux_lavf: remove track flags duplication from title
Those flags are already exposed, and users can format it as they wont.
Don't produce some dummy titles.
2026-05-01 06:09:27 +02:00
llyyr a44478d79f vulkan/context: avoid printing incorrect error on vulkan-device fail
M_OPT_INVALID says "option parameter could not be parsed" which is
incorrect for some failures this parser might encounter. Instead print
something that might be useful for the user to debug.

Vulkan instance might fail to create if there's no vulkan drivers that
mpv can see, or devices might fail to enumerate for whatever reason
2026-05-01 06:09:00 +02:00
Kacper Michajłow 48bd97b5bb stream_dvdnav: don't leak times in STREAM_CTRL_GET_CHAPTER_TIME 2026-05-01 05:01:37 +02:00
Kacper Michajłow 4182a1df43 stream_dvdnav: use named definition for return val 2026-05-01 05:01:37 +02:00
Kacper Michajłow 118dda68c1 stream_dvdnav: fix STREAM_CTRL_SET_ANGLE return value
It was flipped and returned ok on error.
2026-05-01 05:01:37 +02:00
Richasy 986dd6387d ao_wasapi: fix retry budget on DEVICE_INVALIDATED
The retry path in wasapi_thread_init() used MP_TIME_US_TO_NS, giving a
total budget of ~15 us before MP_FATAL killed the audio thread. The
resulting log line "Retrying in 1000 ns" makes the unit confusion
obvious.

In practice AUDCLNT_E_DEVICE_INVALIDATED is most often hit right after
the system resumes from sleep, or when the default endpoint changes,
where the audio endpoint typically needs hundreds of milliseconds to
come back. The current budget never covers that window, so the first
playback after wake-up permanently fell back to "no audio" until the
user manually restarted playback.

Switch the retry schedule to milliseconds: start at 1 ms (~one Windows
timer tick, effectively an immediate yield), multiply by 10 each
iteration, and cap at 1 s -- i.e. 1/10/100/1000 ms, 4 retries, ~1.1 s
total. Use MP_TIME_NS_TO_MS for the warning so the unit in the log
matches reality.
2026-05-01 05:01:00 +02:00
Kacper Michajłow 2f58ee36ce demux/packet: refactor demux_packet_add_blockadditional
Make it more extensible for future additions.
2026-05-01 00:38:04 +02:00
Kacper Michajłow 696190d25b demux/packet: add support for LCEVC ITU-T35 payloads 2026-05-01 00:38:04 +02:00
Dudemanguy b1d23bba5e vo_gpu_next: don't spam render queue underrun logs on frame->still
If we are redrawing on a still image (e.g. ass events), then the pl
queue will hit the PL_QUEUE_MORE case which is fine but there's no need
to spam the log here. The information may be useful for when an actual
video is being played, but when a frame is still (e.g. paused or only a
single image) it's just noise.

Fixes #17840.
2026-04-30 15:01:34 +00:00
Kacper Michajłow 5ebe9581d5 demux_{lavf,timeline}: consider audio only HLS when selecting edition
Fixes: #17836
2026-04-29 19:23:42 +02:00
Guido Cella 0a0c63d3e9 ytdl_hook.lua: convert metadata values to string
Fixes https://github.com/mpv-player/mpv/pull/17805#issuecomment-4340090625
2026-04-29 11:32:19 +02:00
kamperemu 8cc65c838e osc.lua: add box width option for box and slimbox layouts
osc.lua: add slimbox width option and preserve width values for box slimbox

docs: update default box and slimbox width values in OSC configuration

docs: add `boxwidth` and `slimboxwidth` script options to osc
2026-04-29 07:22:14 +02:00
Kacper Michajłow 3e3936eee4 player/loadfile: filter tracks without edition when there are matches
When the current edition supplies its own track of a given type
(e.g. yt-dlp muxed editions ship their audio paired with the video),
shared program_id == -1 tracks of that type are filtered out of
both the track list and auto-selection. Editions that don't ship
their own track (DASH video-only editions sharing the audio pool)
continue to see the program-agnostic tracks.
2026-04-29 03:45:05 +02:00
Kacper Michajłow 4730c9179a player/loadfile: remove preferred_program from track selection
It's no longer needed, tracks from different editions are not listed
togheter anymore.
2026-04-29 03:45:05 +02:00
Kacper Michajłow 91b6d8fdd1 demux: enrich edition titles with codec/resolution/bitrate info
Extract the codec descriptor out of mp_format_track_metadata into a
shared demux_append_codec_desc() helper, and use it from a new
demux_compose_edition_title() composer that both demux_timeline.c and
demux_lavf.c call when building editions. Codec block is only added
when the program has exactly one stream of that kind, and fields
already present in the prefix (e.g. WxH from yt-dlp's format label)
are skipped to avoid duplication.
2026-04-29 03:45:05 +02:00
Dudemanguy a42b1b9103 wayland: only update toplevel state values if we have a valid state
We have this annoying situation here during the initial window
configuration where sometimes we have to update certain values and other
times they need to be ignored. 45324ce682
made sure to parse the toplevel state before we checked the initial
compositor values which is correct. But it's not enough because mpv can
have its own initial state (e.g. --fullscreen) and by moving it here it
would get overwritten in the toplevel state check and thus ignored. So
to have our cake and eat it too, we need to only update the internal
state values if we know mpv is in a valid state in the first place. So
either we've set the initial geometry already or the compositor has
given us some specific initial state to work with. Fixes #17819.
2026-04-27 14:39:05 +00:00
Guido Cella 05b327c723 osc.lua: use the cached chapter_list instead or retrieving chapters 2026-04-26 08:56:24 +02:00
Guido Cella ae3189567b select.lua: add select-secondary-subtitle-line
Requested in https://github.com/mpv-player/mpv/pull/17730#issuecomment-4321224996
2026-04-26 08:55:42 +02:00
Kacper Michajłow ed99433277 TOOLS/dylib_unhell.py: simplify the otool output processing
There is no need to pipe things through shell and grep/awk, python is
perfectly fine word processor. This makes it simpler to reason what is
extracted and from where and also makes the script faster as we spawn
only single process directly, not shell with multiple children.
2026-04-26 01:19:27 +02:00
Guido Cella 3183ea9980 osc.lua: always observe duration
Currently the duration observer is toggled in multiple places to not
call request_init unecessarily. It is much simpler to always observe it
and call request_init conditionally in the callback. This also allows
reusing the cached value throughout the OSC.

Note that dividing by 0 is not an error in Lua so there is no need to
check for both 0 and nil.
2026-04-26 00:20:33 +02:00
Guido Cella 9ce79bcaa0 osc.lua: hide thumbnails when setting visibility to never
And also when using script-message osc-hide.
2026-04-25 20:03:10 +02:00
Guido Cella 47a8a47b31 osc.lua: don't write to user-data on every render
Only update hover-sec when there is a big enough change to not spam the
log with -v.
2026-04-25 20:03:10 +02:00
Guido Cella 77ed8fef88 select.lua: use sub-lines instead of forking to ffmpeg
This:

- Removes the dependency of ffmpeg in PATH - useful on Windows, macOS
  (?), Flatpak.
- Will support subrandr.
- Avoids redownloading network subtitles.
- Avoids slow demuxing of large mkvs.
- But no longer returns future lines of embedded subtitles.
- No longer returns embedded lines of regions you seeked beyond without
  playing them.
- Changing sub track drops cached subtitles.
2026-04-25 19:58:52 +02:00
Hubert Głuchowski a0a0a7e4cf sub/dec_sub: de-duplicate overlapping sub lines 2026-04-25 19:58:52 +02:00
Guido Cella 5f02e1b8a2 sub: add sub-lines property
Return all subtitle lines in memory with text, start and end.

I did not name this sub-all so it cannot be misinterpreted as referring
to all subtitle tracks.

Closes #12810.
2026-04-25 19:58:52 +02:00
Kacper Michajłow c662594f05 Revert "player/core: increase number of past_frames to 1000"
100 is enough and avoids mistimed frames to affect long term stats. It
would be good to improve vsync estimation accuracy, but increasing
averaging size alone is not the best solution.

This reverts commit 4e44fe024c.
2026-04-25 08:32:29 +02:00
Kacper Michajłow 4e44fe024c player/core: increase number of past_frames to 1000
This helps with video fps estimation, for containers that doesn't
provide accurate timestamps.
2026-04-25 07:15:37 +02:00
Kacper Michajłow 68b1d10da5 player/video: rewrite display-sync audio drift compensation
The old code had several interacting problems that prevented A/V from
reaching a steady state.

When the A/V difference was large, it applied the maximum allowed
compensation in one step. That was fine for catching up, but the value
was never re-evaluated, so audio speed routinely overshot the target.
Once the difference crossed zero (or re-entered the acceptable range) it
would run a linear regression over recent av_diff samples and snap the
audio speed to the estimated drift. The fatal flaw was that those
samples already included the controller's own compensation: even when
the underlying drift was zero, the controller would "detect" the drift
it had just induced and try to cancel it. Between these rare, sparse
updates audio speed stayed frozen, so in practice the controller was
introducing drift more than it was fixing it. On high fps outputs,
where the vsync range is tight, this degenerated into a ping-pong:
overshoot, snap back, overshoot again, never settling.

The new code replaces the bang-bang direction controller and one-shot
regression with a proportional controller driven by a low-pass-filtered
av_diff. The LP filter (1 s time constant) rejects per-frame vsync
jitter so the compensation no longer chases noise. The target then
decays av_diff exponentially toward zero with a 10 s recovery time.
Adaptive slew caps per-frame motion to the desired correction magnitude,
so large excursions are absorbed quickly while near-equilibrium motion
stays below audibility. The result is a continuous, gentle control loop
that actually reaches steady state and does so without audible
audio-speed modulation.
2026-04-25 07:15:37 +02:00
Kacper Michajłow 382e3e74e8 player/command: add more precision to avsync pretty print
To better see close to zero values, instead of just clamping to 0.
2026-04-25 07:15:37 +02:00
Kacper Michajłow 99b9d9491d player/command: add more precision to av speed correction pretty print
Those values are often very small, but it's still good information to
have how they are changing.

This brings those values closes to old `%+.05f%%` that were used here.
2026-04-25 07:15:37 +02:00
Crend King 8aabba933b vf_vapoursynth: improve backward compatibility
The previous commit to dynamically load VapourSynth R74 would fail to work
for VapourSynth R73 and before on Linux due to load mode RTLD_LOCAL. To
make it work on all VapourSynth version, switch to use RTLD_GLOBAL mode.

Add library handle closing in drv_vss_uninit for completeness.
2026-04-25 07:14:56 +02:00
Andrew Rabert 45324ce682 wayland: parse toplevel states before geometry_configured check
Fix toplevel state being lost before geometry_configured is
configured. Previously, for a KWin rule that set fullscreen (apply
initially or forced) when a --geometry was also specified, mpv would
render at --geometry size even though the compositor was treating it as
fullscreen. This resulted in geometry-sized content anchored to the
top-right without a titlebar. This mismatch of what mpv thinks and what
actually is can also be seen similarly with a KWin rule that sets a
maximize state.

With this change, mpv starts in fullscreen _proper_ (ie --fullscreen).
Exiting fullscreen then results in a window size as specified by the
--geometry.

For the other states this handles, I'm honestly not sure as I wasn't
able to force them. It _should_ be fine based on what I see here and
_logically_ is correct as mpv's state should always match what the
compositor informs it to be.
2026-04-25 04:47:32 +00:00
Guido Cella e046cd0736 context_menu.lua: add background_alpha script-opt
Closes #17807.
2026-04-24 20:19:50 +02:00
Julian Orth 4c9262664c wayland: implement session management
If the compositor supports session management, the mpv window is always
added to a session. The user can manage multiple sessions by using
`--wayland-session=<human-readable-name>`. Human-readable names are
mapped to session ids via files under `~/.local/state/mpv/sessions`. The
file name is computed as a hash of XDG_CURRENT_DESKTOP and the
human-readable name.

If multiple mpv instances are started with the same session name, the
latter mpv instance takes over the session.

Upon session restoration, the mpv window is restored by the compositor
according to its state from the previous session. What that entails is
compositor policy.
2026-04-24 15:36:44 +00:00
Guido Cella 98a6960a3d ytdl_hook.lua: remove outdated comment 2026-04-23 22:06:47 +02:00
Guido Cella b3c46456c5 ytdl_hook.lua: set metadata with use_manifests=yes
With use_manifests=yes EDL is not used so metadata never gets set
through the tags mechanism. Thankfully the metadata property was
recently made writable so use that instead.

The existing metadata variable is inlined to fix linting.

Fixes https://github.com/mpv-player/mpv/pull/17761#issuecomment-4306070651
2026-04-23 22:06:47 +02:00
Kacper Michajłow 9b3565c980 msg: don't filter PU{1,2} we use them internally
Fixes: #17801
Fixes: d4ae20b7a3
2026-04-23 17:13:42 +02:00
Crend King 75b2ccfeb1 vf_vapoursynth: update for VapourSynth R74
VapourSynth R74 changed two things relevant to mpv build process:

1) VSScript no longer has static library to link to, and only support runtime loading.
This is reflected on the new VSScript example in VapourSynth SDK.
2) The VSScript library name is changed from libvapoursynth-script to libvsscript for Linux
and MacOS.

The new VSScript initialization code is modified from their SDK example to utilize
mpv's mechanisms. Build dependency is also updated accordingly.
2026-04-23 01:38:48 +02:00
Aly Smith f5939d0b93 ci: ensure winget is available on windows-11-arm
per actions/partner-runner-images#95, manually install and repair winget module in windows-11-arm runner to ensure it is available for following dependency step
2026-04-22 04:15:29 +02:00
alydev d40a29190d demux_playlist: add support for 'strm' playlist
The .strm format consists of a URI or local path as the sole contents
of a text file, this is parsed by software like Emby or Jellyfin to
treat remote streams or paths as if they are in the local filesystem.
This commit adds .strm to mpv's internal list of playlist file formats,
and points it to the handler for .m3u files as they should be
compatible. .strm doesn't need all the features of .m3u/.m3u8, but the
features do not cause issues with the relatively barebones playlist
format of .strm.
2026-04-22 03:23:50 +02:00
Kacper Michajłow 174bcec30e w32_common: support initial --fs and --window-maximized
Don't set maximized window state if we are entering fullscreen too, this
makes restoring later consistent.
2026-04-22 01:56:59 +02:00
Kacper Michajłow 9d526fc138 w32_common: keep client size on window state changes
Not all resizes should reset client size size.

Fixes: #17695
2026-04-22 01:56:59 +02:00
Hubert Głuchowski 7ec11ad67a misc/codepoint_width: handle partially ill-formed UTF-8
Previously the function just bailed on invalid input, this instead makes
it count how many replacement characters would be shown by a terminal
complying with the Unicode specification's recommendation here:
https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-3/#G66453

Fixes https://github.com/mpv-player/mpv/pull/17773#issuecomment-4277538534
2026-04-22 00:06:59 +02:00
Guido Cella 35b851e38a DOCS/man/options: remove all_formats=yes warning
Dunno what wm4 was referring to here but all_formats=yes works just fine
and quickly for changing track at runtime. The only issue I see is that
it drops the video cache if you change audio track.
2026-04-21 22:50:12 +02:00
Guido Cella 6b524c4f0e ytdl_hook.lua: default to all_formats=yes
93fe7a5526 fixed the only problem with all_formats=yes, so make it the
default to allow changing tracks of ytdl_hook URLs at runtime without
re-invoking yt-dlp.

Closes #16872.
2026-04-21 22:50:12 +02:00
nanahi 531fe5a43e osc.lua: make window control buttons action customizable
Use bind_mouse_buttons helper. This makes it possible to bind custom
actions, such as right click X button to quit with watch later.
2026-04-21 18:19:18 +02:00
nanahi d9e8e0bdf6 osc.lua: add option to configure skip_forward/backward buttons
This adds _down_command support to bind_mouse_buttons so it can be
used to bind button down actions like mbtn_left_down, and let forward
and backward buttons use bind_mouse_buttons. This makes mouse button
down actions customizable.
2026-04-21 18:19:18 +02:00
nanahi b3e6506d10 osc.lua: fix frame stepping with skip_backward/forward buttons
The event responder must have up, down, or press suffix, but
940ab99055 removed it for frame stepping
function, making it unusable. Fix this by using the down suffix.

Fixes: 940ab99055
2026-04-21 18:19:18 +02:00
Hubert Głuchowski ac3b6044d0 console.lua: use terminal_display_width when picking longest menu item
Previously this function would just count bytes which was very easily
broken by incantations like `Ő̶̧͍̹͔̮̮̦͌̈̌̂́̊͜K͖̮̼̯͖͆͋̓̀̕` which take up 52 bytes while being just
2 normal width characters visually.

`terminal_display_width` correctly counts `Ő̶̧͍̹͔̮̮̦͌̈̌̂́̊͜K͖̮̼̯͖͆͋̓̀̕` as 2 visual characters.

Note: GitHub strips all these in their web UI but there are many Unicode
combining characters after each letter of the `OK`s above that produce
a "cursed" text effect.

Fixes #17772
2026-04-21 18:17:22 +02:00
Hubert Głuchowski c202be1efe player/{lua,javascript}: add mp.utils.terminal_display_width function 2026-04-21 18:17:22 +02:00
Kacper Michajłow 6ab49ac5d7 w32_common: clear window_minimized flag on minimize->maximize
It doesn't send RESTORE in this case, so the state got confused.

Fixes: #17678
2026-04-21 05:51:58 +02:00
Kacper Michajłow e7d3fe8668 vf_d3d11vpp: fix print index value 2026-04-21 05:08:49 +02:00
Guido Cella 5921fe50bb osc.lua: use the cached chapter-list for chapter markers
When 0197729949 added state.chapter_list this call was not updated to
use the cached value, but there is no reason not to use it, especially
now that more cached properties are used.
2026-04-20 21:57:05 +02:00
Guido Cella fb8c933d4d osc.lua: cache observed properties
For properties that were already being observed but still retrieved over
and over, cache their values using the new observe_cached().

osd-dimensions observer said that if cached we may have to worry about
property ordering but it seems to work fine. It is nice to cache it
because it was the property retrieved the most frequently, in 5
different places.
2026-04-20 21:53:57 +02:00
rabbit d4ae20b7a3 msg: sanitize term title and block C1 controls and DEL
Expose the terminal output sanitizer as mp_msg_sanitize() and use it in
term_osd_update_title() to sanitize the property-expanded term-title
string before it reaches mp_msg_set_term_title(). Without this, a
crafted media tag can break out of the OSC-0 sequence via embedded BEL
or ESC bytes when --term-title includes property expansions like
${media-title}.

Extend the sanitizer to cover two gaps:

- UTF-8 encoded C1 controls (U+0080-U+009F, bytes C2 80..C2 9F). xterm
  in UTF-8 mode interprets these codepoints as C1 control functions
  (U+009B as CSI, U+009D as OSC, U+009C as ST), allowing escape
  sequence injection without any ESC or BEL bytes.

- DEL (0x7F), which was not previously filtered.
2026-04-20 21:53:33 +02:00
Kacper Michajłow 4d0666670a vo_gpu_next: don't dither scRGB
scRGB is basically intermediary format, but we don't really know what
would be the real target. And since we send floating-point buffer, we
can just expect the downstream will handle dithering and quantization at
some point.
2026-04-20 21:52:52 +02:00
NRK 7d1a598bdd vo_gpu: support parameters in RPN expressions 2026-04-20 21:52:06 +02:00
NRK d17e32fcfc DOCS/man/options: add missing RPN operators
equal and mod are also supported but were missing in the docs.
2026-04-20 21:52:06 +02:00
Kacper Michajłow 7eb1ef2fe0 video/out/filter_kernels: mark kernel-compatible windows as resizable
Mark every filter window whose libplacebo counterpart is resizable as
resizable in mpv too.

This allows --tscale-radius to be used. Prior to this, vo=gpu
silently ignored the radius override while vo=gpu-next honored it,
producing different output for the same options.
2026-04-20 21:51:34 +02:00
Kacper Michajłow 3f1589cf4c video/out/filter_kernels: fall back to nearest tap when sum is zero
When the effective filter bound (radius * blur) is smaller than the
smallest tap distance, mp_compute_weights produces all-zero weights and
the subsequent normalization divides by zero, producing NaN weights that
render as black. This can happen for resizable filters where the user
picks a radius below 0.5.

Detect sum == 0 and fall back to nearest-neighbor on the closest tap.
2026-04-20 21:51:34 +02:00
Kacper Michajłow 1be21a3186 demux_timeline: prefer editions with default video track
When the EDL marks a video track with flags=default, select the edition
whose video stream carries that flag.
2026-04-20 03:04:25 +02:00
llyyr ac852ab9df demux/packet: fix version check for SMPTE 2094-50 metadata
This enum was added in lavc 62.30.100 in https://github.com/ffmpeg/ffmpeg/commit/7faa6ee2aa01
The doc/APIchanges version listed in that commit is incorrect, it's
actually lavc 62 not lavc 60.

Fixes build failure with ffmpeg between
https://github.com/ffmpeg/ffmpeg/commit/6ba6db4f195c and https://github.com/ffmpeg/ffmpeg/commit/7faa6ee2aa01

Fixes: 76df24f40c ("demux/packet: add support for SMPTE 2094-50 metadata")
2026-04-19 16:11:38 +02:00
Guido Cella 06f4ce75aa defaults.lua: remove mp.use_suspend dead code
This does nothing since f30c5d09f4 (10 years ago).
2026-04-18 23:28:57 +02:00
nanahi 25e9a0c740 player/command: remove inaccurate comment in cmd_mouse 2026-04-18 21:13:46 +02:00
nanahi bceb1eeaf4 Revert "player/command: don't send mouse move event on mouse leave request"
There is no reason to do this, since VOs do report mouse position when
outside of window in some cases.

This reverts commit 3ff7b04790.
2026-04-18 21:13:46 +02:00
nanahi 891273055f DOCS/man/input: fix mouse-pos/hover documentation
The comment about video backends not updating pointer position is only
true if no mouse button is being pressed. If mouse button is pressed on
mpv window and then moves out of window region without releasing the
button, some platforms (win32, Wayland, X11) "capture" the pointer and
still report the coordinates, while some other platforms (SDL) do not.

The value of mouse-pos/hover also differs between platforms in this case.
The value is true on win32 and Wayland, but false on X11.

Fix documentation to address them.
2026-04-18 21:13:46 +02:00
llyyr 8665237a07 wayland: use av_gcd instead of implementing our own gcd function
Adds mp_gcd wrapper for av_gcd and uses it instead.
2026-04-18 17:55:26 +02:00
Guido Cella 8f66c0982f command: log menu-data changes at trace level instead of verbose
Avoid spamming the log.
2026-04-18 17:45:03 +02:00
Guido Cella 0b2c08ba8d osc.lua: show the first selected audio track id with --lavfi-complex
Similar to current-tracks, when the selected audio track is combined
with another one or with an ffmpeg filter, show the first selected track
id instead of "-".

This was requested by a user on IRC.

Also avoid fetching aid and sid on each render.
2026-04-18 17:41:54 +02:00
Kacper Michajłow 76df24f40c demux/packet: add support for SMPTE 2094-50 metadata 2026-04-18 05:38:40 +02:00
Mike Will d0df98f701 command: allow metadata to be set manually 2026-04-18 05:37:38 +02:00
Dudemanguy 4377cce737 wayland: always override surface local coordinates on reconfig
Previous commit fixes the issue when doing state changes but I never
actually tested just normal reconfigs (i.e. advancing a file in a
playlist). Override it in this case too. Fixes #17755.
2026-04-17 21:59:47 +00:00
NRK 09d075f475 osc: define and add support for "preview" api
this adds a "standard" api for ui scripts and thumbnailers to
communicate with each other, based on the simple thumbfast api
[0].

the api works as follows:

* To issue a thumbnail draw command, the UI script will set the
  property `user-data/osc/draw-preview`.
* To clear the thumbnail, the UI script will set the previously
  mentioned property to `nil`.

a more ideal api would make it so that the thumbnailer script
only generates the thumbnail and doesn't need to draw at all.
but such api is vastly more complex [4] and would require a lot
more work and maintenance on mpv's side.

this is a decent enough api that allows arbitrary thumbnailers
and ui scripts to communicate between each other and work
together, while being simple enough that it can be supported
without too much maintenance.

this change has been tested with work with thumbfast [1]. and
for demonstration that this api can be useful outside of osc, it
has also been tested to work on mfpbar's thumbnailer branch [2].

the code to determine thumbnail x,y is based on the osc fork
inside of thumbfast [3].

[0]: https://github.com/po5/thumbfast?tab=readme-ov-file#for-ui-developers-how-to-add-thumbfast-support-to-your-script
[1]: https://github.com/po5/thumbfast/pull/173
[2]: https://codeberg.org/NRK/mpv-toolbox/src/branch/thumbnailer/mfpbar
[3]: https://github.com/po5/thumbfast/tree/vanilla-osc
[4]: https://github.com/mpv-player/mpv/discussions/17654
2026-04-17 20:36:48 +02:00
Guido Cella 8da99f778f osc.lua: set no_video correctly
Fixes f4197a5ce0.
2026-04-17 20:28:42 +02:00
Guido Cella f4197a5ce0 osc.lua: merge the current-tracks/video observer into track-list's
Reuse the new track-list observer callback to check whether there is a
video track.
2026-04-17 20:19:28 +02:00
Kacper Michajłow 6788174641 video/out: use predefined pl_color_space_srgb 2026-04-17 20:16:50 +02:00
Guido Cella 15e5af0868 osc.lua: add observe_cached() helper
This removes code repetition and will make caching more properties
easier.

Some state fields are renamed to have the same name as the property.
2026-04-17 20:05:46 +02:00
NRK c415c662d3 vo_gpu/utils: add gpu_get_auto_param()
deduplicates some code between vo_gpu and vo_gpu_next
2026-04-17 20:03:22 +02:00
NRK 3e0729eb06 vo_gpu: add support for ENUM parameters 2026-04-17 20:03:22 +02:00
NRK a0b6233318 vo_gpu: add support for DEFINE parameters 2026-04-17 20:03:22 +02:00
NRK 0d655fe665 vo_gpu: initial support for tunable parameters
does not support everything supported by gpu-next/libplacebo,
only a subset that was needed to run some user shaders.
2026-04-17 20:03:22 +02:00
NRK 91ceffce42 shader_cache: add gl_sc_uniform_{f,i}_bstr()
this enables callers that already have bstr names to avoid
unnecessary string conversions.
2026-04-17 20:03:22 +02:00
NRK c1a21bb8d9 vo_gpu: skip invalid component overwrite
can occur when a user shader sets a hook texture with more
components than supported. e.g overwriting LUMA with 3
component.

this does create a massive log spam when triggered, but that
seems consistent with the existing resize/realign error case.

Closes: https://github.com/mpv-player/mpv/issues/9863
2026-04-17 20:02:09 +02:00
NRK 1bf50fc71c user_shaders: reject nonsense COMPONENTS values
negative values in specific causes out of bound accesses.
2026-04-17 20:02:09 +02:00
Guido Cella 021b5ccf23 ytdl_hook.lua: set the title in metadata
93fe7a5526 made global_tags work with all_formats=yes, so do like
suggested in 8ea7aa5471 and set the title via tags.

This makes available in ${metadata/title}, even if you set
--force-media-title separately.

--force-media-title is also set when self_redirecting_url is true, but
tags seem not to be set in this case and I don't know where to find such
videos to test. It was originally added to close #5313, but the URL
linked there no longer loads.
2026-04-17 19:56:06 +02:00
Guido Cella aec426a4d8 context_menu.lua: set user-data/mpv/context-menu/open
Closes #17428.
2026-04-17 19:46:12 +02:00
emberfade 179d832738 DOCS/man/vf: fix parameter separator in EBNF 2026-04-17 19:45:48 +02:00
nanahi 57490dd3a6 vo_gpu_next: add image-subs-hdr-peak=video-dynamic/video-static
Subtitles in general have constant brightness, but currently
--image-subs-hdr-peak=video uses detected peak value which is not synced
with scene and undesirable.

Add new modes that allow using static peak metadata or per-scene metadata.
2026-04-17 19:44:15 +02:00
nanahi 7f81e1ec8c vo_gpu_next: fix image subtitle hdr peak
704afb8968 assumed that HDR image
subtitles target SDR white. However, this is incorrect according to
UHD BD spec version 3.2:

> CLUTs of Presentation Graphics streams and Interactive Graphics streams
> are prepared by content author according to dynamic range property of
> the Primary video stream.
> If a Primary video stream is HDR, the Graphics streams have CLUTs
> expressed in BT.2020 color space primaries and ST2084 EOTF.
> If a Primary video stream is SDR, the Graphics streams have CLUTs
> expressed in BT.709 color space primaries and BT.1886 EOTF.

This means that PGS subtitles always have the same colorspace and HDR
dynamic range as the video, so the target peak should also be the same.

This is also supported by the BD-J spec (which displays PGS graphics):

> However the BD-ROM player does not support color space conversion nor
> dynamic range conversion of Java graphics and Background plane when
> mixing with video plane.

The Graphics model spec further states:

> The composited image on the graphics plane is transformed to full color
> and transparency by the CLUT module and then overlaid on the video
> image.

These sentences indicate that BD-ROM players simply overlay the decoded
graphics onto the video without any kind of conversion.

Change the default of image-subs-hdr-peak to 1000 to fix this.
This accommodates most HDR videos with a peak brightness of 1000 nits
and some bad HDR videos with 10000 nits peak brightness due to reencoding
and mixed with unmodified subtitles.
If there are compatibility issues, the option can be manually
set to sdr or video.

Fixes: 704afb8968
2026-04-17 19:44:15 +02:00
bennyyip 74d3c80640 select.lua: add confirmation on "Clear history" 2026-04-17 19:30:27 +02:00
Guido Cella f4dcd295cf demux_edl: support global_tags with delay_open
The delay_open mechanism used by
--script-opt=ytdl_hook-all_formats=yes breaks setting metadata with
global_tags because tl->track_layout is NULL. See adcf51dccd cbb8f534b0
8ea7aa5471.

Fix this by applying tags to the EDL timeline in this case.

Tags must still be applied to tl->track_layout when available for them
to work with local EDL files.
2026-04-17 19:24:47 +02:00
Patricia Bucataru cc8f3bf9fa gpu/utils: fix null pointer arithmetic UB in mp_log_source
strchr() can return NULL when no newline is found. Computing end + 1
before the null check on end is undefined behaviour per C11 6.5.6.
Move the next assignment inside the else branch to avoid the UB.
2026-04-17 19:11:58 +02:00
Guido Cella e0f54adf08 menu.conf: add OSC layout selection
Make this feature discoverable.
2026-04-17 18:34:24 +02:00
Guido Cella e6a338a98a options.lua: stop searching in lua-settings
This has been deprecated for 8 years, since 9eadc068fa, with a visible
warning. Removing it has the benefit of not spamming every log file with
lua-settings searches.
2026-04-17 18:33:35 +02:00
Guido Cella 18f83bc43e osc.lua: make buttons clickable from the horizontal edges
Since changing the width and alignment of buttons shrinks them or messes
up the layout, manually override the hitbox of buttons at the edges.

Fixes #9791.
2026-04-17 18:33:11 +02:00
Kacper Michajłow 7ba2e1d713 osc.lua: reduce floatingalpha a little
Alpha blending is done in gamma light of the target, when the overlay is
drawn. Depending on VO and target format, the alpha value can act quite
differently.

Lower it a little to avoid excessive transparency in some cases. This
should be fixed or workaround in better way, but for now just adjust the
value.
2026-04-17 18:32:29 +02:00
Kacper Michajłow 1068d4adb1 ytdl_hook.lua: tag variants with program_id 2026-04-17 18:30:43 +02:00
Kacper Michajłow cc9610b850 demux_timeline: add support for programs 2026-04-17 18:30:43 +02:00
Kacper Michajłow 6c165fe46e demux_lavf: add support for programs
This adds proper support for MPEG-TS programs and HLS variants. Now
program selection is exposed as editions and tracks are grouped under
such edition. If there are external tracks added, they are available in
all editions.
2026-04-17 18:30:43 +02:00
Kacper Michajłow 8010ea49c9 osc.lua: fix track indexing
track-list/N is not required to match aid/vid. They are encoded as
track-list/N/id.

This fixes changes in 1a558bf5c2 where it
was asumed that track id is the same in track-list, which is not true,
in general sense.
2026-04-17 18:30:43 +02:00
Kacper Michajłow 85bdf63a48 player/command: simplify and fix new-line handling
Remove dead code, make it work also when there is not tracks.
2026-04-17 18:30:43 +02:00
nanahi 1fea31f00c player/external_files: do not log for 0 priority files
They are not considered potential external files.
2026-04-17 04:09:23 +02:00
nanahi f5931117f0 player/external_files: fix --cover-art-whitelist priority
Since cb56c2f888, the priority of
--cover-art-auto and --cover-art-whitelist is unclear. Depending on the
number of elements in --cover-art-whitelist, the priority of
--cover-art-whitelist files can be lower, equal, or higher than
--cover-art-auto matches, creating unpredictable behavior.

Fix this by making --cover-art-whitelist priority always between "fuzzy"
and "all" priority. test_cover_filename now uses bstr_find_in_list0 to
return a negative priority value depending on the position in list.
The "all" priority is set to INT_MIN. Modify filter_subidx to use 0
priority as removal marker, since all files in the external files list
already have non-zero priority.
2026-04-17 04:09:23 +02:00
nanahi d711657833 options/m_option: use bstr_find_in_list0
Removes redundant find_list_bstr function.
2026-04-17 04:09:23 +02:00
nanahi 3d568495fc misc/bstr: move str_in_list to this file
Rename it to bstr_in_list0 and implement it in bstr_find_in_list0.
2026-04-17 04:09:23 +02:00
nanahi ac8d69e6fc misc/bstr: add bstr_find_in_list0 function
This will be used to unify several find in list handlings.
2026-04-17 04:09:23 +02:00
nanahi b20a33287b player/main: don't use atoi
Prevents UB if the value cannot be represented.
2026-04-17 04:09:23 +02:00
nanahi da2739f44f various: don't check if endptr is null for strto[udll]
These functions always set endptr to non-null so there is no need to
check.
2026-04-17 04:09:23 +02:00
nanahi 6260e7236c player/scripting: use strcasecmp for comparing script files
The documentation says that the scripts are loaded in alphabetical order,
which indicates that the case is not sensitive. Use strcasecmp to satisfy
this requirement.
2026-04-17 04:09:23 +02:00
nanahi 2b62f7c861 player/external_files: use natural sort for comparing filenames
Similar to the method used elsewhere in mpv.
2026-04-17 04:09:23 +02:00
nanahi 6b3cb12dac player/external_files: rename subtitle references to external file
These functions are used to load all external files, not only
subtitles.
2026-04-17 04:09:23 +02:00
Kacper Michajłow 17d12f83ad osdep/io: expand relative path only if it contains directory separator
For anything else, respact default load library search logic.
2026-04-17 03:56:13 +02:00
Kacper Michajłow c3231fa1ee osdep/io: use static string for dlopen errors
The dynamic allocation of this strings is completelly pointless. It adds
complexity with mp_exec_once to init aexit() to free the string, which
was leaked anyway, because the structure is thread_local and atexit only
data from the main thread was freed.

Remove all this, and just use static buffer.
2026-04-17 03:56:13 +02:00
Kacper Michajłow c865008e65 mpv-osd-symbols: center fluent icons only vertically
Makes it nicer for speaker icon to not move around on different volume
levels. Also remove scaling, it was not needed.

This required to rewrite the exclamation mark drawing code, made it look
similar to old icon now.
2026-04-16 19:03:47 +02:00
nanahi a9e1ce9c0d DOCS/man/options: fix description for testing with all hwdec methods
The comment is not longer true since auto now means auto-safe.
Change to auto-unsafe which is the setting to use to test all methods.
2026-04-16 17:18:42 +02:00
Kacper Michajłow d20d108d94 vd_lavc: remove Vulkan hwdec from auto-safe selection
It's unstable and unfortunately the situation is not getting better
over time as there are constantly new regressions introduced, which
makes it unsafe for auto selection.

It is also twice as slow as d3d11va on Windows AMD.

See also:
https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21692
https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21704
https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/22342
https://github.com/mpv-player/mpv/issues/16782
https://github.com/mpv-player/mpv/issues/17085
https://github.com/mpv-player/mpv/issues/17175
https://github.com/mpv-player/mpv/issues/17370
https://github.com/mpv-player/mpv/issues/17517
https://github.com/mpv-player/mpv/issues/17593
https://github.com/mpv-player/mpv/issues/17688

Those are only issues from recent months, many of which are not fixed.
2026-04-15 19:13:23 +02:00
Thomas Lange 7ac022c834 mpv.metainfo.xml: Update screenshot URL
The previous URL causes a "404 - Not Found" error meanwhile.
2026-04-15 15:19:50 +00:00
dependabot[bot] da4789c2dd ci: bump cross-platform-actions/action from 0.32.0 to 1.0.0
Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.32.0 to 1.0.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.32.0...v1.0.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 1.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-12 14:57:28 +02:00
NRK 062f4bf047 player: fix leak on client-message send failure
when there's a flood of events causing the event queue to
overflow, the duplicated client-message payload gets dropped
without being released. free it on failure too.

discovered while trying to trigger #10110.
2026-04-11 19:27:44 +02:00
Dudemanguy 3e3048a5aa wayland: override surface local when setting geometry or window scale
If the window is fullscreen or maximized and the user sets some geometry
or window scale, we should apply it when the state transitions back to
windowed mode. This was being missed and the surface local coordinates
were being used.
2026-04-10 14:00:50 +00:00
Dudemanguy fd2215eef4 wayland: override surface local coordinates on reconfigures
We don't want to be using the coordinates from the compositor in this
case since it can't know that the new surface has a totally different
aspect ratio. Also remove the early return so that the state is always
updated regardless if it's determined we need to resize or not.

Fixes #17710.
2026-04-10 14:00:50 +00:00
Kacper Michajłow 75939c2116 wayland_common: use only supported primaries when inferring from raw 2026-04-09 21:21:46 +02:00
Guido Cella ec4d50fd91 context_menu.lua: enable runtime script-opt updates
Fixes #17726.
2026-04-09 13:40:37 +02:00
Guido Cella 266cb79f38 osc.lua: make all the height of bar lines clickable
There is an area between the 2 lines of bottombar and topbar that is not
clickable, e.g. between the menu and play_pause icons. Make it all
clickable so it's easier to click buttons.

This also allows clicking from the bottom in slimbottombar and from the
top in topbottombar.
2026-04-08 20:32:48 +02:00
Guido Cella c9d2f17a98 osc.lua: allow clicking window controls from the top
Window controls are not clickable from the very top of the window, they
have a margin to the top that makes them harder to click. Make them
clickable also from the very top to make them easier to activate.

The close button with the default windowcontrols_alignment=right
specifically is already clickable from the rightmost part of the window.

Partial fix of #9791 (other buttons also need to be updated).
2026-04-08 20:32:48 +02:00
NRK 1bfa18107c DOCS/man/input: add note on env case-sensitivity 2026-04-08 20:24:07 +02:00
NRK aef3793e92 osdep/io: make getenv case insensitive on windows
env vars are case insensitive on windows so getenv should
compare them as such.

Fixes: https://github.com/mpv-player/mpv/pull/17577#issuecomment-4167125610
2026-04-08 20:24:07 +02:00
NRK e2180e581e demux_playlist: only autocreate on regular file
trying to autocreate playlist when the file is a fifo breaks
playback. the bug report is a special case of `/dev/fd/*` but
even for named fifos, opening and closing them can cause the
other end to stop writing.

Closes: https://github.com/mpv-player/mpv/issues/17682
2026-04-06 18:50:28 +02:00
nanahi 7ace42f505 ytdl_hook.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi 1839da1d07 select.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi 3b86e32c2b defaults.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi 095d858a19 defaults.js: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi b0f9279824 TOOLS/lua/command-test.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi dbd31fd9d3 DOCS/man: use _name key for mp.command_native 2026-04-06 18:33:20 +02:00
nanahi 80582efca5 input/cmd: use _name for command name in mpv_command_node
Some commands have named arguments named "name", which conflict with
the "name" entry used to specify command name in mpv_command_node, so
they cannot be used with mpv_command_node.

These commands include:
set, del, change-list, add, cycle, multiply, enable-section,
disable-section, define-section, script-binding, keybind, keypress,
keydown, keyup, apply-profile.

This makes mpv_command_node accept command name as key "_name", so
"name" can be used to specify command arguments. For compatibility,
if "_name" entry does not exist, then "name" is used as fallback.
2026-04-06 18:33:20 +02:00
nanahi b7377ede18 DOCS/man/options: document @ syntax for --input-ipc-server 2026-04-06 18:31:27 +02:00
nanahi b11ae04f37 input/ipc-unix: don't delete file for abstract sockets
If --input-ipc-server path name starts with "@", then "@" is replaced
with a null character, which represents the abstract socket namespace
on Linux. Because abstract sockets have no file system presence, it
should not delete the file with the same name starting with "@".
2026-04-06 18:31:27 +02:00
nanahi c2d9905598 DOCS/man/options: add note about %tX behavior change 2026-04-06 18:30:10 +02:00
nanahi edf6016ecf player/screenshot: support %s date format on all platforms
Previous commit left the common %s format extension unresolved.
This implements the format in a platform independent way so it can be
used on all platforms, including on Windows where strftime does not
support %s.
2026-04-06 18:30:10 +02:00
nanahi 87d359eabf player/screenshot: validate strftime format string
The format specifier is controlled by the user that can be arbitrary
character. Using invalid specifier in strftime is UB. Fix this by only
accepting the specifiers recognized in C11.

Partial compatibility is provided for extension formats k, l, P by
translating them to the closest standard alternative.
2026-04-06 18:30:10 +02:00
nanahi dfef53f94b player/screenshot: fix null dereference when failing to get time
localtime can fail and return NULL, which causes NULL dereference
for strftime.
2026-04-06 18:30:10 +02:00
nanahi e0fe1a45d2 command: fix race in reading pad_buttons_pressed
mp_input_get_tablet_pos stores the address to an array that is protected
by lock, and the content is accessed without acquiring lock.

Fix this by writing the values to an array inside mp_input_get_tablet_pos.

Fixes: 0fbf20f057
2026-04-06 18:28:04 +02:00
nanahi b67a5b4cd8 input: fix out of bound read/write in pad_buttons_pressed
When buttons > MP_MAX_TABLET_PAD_BUTTONS and the value is stored in
ictx->tablet_pad_buttons, the next mp_input_set_tablet_pad_focus call
will cause out of bound write, and mp_property_tablet_pos will cause
out of bound read.

Fix this by limiting ictx->tablet_pad_buttons range.

Fixes: 0fbf20f057
2026-04-06 18:28:04 +02:00
NRK 9251f871b6 options: preparse --shuffle
needed in order to correctly handle --directory-mode=auto

Fixes: https://github.com/mpv-player/mpv/issues/17601
2026-04-06 18:27:27 +02:00
nanahi cf957b4f2a player/command: use m_property_read_sub_validate when suitable
Avoids wasting resources on trivial requests.
2026-04-06 18:26:34 +02:00
nanahi 629205280c player/command: rename to mp_property_list_editions
Use mp prefix like everything else.
2026-04-06 18:26:34 +02:00
nanahi 7f28b8818a player/command: use m_property_read_sub for mouse-pos
Allows reading using sub property syntax.
2026-04-06 18:26:34 +02:00
Kacper Michajłow 9e60ae0fee SECURITY.md: add security policy 2026-04-06 18:24:48 +02:00
Guido Cella b8df71a411 commands.lua: use the new choices field in command-list
Use the choices field added by ae2384bce0 for command arguments instead
of hardcoding them.
2026-04-06 18:24:30 +02:00
NRK 702abfd587 vo_gpu: use actual (not logical) texture dimension
pass_upload_image currently stores the logical dimensions, which
in case of vulkan decoding may not match the physical one (e.g
1088 for 1080p). this mismatch results in glitches when using
polar scalers.

fix this by using the actual texture dimensions for hwdec plane
sizes.

Fixes: https://github.com/mpv-player/mpv/issues/14944
2026-04-06 18:23:54 +02:00
nanahi 9bf9bb50de options/m_option: fix valid format in geometry option help message
/WS format is accepted.
2026-04-06 18:23:25 +02:00
nanahi 94d06bc727 options/m_option: allow /WS geometry parameter usable without XYWH
This allows specifying workspace while using autofit for window size
or leave it as default instead of mandatory geometry in pixels.
2026-04-06 18:23:25 +02:00
nanahi befe1e73a2 video/out/x11_common: fix BadAtom error when getting atom name
When XdndEnter advertises format without using XdndTypeList, some of
the atoms in the 3 fixed items may be None, which causes error in
XGetAtomName. Fix this by not resolving name when atom is None.

Fixes the following error message when dragging file on mpv window:
X11 error: BadAtom (invalid Atom parameter)
2026-04-04 21:36:07 +02:00
Mia Herkt 428edff9c1 Meson: add appropriate install_tag to each target
See https://mesonbuild.com/Installing.html#installation-tags

tl;dr it allows choosing what to install and also provides some
extra metadata for tools operate on Meson projects via its
introspection feature.
2026-04-03 18:45:52 +02:00
Mia Herkt c1f30c9b63 Meson: specify license files
This allows using --licensedir. Meson then also generates and
installs a machine-readable manifest file at that location, which
would include the licenses of subprojects if we had any.
2026-04-03 18:21:19 +02:00
Kacper Michajłow c41ee4b95f vo_gpu_next: remove swdec from upload frame pass description
Users are confused about `-copy` hwdec, which is effectively sw upload,
but let's remove this suffix.

Fixes: https://github.com/mpv-player/mpv/pull/17684#issuecomment-4170637631
2026-04-03 02:02:40 +02:00
Kacper Michajłow 0c883fbe03 w32_common: update DWM corners state in when toggling fullscreen
Fixes: #17653
2026-04-03 00:07:29 +02:00
Guido Cella c961c96afb lua: remove the deprecated error field from end-file
This has been deprecated for 6 years so remove the compatibility code.

This basically reverts 37f441d61b.
2026-04-01 22:10:08 +00:00
Guido Cella 70b8b22c8b command: remove the deprecated time-start property
This has been deprecated for 11 years since 70df1608d6 so remove it. All
it does is return 0.
2026-04-01 22:09:25 +00:00
nanahi 4e6196e1a6 player/command: fix update-clipboard text-primary
It mistakenly updates text instead.
2026-04-02 00:05:27 +02:00
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 bed0f49729 osc.lua: show window controls in idle 2026-04-01 16:07:27 +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
Kacper Michajłow 40db14f85b vo_gpu_next: add few cpu timers 2026-04-01 15:20:11 +02:00
Kacper Michajłow 7757064bdd vo_gpu_next: add sw upload time to stats
Also fix lingering hw map stats.
2026-04-01 15:20:11 +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
NRK 5f45db9d70 DOCS/man/input: document dummy properties
these properties cannot be used directly and require a
sub-property. document this explicitly.
2026-03-31 18:44:10 +00:00
llyyr 552d8fa91e vo_drm: use drmModeDestroyDumbBuffer instead of using the ioctl directly 2026-03-31 18:22:54 +00:00
llyyr 8b2e3bf786 vo_drm: use drmModeMapDumbBuffer instead of using the ioctl directly 2026-03-31 18:22:54 +00:00
llyyr 5bb30a6f6c vo_drm: use drmModeCreateDumbBuffer instead of using the ioctl directly
Also remove `fb->handle = 0` assignment because the framebuffer struct
is already zero initialized.
2026-03-31 18:22:54 +00:00
llyyr 64c4309697 drm_prime: use GEM_CLOSE wrapper instead of using ioctl directly 2026-03-31 18:22:54 +00:00
llyyr 4bed99f6a5 meson: bump minimum libdrm version to 2.4.114
We'll use the dumb buffer helpers added in 2.4.114 and GEM_CLOSE wrapper
added in 2.4.108. This is available on Ubuntu 24.04 and Debian 12.
2026-03-31 18:22:54 +00:00
llyyr c8e3a2ec52 drm_common: change type of framebuffer.size from uint32_t to uint64_t
Matches the defintion in kernel headers.
2026-03-31 18:22:54 +00:00
Guido Cella 9465b30a40 DOCS: remove behavior changes before version 0.38
These are ancient and not useful anymore.

The version notices are kept under:
overlay-add: handled by #17520
end-file's file_error: the notice should be removed when updating error
field like suggested there
time-start: this should just be removed
~/.mpv/: needed to understand why this is used
--aid: needed to understand the following paragraphs
2026-03-30 15:09:38 +00:00
Dudemanguy 2e83b3b61c wayland: don't always use surface local coordinates in toplevel config
Since 1301fdb2ec we try to directly use
surface local coordinates however it is valid for compositors to send us
0s in either the width or height. In that case, it means mpv should
choose its geometry so we should calculate out our own coordinates.
Previously this was incidentally handled, but we should be more explicit
here and set the bool.
2026-03-30 01:01:43 +00:00
llyyr adff00c8aa wayland: don't use surface local coordinates if we haven't received them
vo_wayland_handle_scale may be called from reconfig, even before we get
the first toplevel_configure. In this case, don't use the surface local
coordinates because they will be initialized as 0.
2026-03-30 01:01:43 +00:00
llyyr de118fdb70 m_option: don't allow m_geometry_apply to make a coordinate 0
Same reasoning as the previous commit.
2026-03-30 00:53:18 +00:00
Dudemanguy 9214b44a68 video/out/win_state: don't allow apply_autofit to return 0
There's no way this coordinate can ever work so don't force callers to
waste time checking for it, so just MPMAX at 1. Fixes a crash in certain
cases if you do --autofit=1x1.
2026-03-30 00:53:18 +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
llyyr e9a1f82345 wayland: scale edge pixel threshold by scaling factor 2026-03-30 00:32:51 +00:00
llyyr b824aec50f wayland: document that wayland-edge-pixels-touch only affects CSD 2026-03-30 00:32:51 +00:00
llyyr 51ef7c5960 wayland: use wayland-edge-pixels-pointer for tablet input resize zone
Tablet input is more similar to mouse input than it is to touch input,
so it makes sens to use wayland-edge-pixels-pointer instead. Also
document that it's used for tablet input, previously this was completely
undocumented.
2026-03-30 00:32:51 +00:00
Martin Tournoij 86b30afea0 DOCS/man/options: clarify --directory-filter-types docs
Using "mpv --directory-filter-types= dir" as an "empty" value doesn't
work, because that will create a list where the first value is an empty
string, so get_directory_filter() returns AUTO_NONE instead of AUTO_ANY.

You need to use --directory-filter-types-clr instead, to create a proper
empty list.

I suppose this is kind of obvious in hindsight, but it took me quite
some time and digging through the mpv source to figure this out –
initially I assumed it must be a bug of some sort.

So clarify what "empty list" means.
2026-03-30 00:13:03 +00:00
nanahi e45f86225f demux_playlist: don't get config group again when checking shuffle
The shuffle option is already available as p->mp_opts->shuffle since
44a3a3293f.
There is no reason to get the config group again and free it.
2026-03-30 00:07:45 +00:00
llyyr ef531e19c3 vulkan/context: remove pl_swapchain_resize in set_color
ref: https://code.videolan.org/videolan/libplacebo/-/merge_requests/811
2026-03-29 18:00:48 +02:00
Kacper Michajłow 4f9f1ffaf3 meson: build mpv.com with -Os
LLVM even in freestanding build required memset/memcpy/memmove to be
implemented. We don't use them directly but the calls are generated from
the code, which are later optimized away. Since this suppose to be small
utility application, we can always optimize it.

Fixes: #17664
2026-03-28 23:22:09 +01:00
Dudemanguy 2ad46a3c3c vo_dmabuf_wayland: place video surface on the top
For rounding reasons, we should have the surface with the video on the
top. Rounding subsurfaces is tricky business that we don't need to get
into.
2026-03-27 22:20:34 +00:00
Dudemanguy 1301fdb2ec wayland: directly use surface local coords for viewport when possible
Previously, we calculated out the value for simplicity but there can be
a mismatch due to round where what we calculate as the viewport
width/height is not what surface local coordinates the compositor gave
us. Note that we don't always want to use these values directly (e.g.
whenever we set our own geometry), so some notion of overriding has to
be added.
2026-03-27 22:20:34 +00:00
llyyr 251a2b6f49 wayland: alphabetize static function definition
Also fix some inconsistent indenting while at it
2026-03-27 16:40:41 +00:00
llyyr 63d0beb67c wayland: use designated initializers for protocol listeners
Replace order-dependent struct initialization of Wayland listener
structs with designated initializers.

Besides making it harder to make ordering mistakes while adding or
changing code, also makes it easier to grep for specific events because
our callback functions aren't necessarily named the same as the event
names (e.g. global_remove = registry_handle_remove).
2026-03-27 16:40:41 +00:00
llyyr 4d16b0938d wayland: fix typo in log message 2026-03-27 16:40:41 +00:00
llyyr 065146c9b8 wayland: wrap color mgmt functions in ifdefs instead of their bodies 2026-03-27 16:40:41 +00:00
llyyr 38cf424134 wayland: remove set_img_desc goto from set_color_management
A bit easier to understand perhaps
2026-03-27 16:40:41 +00:00
llyyr 96de78f914 wayland: validate metadata before set_luminance
It's still invalid for max_lum to be less than or equal to min_lum, so
do the check before set_luminances call. Also rename the function
because it does more than just check if it's valid, it also sanitizes
some invalid values.

Also changes the TRC_LINEAR case a bit, because min_luma == 0 isn't
exactly invalid, only min_luma >= max_luma is invalid which is covered
by the sanitize function
2026-03-27 16:40:41 +00:00
llyyr 3cf31bf7a4 wayland: reduce branching when printing log for unsupported prim/tf
Also move scRGB comment inside ifdef
2026-03-27 16:40:41 +00:00
llyyr 56832b2bdb wayland: reduce branching in color-management info_done 2026-03-27 16:40:41 +00:00
Guido Cella 1a545faf28 menu.conf: don't check Hardware decoding with no video track 2026-03-25 13:44:44 +01: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 eda0e0b093 w32_common: latch force position until it is actually applied
In case we are in fullscreen, we might not apply it right away.
2026-03-25 01:42:12 +01:00
nanahi ae6728a7c0 misc/io_utils: allow mp_save_to_file writing empty files 2026-03-25 01:41:05 +01:00
Kacper Michajłow ef7bced028 osc.lua: make title wider in floating layout
We don't put anything else on title line, so we don't need reserved
space as with other layouts.
2026-03-24 19:24:49 +01:00
Kacper Michajłow f42480d0cc w32_common: fix Windows 10 workaround for initial window pos
Restores hack from 3d4170b81b to work
again.

Fixes: 7466a9f9f3
2026-03-24 00:50:08 +01:00
Kacper Michajłow e757931859 af_scaletempo: limit options to resonable range
This fixes multiple overflows when passing huge values. Which causes
either invalid memory accesses when memory allocations are wrong size or
huge allocations leading to OOM.

Reported by: Trail of Bits
2026-03-23 23:34:20 +01:00
Kacper Michajłow ed534eb7f5 vo_gpu_next: add stereo osd support
Duplicate OSD/Subtitles for left and right eye.

Fixes: #12462
2026-03-23 23:16:32 +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
Kacper Michajłow 5df1681c48 vo_gpu_next: add timer for hwdec frame mapping
With `--d3d11va-zero-copy=no` (default), we do the GPU-GPU copy of the
frame, add this time to the stats.
2026-03-23 15:04:11 +01:00
nanahi 514c8097a9 player/configfiles: use mp_hash_to_bstr 2026-03-23 15:03:38 +01:00
nanahi 1bd29b0ba2 video/out/gpu/lcms: use mp_hash_to_bstr 2026-03-23 15:03:38 +01:00
nanahi b48058e6cb video/out/gpu/shader_cache: use mp_hash_to_bstr 2026-03-23 15:03:38 +01:00
nanahi 58ee11c58a misc/hash: add mp_hash_to_bstr function
This util function uses the generic libavutil hash API to hash any data
with the specified algorithm to a bstr. It deduplicates multiple hash
routines used in mpv.
2026-03-23 15:03:38 +01:00
nanahi 6245d7e92c video/out/opengl/utils: remove redundant imports 2026-03-23 15:03:38 +01:00
Kacper Michajłow 7ec8a7e9b1 vd_lavc: ensure decoder state is valid after reinit
This fixes dynamic hwdec switching, which would often fails, because
hw decoder were feed data without context, which caused decoding errors,
which in turn disabled hwdec.

command.c does queue_seek() after decoder reinit, but it may already be
too late, by the time seek to keyframe finishes.

Fix this, by just discarding the data until we have safe point to start
decoding again. Limit this only for hwdec to avoid formats that may not
have ffmpeg parser and not give us keyframe information and limit to 96
frames, just as safety to not lock the player, but this shouldn't happen
in practice.

This should also fix cases, when media file is cut in a way that would
cause decoding errors at the start.

Fixes: #17484
2026-03-23 13:29:59 +01:00
Kacper Michajłow 9339a68dfb demux_lavf: mark packets with keyframe for wrapped avframes too 2026-03-23 13:29:59 +01:00
llyyr 89febe90c2 wayland: move last_zero_copy to fback_pool 2026-03-23 00:31:35 +01:00
low-batt 75681e5019 mac/window: fix white lines around screen with non-native fullscreen
in macOS 11 Apple changed AppKit to disallow use of the fullscreen
window style by custom full screen implementations, reserving this style
for their own implementation. mpv's custom implementation had to
workaround this by manually applying changes to the window to match the
fullscreen window style.

in macOS 26 Apple made changes to enhance visual depth. This
included making a window's shadow more pronounced. This revealed
the workaround was missing code to remove the window's shadow when in
full screen mode. This was especially visible when the macOS appearance
was set to dark and a dark video was played with --native-fs=no. The
window's shadow under macOS 26 was visible as a very thin white outline
around the screen.

this fix will enhance the workaround in the macOS custom full screen
implementation to toggle NSWindow.hasShadow when entering and exiting
full screen mode under macOS 11+.

Fixes: #17586
2026-03-22 23:27:16 +01:00
Kacper Michajłow c798884163 w32_common: respect C{X,Y}MIN system metrics
Fixes: #8440
2026-03-21 23:31:15 +01:00
Kacper Michajłow a380190a41 w32_common: fix handling of WM_SIZING
Fixes some corner cases when resizing window with keep aspect ratio
enabled. Limit correctly window to working area, also after adjusting
aspect ratio to avoid unexpected resizes and window not staying in
position. Use integer math to have consistent rounding, to avoid window
"drifting".

Fixes: #8728
2026-03-21 23:31:15 +01:00
Kacper Michajłow 6c9105380c w32_common: set max window track size 2026-03-21 23:31:15 +01:00
llyyr 9021c3263a clipboard-{x11,wayland}: replace static const with enum
Fixes gcc build with certain build options
2026-03-21 23:27:04 +01:00
nanahi edc8534d0b misc/io_utils: rename cache
The function is used for various purposes so rename cache to something
generic.
2026-03-21 20:14:09 +01:00
nanahi 8b2ab60ae3 video/out/gpu/shader_cache: use mp_save_to_file 2026-03-21 20:14:09 +01:00
nanahi 20b24a0dbd video/out/gpu/lcms: use mp_save_to_file 2026-03-21 20:14:09 +01:00
nanahi 26fbea0205 player/configfiles: check error before copying mtime
Similar to what is mp_write_watch_later_conf is already doing.
2026-03-21 20:14:09 +01:00
nanahi f5cad5c065 player/configfiles: use mp_save_to_file 2026-03-21 20:14:09 +01:00
nanahi 3a8a908641 menu.conf: use update-clipboard command
This command is now required when the default has no clipboard monitoring.
2026-03-21 16:05:36 +01:00
nanahi 59d7315fe2 console.lua: use update-clipboard command
This command is now required when the default has no clipboard monitoring.
2026-03-21 16:05:36 +01:00
nanahi bf054a8357 input.conf: use update-clipboard command
This command is now required when the default has no clipboard monitoring.
2026-03-21 16:05:36 +01:00
nanahi bc4f5ce2ba clipboard-wayland: notify clipboard updates to update-data waiters 2026-03-21 16:05:36 +01:00
nanahi 7d41ceef05 clipboard-wayland: support update_data 2026-03-21 16:05:36 +01:00
nanahi 8611b4c11e clipboard-wayland: disable automatic content fetching 2026-03-21 16:05:36 +01:00
nanahi 613b7f2a77 clipboard-x11: notify clipboard updates to update-data waiters 2026-03-21 16:05:36 +01:00
nanahi 527500b68a clipboard-x11: support update_data 2026-03-21 16:05:36 +01:00
nanahi dd9f7949a2 clipboard-x11: disable automatic content fetching when not monitoring 2026-03-21 16:05:36 +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
nanahi 49b2cf66d6 clipboard: make clipboard_ctx persistent
There is no reason to create and destroy this storage. They can be
zeroed instead when destroyed. This simplifies some logic and prepares
for the next commit.
2026-03-21 16:05:36 +01:00
Dudemanguy e84ac3760c Revert "osc.lua: fix window controls showing in fullscreen"
Decoupling fullscreen behavior from the generalized border logic
increases the complexity and also inherently changes the behavior in a
way that is not neccesarily desirable. People in IRC notably were
confused about the window controls not being shown in fullscreen because
of this change. We could default the option to yes, but then there will
likely be people confused as to why they suddenly now have the controls
when it wasn't there previously. The best way to avoid all this is just
undo it. If someone wants special fullscreen behavior with
windowcontrols, this can be done with auto profiles already. There's not
much utility in having a separate option.

This reverts commit 3b66428152.
2026-03-20 14:44:03 +00:00
llyyr 7b1ee864b8 input: only allocate key name if we've printing trace level messages 2026-03-19 20:45:55 +01:00
llyyr 520faac68d input: fix leaking tablet tool key name 2026-03-19 20:45:55 +01:00
llyyr 5f9e1bc7bd wayland: guess best containing primary from raw primaries 2026-03-17 10:49:09 +01:00
llyyr 5a45669663 vo_gpu_next: move get_best_prim_container to csputils
Used in next commit
2026-03-17 10:49:09 +01:00
Kacper Michajłow 3d4170b81b w32_common: force DWMWA_EXTENDED_FRAME_BOUNDS to work on init
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so
show it off-screen to get correct values.

Fixes: https://github.com/mpv-player/mpv/pull/16127#issuecomment-4063603866
2026-03-17 10:13:34 +01:00
Kacper Michajłow 53f7c6e9dd w32_common: add missing title bar height calc back
I've lost this piece of code when doing rebases or testing. This is
needed to correctly calc maximized window size.
2026-03-17 10:13:34 +01:00
llyyr b51131dff9 ci/freebsd: bump to FreeBSD 15.0 2026-03-15 18:40:09 +01:00
llyyr a71da301b0 ci/{freebsd,openbsd,linux-old}: clone the latest supported libplacebo 2026-03-15 18:40:09 +01:00
llyyr 022fbd16b9 meson: bump min libplacebo version to v7.360.1
This version contains critical fixes to swapchain selection, correct
mapping of sRGB TRC as well as fix for gpu hangs on anv. Bump the
minimum version because the mpv experience with previous version
shouldn't be endorsed or be considered acceptable by upstream.
2026-03-15 18:40:09 +01:00
Kacper Michajłow d12f2ce19c hwdec_vulkan: guard deprecated AVVulkanDeviceContext.lock/unlock_queue
libavutil deprecated AVVulkanDeviceContext.lock/unlock_queue without
replacement [1]. This prevents us from using queue locking, as those
callback will be removed in lavu. Set those callbacks as long as they
are still present, they will be noop in libplacebo with
`VK_KHR_internally_synchronized_queues`.

It's unclear what will happen to devices that do not support
`VK_KHR_internally_synchronized_queues` when the lock/unlock_queue
callbacks are removed.

[1] https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/c102e89448a06d9920920923a4008fee3db4ea37
2026-03-15 17:45:49 +01:00
llyyr 3945a41872 wayland: fix alpha mode mapping for color-representation
Fixes: ed8954e8cf ("wayland: add support for wp-color-representation-v1")
2026-03-15 17:43:27 +01:00
Rudi Heitbaum 8ace278cbe various: fix Wdiscarded-qualifiers warnings
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
2026-03-15 14:49:00 +01:00
llyyr afef9126ce wayland: don't try to do anything on data_device.motion
The keyword here is "try". mpv attempts to accept data offer on motion,
by using the time as the serial... which doesn't do anything. We already
accept data offers on data_device.enter so this doesn't do anything even
if we used the right serial.

Fixes: 68f9ee7e0b
2026-03-14 15:10:59 +00:00
nanahi a7283a8e89 DOCS/man/mpv: use admonition for slice protocol examples 2026-03-14 16:06:51 +01:00
nanahi 2b2bb95181 DOCS/man/mpv: document archive protocol
This protocol is useful for opening a specified file in an archive
instead of opening the archive as a playlist.
2026-03-14 16:06:51 +01:00
llyyr e96c8ed650 video/vaapi: mark nvidia-vaapi-driver as emulated driver
This should match the vendor string[1] provided in that project, and mpv
will skip using this driver on Nvidia. nvidia-vaapi-driver segfaults
when trying to decode 4:4:4 videos, and there's no reason for Nvidia
users to use this layer in mpv anyway. Use nvdev or vulkan instead.

1: https://github.com/elFarto/nvidia-vaapi-driver/blob/c4e1788b6d554f29adec31f3f8aa984c143c54c1/src/vabackend.c#L2331-L2335
2026-03-14 12:55:40 +01:00
Kacper Michajłow 44f06c6dd0 osc.lua: fix typo
oops...

Fixes: 6bf5a6ca7c
2026-03-13 20:12:53 +01:00
Kacper Michajłow 88e741a019 osc.lua: use fluent icons by default for floating layout
Floating layout is more rounded comparet to square bar layout, so fluent
icons are better match here.
2026-03-13 19:16:47 +01:00
Kacper Michajłow 6bf5a6ca7c osc.lua: add floating layout 2026-03-13 19:16:47 +01:00
Kacper Michajłow 8bf384fe6d osc.lua: add osc-icon_style option 2026-03-13 19:14:39 +01:00
Kacper Michajłow 1d7d6c2719 mpv-osd-symbols: add some Fluent UI System Icons to mpv font
This uses Fluent UI System Icons [1] as a source for icons. The glyps
are generated using `TOOLS/gen-fluent-glyphs.py` script, which downloads
Icon and convert for our mpv font to use. Glyphs are vendored in our
repository to avoid external dependency.

Script could be extended to add more icons/variants easily, currently
only filled version are imported.

[1] https://github.com/microsoft/fluentui-system-icons
2026-03-13 19:14:39 +01:00
Kacper Michajłow fbdaddf968 w32_common: refactor window resizing
Fixes lots of issues with current window resizing and window style
modifications.
2026-03-13 15:13:31 +01:00
Kacper Michajłow df4736df26 win32: remove SC_RESTORE handling
It doesn't seem to be neeeded anymore.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 6be1e3f2b9 win32: don't override fs user option
We don't support other ways of fullscreening.

Fixes: #16119
2026-03-13 15:13:31 +01:00
Kacper Michajłow c804e55dbe win32: change resize window event logs to trace 2026-03-13 15:13:31 +01:00
Kacper Michajłow a34ecb5284 video/out/win_state: allow internal size constraint for window_geometry
Will be useful to limit the size directly based on platform requirement.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 8142c831f0 video/out/win_state: pass opts as argument
Options may be at different state when caller is using it's own cached
copy. This makes opts consistent in usage.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 27b0979b6b osc.lua: set sub_margins to no
Subtitles are complex subsystem, let's leave the choice to move them
with margin on user.
2026-03-13 15:10:21 +01:00
Kacper Michajłow 0f37c2abef osc.lua: use dedicated options to control SUB/OSD offset
There is concern that with certain user options or script the value of
`{sub,osd}-margin-y` value may be persisted or overwrite user option
when it's changed while OSD is visible and offset is applied.

Fix this by using dedicated option.
2026-03-13 15:10:21 +01:00
dependabot[bot] 3a09e793b9 ci: bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-12 17:20:00 +01:00
dependabot[bot] d58b7e03b2 ci: bump actions/upload-artifact from 5 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-12 17:19:40 +01:00
dependabot[bot] e74ef802c5 ci: bump cross-platform-actions/action from 0.30.0 to 0.32.0
Bumps [cross-platform-actions/action](https://github.com/cross-platform-actions/action) from 0.30.0 to 0.32.0.
- [Release notes](https://github.com/cross-platform-actions/action/releases)
- [Changelog](https://github.com/cross-platform-actions/action/blob/master/changelog.md)
- [Commits](https://github.com/cross-platform-actions/action/compare/v0.30.0...v0.32.0)

---
updated-dependencies:
- dependency-name: cross-platform-actions/action
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-12 17:18:59 +01:00
Kacper Michajłow d83931aa61 ci: add dependabot to update actions for us 2026-03-12 16:08:15 +01:00
NRK 3cd66d2fd7 command: avoid crashing the player with mmap
mmap in inherently crashy due to the file changing underneath
and requires esoteric SIGBUS handling [0] to use properly.

to reproduce, simply use "overlay-add" from a lua script with
invalid stride set and observe mpv crashing with SIGBUS.

here we're just copying the file content (introduced in
549a9ea) and munmaping it immediately so there's no real need
to be using mmap to begin with. avoid the issue entirely by just
reading the file directly with fseek+fread with optimization for
the common stride case.

one notable difference is that since dup-ed fds share same
offset, the source "fd" that's coming from client will now have
it's offset modified. `pread` could avoid this issue but it's
not supported on windows.

[0]: https://www.sublimetext.com/blog/articles/use-mmap-with-care
2026-03-12 15:58:53 +01:00
NRK 1aee4637f2 osdep/io: add mp_dup_cloexec()
will be used in the next commit
2026-03-12 15:58:53 +01:00
NRK 7e9fa0dee4 osdep/io: remove redundant errno setting
according to the docs _get_osfhandle() sets errno to EBADF upon
failure already:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=msvc-170
2026-03-12 15:58:53 +01:00
NRK a2ddcdf67b osdep/io: fix error check
_get_osfhandle returns INVALID_HANDLE_VALUE on failure, not 0.
2026-03-12 15:58:53 +01:00
Guido Cella ad9374d03e osc.lua: move {audio,sub}_track_count into state 2026-03-12 15:58:21 +01:00
Guido Cella 6da164452a osc.lua: update track state only when track-list changes
There is no need to retrieve track-list on every osc_init().

Also remove the outdated comment.
2026-03-12 15:58:21 +01:00
Sam 11440741cb osc.lua: remove pause_state() 2026-03-12 10:50:11 +01:00
Kacper Michajłow 79bf5d2684 osc.lua: increase deadzoneszie to 0.75
This allows to retain deadzone in the middle of the screen when both top
and bottom bars are enabled. We also doesn't have to show bars that
early before moving mouse down.
2026-03-12 00:02:41 +01:00
Kacper Michajłow 3b66428152 osc.lua: fix window controls showing in fullscreen
If `no-border` or `no-title-bar` was used, window controls would enable
also in fullscreen, this was inconsistent, as window decorations are not
visible ragardless of those options in fullscreen mode.
2026-03-12 00:02:17 +01:00
Guido Cella 44dec05a29 osc.lua: don't retrieve display-fps at startup
There is no advantage since is it never available at startup, so speed
up the startup by not retrieving it.
2026-03-11 14:58:09 +01:00
Kacper Michajłow 24500c5e27 f_decoder_wrapper: fix decoder name/desc allocation parent
Those strings has to be owned by mp_codec_params, not decoder wrapper
priv.

Our assumption is that we set those strings here once on decoder init
and they will not be changes during the life time of the
mp_codec_params, hence why we need to make sure they are not deallocated
too soon, in case they happen to be in use.

Fixes, use after free in some cases, when tracks are deselected.
2026-03-11 00:20:22 +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
Kacper Michajłow d4625c7db6 osc.lua: fix always visibility 2026-03-10 19:45:03 +01:00
Kacper Michajłow 32a690b8bd DOCS/man/osc: fix boxvideo description 2026-03-10 19:45:03 +01:00
Kacper Michajłow 85f9e6f274 vf_d3d11vpp: allow more future/past frames
Apparently some video processors request 15-20 future frames.

Fixes: https://github.com/mpv-player/mpv/pull/17413#issuecomment-4032784635
2026-03-10 18:30:10 +01:00
Kacper Michajłow 88ac54b95d osc.lua: hide osc or wc when leaving its area
Those zones use input sections, but in OSC we allow them to overlap. So,
we might switch to the other section, after which point we won't get
mouse_leave event that would hide the bar for the other section.

This makes hidding/showing WC and OSC more consistent.
2026-03-10 08:56:23 +01:00
Kacper Michajłow 3ff7b04790 player/command: don't send mouse move event on mouse leave request 2026-03-10 08:56:23 +01:00
nanahi 1f430f8ce3 osc.lua: always wipe osc when idle
Prevents osc lingering when entering idle.
2026-03-10 08:31:15 +01:00
sfan5 07c3ff3725 command: reject negative offset for overlay-add 2026-03-09 15:43:32 +01:00
Kacper Michajłow cbecfb4046 wayland_common: add scRGB support 2026-03-09 12:00:33 +01:00
nanahi 19b2215142 include/mpv/client: remove mpv_suspend() reference
Removed in mpv 0.35.0.
2026-03-09 10:34:51 +01:00
Kacper Michajłow 14508544ea wayland_common: keep unaltered hint params for changed check
This avoids trying to set params on every frames, if they were modified
by the set color itself.
2026-03-09 10:18:30 +01:00
Kacper Michajłow be2336fcb3 wayland_common: warn on not supported color representation 2026-03-09 10:18:30 +01:00
Kacper Michajłow 040eb5b656 vo_dmabuf_wayland: add BT.2100 mapping 2026-03-09 10:18:30 +01:00
Kacper Michajłow 218be8d93a vo_dmabuf_wayland: use color parameters prepared in reconfig
Those has Dolby Vision metadata stripped and have all parameters
correctly guessed.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 63f3d1731a video/out/opengl/context_wayland: export preferred colorspace 2026-03-09 10:18:30 +01:00
Kacper Michajłow 012d9baa22 vo_wlshm: use image params after conversion 2026-03-09 10:18:30 +01:00
Julian OrthandKacper Michajłow 96e64b0e70 wayland_common: scale preferred luminances
Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2026-03-09 10:18:30 +01:00
Kacper Michajłow 66dcb2ba7b wayland_common: set luminances
This fixes --target-trc=linear output and makes our output luminance
ranges more explicit.
2026-03-09 10:18:30 +01:00
Kacper Michajłow fe9f917d8e vo_gpu_next: set color directly using Wayland protocol
Wayland color managment is not really flexible to be usable with Vulkan
color spaces, so set it directly.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 2417d17c81 wayland_common: only bind color surface when actually used
This is required, because other modules like Vulkan may need to use it,
and only single color surface is allowed in Wayland.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 4a815734e3 player/playloop: clear demux packet pool on idle
Packet pool is useful to avoid work and additional allocations when
switching files, going to idle should free the pool as those packets may
not be used for some time.

Fixes: #17525
2026-03-09 08:54:53 +01:00
zenodity 147c951a17 DOCS/man/input: add tablet-pos node map schema 2026-03-08 18:02:01 +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 937e67e7b1 DOCS/man/input: fix typo 2026-03-08 13:07:37 +01:00
nanahi 276710318f osc.lua: make logo centered 2026-03-08 13:07:37 +01:00
nanahi 107b5bee0a osc.lua: render logo and osc on separate layers
Allows rendering logo and osc at the same time to be used by the next
commit.
2026-03-08 13:07:37 +01:00
nanahi e3f6e5d8ed auto_profiles.lua: evaluate conditional profiles on on_loaded hook
This allows conditional profiles to evaluate on the properties only
available in on_loaded stage before the media is shown to the user.
2026-03-08 13:07:05 +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
Kacper Michajłow 396bf65ec5 select.lua: fix crash on user_profiles sort
The list is filtered, so we need to not use index of the input.

Fixes: Lua error: attempt to compare string with nil
2026-03-08 11:50:08 +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 a205e95efb ci/win32: change from choco to winget
Chocolatey is unstable recently, let's try winget.
2026-03-07 12:30:51 +01:00
Kacper Michajłow 289bcb9e13 Revert "ci/win32: downgrade meson to 1.9.2"
This reverts commit 95c7599c41.
2026-03-07 12:30:51 +01:00
Kacper Michajłow debfdf9402 ci/win32: pre-generate SPIRV-Tools build-version.in
Work around meson's cmake module not supporting OBJECT_DEPENDS [1],
which broke the build after SPIRV-Tools removed the explicit
spirv-tools-build-version target [2].

[1] https://github.com/mesonbuild/meson/issues/9062
[2] https://github.com/KhronosGroup/SPIRV-Tools/commit/54ad621f6e3fa758c1b80981489fcf0b62d2b752
2026-03-07 12:30:51 +01:00
Kacper Michajłow 9548ec5531 osc.lua: avoid use of goto
For Lua 5.1 compatibility.
2026-03-07 07:28:13 +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 74e8cee80d vo_gpu_next: always clip hdr.prim to container primaries
It may happen that .hdr.prim is set from display properties and exceeds
.primaries. This would make gamut mapping work incorrectly.
2026-03-06 16:17:58 +01:00
llyyr 3b55bc9795 wayland: dispatch queue until image_description_pending flag is cleared
wl_display_roundtrip performs one roundtrip one the queue, but there's
no guarantee that the callback will be invoked within that roundtrip.

Instead of hoping one roundtrip is enough, dispatch the queue until the
pending flag is cleared explicitly.
2026-03-05 19:16:30 +01:00
nanahi 10ed4716a7 etc/restore-old-bindings.conf: add changed bindings
Changed in: 7bfa2cfd3d,
8da6e8ad55
2026-03-05 19:14:55 +01:00
Kacper Michajłow 45019b21bf osc.lua: clean areas autohide
Fixes some corner cases with showing/hiding zones.
2026-03-05 16:34:22 +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
Guido Cella a9ac97a5b0 DOCS/man/lua: remove REPL reference
It is a leftover of the original repl.lua name. Follow up to 9551de6385.
2026-03-04 14:11:16 +01:00
WhitePeter c401ef9c3b screenshot: use mp_strip_ext for %F
Reuse existing functionality, see previous commit introducing above
function.
2026-03-03 03:06:39 +01:00
WhitePeterandGuido Cella 648fc933b1 misc/path_utils: new mp_strip_ext shorthand
There are at least two users of this functionality, the filename/no-ext
property and the screenshot template %F specifier. The latter uses a
buggy private version. So split out what the former does, so it can be
reused.

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-03-03 03:06:39 +01:00
WhitePeterandGuido Cella 5dba9c52c0 misc/path_utils: fix mp_splitext bugs
The detection for leading dots was in the wrong place, in case path was
not already a basename. Fixed by acting on basename. Also all leading
dots are now getting skipped, otherwise the root of `path/to/...ext`
could end up as `path/to/..` which in the wrong place/context would mean
directory traversal.

Additionally, since we act on the basename there is no longer a need to
test for trailing path separators. The previous check also did not
account for Windows paths with \ separators.

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-03-03 03:06:39 +01:00
WhitePeter 9ecbf5c878 screenshot: remove redundant mkdirp call
There is no reason to create the screenshot dir separately, because the
final path starts with it. So defer creating directories to the last
possible moment with all the information necessary.
2026-03-03 03:06:39 +01:00
WhitePeterandGuido Cella d2877a1cdb screenshot: fix %f with trailing slashes
URLs can end with trailing slashes (/) which in turn results in GNU
basename[1] returning the empty string, i.e. when the filename property
is queried. Instead use the whole path for everything that ends with /.
Subsequent path sanitation takes care of translating invalid path
component chars.

Issue reproduction steps:
```
mpv \
    --screenshot-dir=$HOME/mpv-shots \
    --screenshot-template='%f/%P' \
    https://example.org/video/
```
This would result in %f expanding to '' and thus render
screenshot-template an absolute path which, for some reason, would in
turn take precedence of screenshot-dir and hence result in a
non-writeable path, i.e. `/timestamp.ext`.

With this new approach the resulting path looks like this:
`/home/user/mpv-shots/http:__example.org_video_/timestamp.ext`

[1] https://github.com/mpv-player/mpv/pull/14635#issuecomment-2269456187

Co-authored-by: Guido Cella <guido@guidocella.xyz>
2026-03-03 03:06:39 +01:00
llyyr 35443a74cb vo,vo_dmabuf_wayland: remove vo_wait_on_vo
Not needed after previous commit
2026-03-03 03:01:41 +01:00
llyyr 8012dc88f7 wayland: do a roundtrip to wait for image description creation
Also switch to a different event queue to ensure there are no other
events in the queue.
2026-03-03 03:01:41 +01:00
Kacper Michajłow c55bdc3282 video/out/gpu: signal correctly if set_color is supported
set_color conceptually is a swapchain command, but in Wayland it's
implemented in ra_ctx, so we have one jump of indirection. Having
`set_color` defined for context_vulkan doesn't mean that all ra contexts
support it. Add a bool to mitigate this.

This could be structured differently, but should be fine.

Fixes: #17487
2026-03-02 02:04:36 +01:00
Guido Cella af9c81fa1e DOCS/man/options: don't recommend --sub-justify=left
It is unclear why this should be recommended. If it were recommended it
would be the default. The consensus is that centered justification looks
better.
2026-03-01 08:24:39 +01:00
Guido Cella 05fac7f21e DOCS/man/lua: document remaining input.select() fields
Document more shared fields with input.get().

I originally omitted them because they didn't seem useful for
input.select(), but now opened can be used to override keybindings, and
default_text = "'" can be used to default to exact search (which I do
for history in my build).

closed, default_text and cursor_position may be used to remember the
last input line for the next call.
2026-02-28 22:41:26 +01:00
nanahi fc7f6e0208 osc.lua: fix mouse position init
get_virt_mouse_pos() can return dummy -1, -1 in some cases, for example
when mouse is not considered "in" the area. render() is called
immediately and sets the initial mouse position to -1, -1 when the first
tick happens.

When starting player and mouse is already on the window but not moved,
then move the mouse, the mouse_move handler thinks that the mouse moved
from -1, -1 to the current position, triggering showing even when the
amount moved is less than osc-minmousemove.

Fix this by not letting render() init mouse position if the position is
dummy -1.
2026-02-28 22:39:24 +01:00
Kacper Michajłow 3511e467e7 vo_gpu_next: use typed variable for alpha 2026-02-28 13:32:19 +01:00
Kacper Michajłow 2e8520311c vo_gpu_next: fix rgb range in Wayland hint
Fixes: 9d2da2567c
Fixes: #17479
2026-02-28 13:32:19 +01:00
Dudemanguy bcfc754f03 wayland: invert image_description_processed boolean
Depending on the state being true before advancing through frames works
but it's error prone and leads to various edge cases you have to account
for (e.g. like 339ac9b305). It's better
invert it so that setting color management is the special case that sets
the boolean to true to stall the playloop. The logic can then be
simplified, and the vo_wayland_handle_color call is moved up to be
directly after we create the buffer.
2026-02-28 10:50:38 +01:00
Dudemanguy f864f9a14a wayland: use set_color for vo_wayland_handle_color
Move this out of swap_buffers. This makes it more consistent with what
vo_dmabuf_wayland does.
2026-02-28 10:50:38 +01:00
Dudemanguy baad29c1f4 context_drm_egl: use set_color for handling colorspaces
With this ordering, we ensure that the colorspace is set before the
first atomic commit.
2026-02-28 10:50:38 +01:00
Dudemanguy 9d2da2567c video/out/gpu: add set_color ra_swapchain_fns
Anything related color management gets complex and there is a lot of
platform-specific code that gets called in relation to this. Currently,
this stuff gets called in various places in the render loop which mostly
works but it's prone to "off by 1 frame" errors and also isn't clean.
Introduce this helper to hopefully unify all this kind of stuff under
one umbrella. For integration with vo_gpu_next, this needs to be called
before flip_page and we should stop abusing target_params for this
purpose. The next couple of commits will implement this in two places.
2026-02-28 10:50:38 +01:00
Dudemanguy 2268297ac4 context_drm_egl: use target_csp to signal HDR
For the drm context, we can use the target_csp so vo_gpu_next knows what
colorspace to output to. We just need to be sure the monitor is able to
display bt2020. For now, all we detect on the EDID side is either pq or
hlg so ensure at least one of those works before we send back something
to vo_gpu_next to use for target_csp.
2026-02-28 10:50:38 +01:00
Dudemanguy 7dd06a6c0b video/out/gpu: remove pass_colorspace ra_ctx_fns
This was originally added way back when specifically for drm so it can
play  nice with libplacebo for HDR. This is pretty ugly though and a bit
hacky. There's a better way to integrate this with target_csp. So drop
the pass_colorspace stuff in this commit and we'll change the
implementation in the next commit.
2026-02-28 10:50:38 +01:00
Nicolas F f28cea85c1 ytdl_hook.lua: use the new request_size AVOption when needed
Some sites throttle requests, but throttling can be avoided with many
small range requests. yt-dlp implements a "http_chunk_size" key in its
-J output to inform us of the ideal size.

https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21703 has just been merged,
which allows use the http_chunk_size to greatly speed up how fast
YouTube videos get loaded into the cache by mpv.

Should the FFmpeg that mpv is built against lack the request_size
AVOption, then this will silently not do anything new, so no version
checks are needed.

Specifying multiple_requests=1 like suggested in
https://github.com/mpv-player/mpv/issues/8655#issuecomment-3872689494
does not seem necessary.

Fixes #8655.
Supersedes #15612.

Co-authored-by: Nicolas F <ovdev@fratti.ch>
2026-02-27 20:18:55 +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 850677c157 input.lua: don't shadow the global type() function
For consistency, also rename type to event in defaults.js.
2026-02-27 18:12:52 +01:00
CogentRedTester a96bbf5c17 mp.input: sanitise client inputs
This commit should remove any unexpected behaviour or crashes
that
may be caused by users passing unexpected values to mp.input functions.

String and numerical options are now explicitly converted to strings and
numbers. Values which should be tables are set to empty tables, and
warning messages are printed to inform the user.
2026-02-27 09:51:14 +01:00
CogentRedTester 4d26c4e42c console.lua: guard against invalid arguments to script-messages
All but one of these guards should never be tripped
if people are using the mp.input
module. However, it could happen if non-lua/js clients were to use the
JSON API directly.

Currently, without these guards, calling these script messages with
incorrect arguments will almost certainly crash `console.lua`, hence
preventing any client from requesting input.

An error message has also been added for each guard to provide some
feedback as to why the arguments were invalid.
2026-02-27 09:51:14 +01:00
Guido Cella 3ec435dbee menu.conf: add a Reload menu item 2026-02-27 09:24:53 +01:00
Guido Cella 06259d1a0b input.conf: bind Ctrl+r to reload the current file
Because how to do this has been asked more than 10 times in #mpv, bind
it by default.
2026-02-27 09:24:53 +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 149e6dc55b commands.lua: return empty completions on early returns
The new async completion handling code expects an empty list of
completions to be returned if no completions should be shown.
2026-02-27 05:29:06 +01:00
NRK d54bad5636 screenshot: percent decode filename if it's a URI
any uri that's fed to mpv should be percent encoded already
(ffmpeg will sometimes do it for you, but it's heuristic is not
foolproof [1]).

but there's no reason for us to leak uri quirks into screenshot
filename, and it's generally not what users want either. so do
the obvious thing and percent decode the filename if it's a uri.

[1]: https://github.com/mpv-player/mpv/issues/17450#issuecomment-3953135707
Fixes: https://github.com/mpv-player/mpv/issues/17450
2026-02-25 17:36:37 +02:00
NRK 41463d6ac8 DOCS/man/mpv: document that URLs should be percent-encoded
most of the time not doing so will still work since ffmpeg has
some heuristics in place to detect if the url is percent encoded
already or not. but these heuristics are not foolproof and so
document this quirk explicitly.
2026-02-25 17:33:03 +02:00
Avi Halachmi (:avih) 92ed2d2ef0 github/issue_template: clarify "latest mpv version"
At the issue templates "tested with the latest version" checkbox, make
that a link to the latest version, revise the text slightly, and add
"or newer".

At the linux issue template, also note that if the distro does not
provide the latest version, then the issue should be reported to them.
2026-02-25 00:28:18 +01:00
CogentRedTester 4bb048c227 console.lua: prevent outdated completions from being selected
This commit flags when console.lua is waiting for completions, and
disables the completion cycle key until up-to-date completions are
received.

While this is happening, completions are not printed when in terminal
output mode. In normal OSD mode, the completions are still printed, but
at reduced opacity. This is to avoid distracting and ugly flickering
from completions being rapidly erased and redrawn.

The completion results are only dimmed after a short (sub-second) delay.
This is to avoid distracting flickers from the opacity
rapidly changing for clients that return completions almost immediately,
e.g., commands.lua.
2026-02-24 20:19:24 +01:00
CogentRedTester 9902e84e20 DOCS/interface-changes: change how mp.input completions are returned 2026-02-24 20:19:24 +01:00
CogentRedTester 5a1700a456 mp.input: avoid displaying outdated completions from the same client
Previously, completion responses from the same client would be displayed
even if the user had since changed the input, as long as a newer
complete event had already been sent. This meant that, if clients took a
sufficiently long time to return completions, then
console.lua would display completions for previous versions of the line
which were no longer valid.

This commit has the client send back the version of the line their
completions apply to, ensuring that `console.lua` displays the
correct completions.
2026-02-24 20:19:24 +01:00
CogentRedTester c568e1539f commands.lua: use new mp.input complete method
Updates to use the new response function passed to
`complete` events to send completions back to `console.lua`. This is to
pre-empt the old return value method being deprecated.
2026-02-24 20:19:24 +01:00
CogentRedTester c72f2add25 mp.input: allow async completions
Previously, it was impossible to generate a list of completions for an
`input.get()` request asynchronously, as the values had to be returned
by the callback function.

This commit provides a way to send completions asynchronously by passing
a second argument to the complete callback; a function which can be
passed the return values to respond to the complete event.
2026-02-24 20:19:24 +01:00
CogentRedTester cf481faa72 DOCS/man/lua: update recommended use of the mp.input opened event
Now cites overriding keybinds as the most notable use of the `opened`
event.
2026-02-24 20:12:57 +01:00
CogentRedTester ae965e7a7e console.lua: remove undocumented dont_bind_up_down option
This undocumented option was used by `stats.lua` to prevent the page
scroll keys from being overridden by `console.lua`. The previous commits
have removed the need for this hack, so it is now safe to remove.
2026-02-24 20:12:57 +01:00
CogentRedTester de0f2f943d stats.lua: correctly override mp.input keybinds
This commit uses the opened event to ensure that the page scroll keys
(`UP`/`DOWN` by default) override the mp.input bindings,
without overriding any other mp.input keys.

This is much safer than the previous method, which required an
undocumented option to be passed to `mp.input`, and was hardcoded to the
default scroll keys.
2026-02-24 20:12:57 +01:00
CogentRedTester 0af0c137bb console.lua: flush keybinds before sending mp.input opened events
This commit uses the undocumented `mp.flush_keybindings()` method
to ensure that all `console.lua` keybinds are set before
sending the `opened` event to `mp.input` clients.

Previously, the keybinds would only be flushed when `console.lua` went
idle. As the `opened` event is sent before this happens, clients
processing the event may end up flushing their own keybinds before this
happens. This makes it unreliable to use the `opened` event to override
keybinds set by `console.lua`; for example, adding different
behaviour to `input.select` when using `Shift+Enter` instead of `Enter`.

This commit allows the `opened` callback to be used to safely override
`console.lua` keybinds.

.luacheckrc: move flush_keybindings to globals
2026-02-24 20:12:57 +01:00
llyyr e09a1d12f2 m_option: also clamp OPT_FLOAT values for float_set
This incorrectly used clamp_double function after 0e7f9c39dc when it
should've always used clamp_float instead. Use clamp_float instead

Fixes: 0e7f9c39dc ("m_option: correctly clamp OPT_FLOAT values")
2026-02-24 19:41:53 +01:00
Kacper Michajłow ae119448b2 m_option: remove duplicated code for float/double range check
The float version was missing "default" case. This fixes options with
M_OPT_DEFAULT_NAN.

Fixes: 0e7f9c3
Fixes: #17436
2026-02-24 19:41:53 +01:00
nanahi 3eb8f9a1de demux_lavf: get codec info from AVCodecParameters
This allows displaying codec info for all tracks without selecting the
track.
2026-02-24 19:36:33 +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
nanahi e6bd564723 demux_lavf: also make demux-bitrate available for video
Make it available as a property and on stats page 5.
2026-02-24 19:36:33 +01:00
nanahi b62e34d975 stats.lua: display file duration on page 5 2026-02-24 19:36:33 +01:00
nanahi 9ce6da09e6 stats.lua: add format entry to page 5 2026-02-24 19:36:33 +01:00
nanahi c3f11f8b7e stats.lua: rename format to codec on page 5
To be consistent with page 1 usage, where format refers to sample format
and not codec.
2026-02-24 19:36:33 +01:00
zenodity 4620834e36 DOCS/man/input: add/update MPV_FORMAT_NODE map and array pseudo structs 2026-02-23 20:06:02 +01:00
Guido Cella ee9a219600 console.lua: deduplicate code between get-input and handle_cursor_move 2026-02-23 17:40:11 +01:00
zenodity f439c7f62c m_option: fix x:y mode format when printing geometry
Previously, x:y mode geometry strings were incorrectly printed
using the WxH+x+y format.
2026-02-22 22:31:40 +01:00
Kacper Michajłow 250d6056c3 ci/win32: update runners to windows-2025-vs2026 2026-02-21 01:36:35 +01:00
Kacper Michajłow 5159300ba3 ci/win32: use vswhere to find Visual Studio 2026-02-21 01:36:35 +01:00
Simon Bruder 534b2d2ea6 {demux,player}: expose original and commentary track flags
Those flags were added to the Matroska specification together with the
already implemented hearing-impaired and visual-impaired flags.

They allow specifying whether a track is a commentary track or in the
original language without relying on the free-form track name, which
makes consistent tagging and parsing by machines easier.

Ref: https://github.com/ietf-wg-cellar/matroska-specification/pull/447
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-original-flag
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-commentary-flag
2026-02-20 20:31:04 +01:00
Kacper Michajłow f7ad4a5f8f vf_d3d11vpp: set output format for NVIDIA RTX Video HDR
It outputs RGB tone mapped image, set params accordingly.

Fixes: #17265
2026-02-19 19:18:56 +01:00
Kacper Michajłow 43f00135ea vf_d3d11vpp: add dots to logs 2026-02-19 19:18:56 +01:00
Kacper Michajłow 568522e69e vf_d3d11vpp: use ID3D11VideoContext1 interface for setting color space
This allows to use DXGI enums for color spaces, which supports PQ
transfers and so on. Old D3D11_VIDEO_PROCESSOR_COLOR_SPACE is limited
and doesn't support HDR formats.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 825ba4167e hwdec_d3d11va: add support for RGB formats
This will be useful for mapping RGB output from d3d11vpp tone mapping.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2aba5a7167 ra_d3d11: allow mapping rgba10_a2 format
This is needed for ra_get_imgfmt_desc() which otherwise would not allow
rgba10_a2 format, because it doesn't have all components with the same
size. However it's nativelly supported by d3d11, so we add it to special
formats, same as opengl does.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 18330cb1ed video/img_format: add repack test for new formats 2026-02-19 19:18:56 +01:00
Kacper Michajłow 54976fe147 video/img_format: add IMGFMT definitions for x2bgr10 and rgba16f
Will be useful for mapping hardware frames. We could add more formats
here, but those should be enough to allow RGB processing.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 71bc92a080 video/img_format: move IMGFMT_X2RGB10 from custom range 2026-02-19 19:18:56 +01:00
Kacper Michajłow 7b015a9846 video/img_format: remove custom rgb30 definition
It's supported in ffmpeg since 4.4, no need to keep custom code for it.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2b4b345a3a video/img_format: rename IMGFMT_RGB30 to IMGFMT_X2RGB10
It's supported in ffmpeg, so let's have naming parity.
2026-02-19 19:18:56 +01:00
Kacper Michajłow af47c1d43b vo_drm: don't define custom IMGFMT values
We should never make such mappings that are not covered by
img_formats.h.
2026-02-19 14:20:56 +01:00
Kacper Michajłow e9a3bf2ad1 vo_drm: use always little endian formats
DRM formats are little endian, unless the format is ORed with
DRM_FORMAT_BIG_ENDIAN.
2026-02-19 14:20:56 +01:00
Kacper Michajłow 73ae34e2d0 vo_drm: fix xbgr2101010 format mapping
Fixes: 6b452788c4
2026-02-19 14:20:56 +01:00
Kacper Michajłow c2c081f49a vf_d3d11vpp: use half-rate for IVTC mode
The optimal way would be to use custom rate based on telecine cadence,
but it's not supported by any driver in practice. So instead, allow
driver to field match and output with duplicated frames, which can be
removed using decimate filter.

Note that in practice all GPU vendors uses single video processor for
all deinterlacing, so IVTC will be done even if mode is not explicitly
selected. At least the field matching part, because correct rate output
is not supported. The main difference is that when selecting more we
output at video frame rate, not field rate.
2026-02-18 18:13:18 +01:00
Kacper Michajłow f571fd73a1 vf_d3d11vpp: print supported custom rates 2026-02-18 18:13:18 +01:00
Kacper Michajłow 2141fa88b3 vf_d3d11vpp: fix deinterlacing
There were multiple issues in API usage, not setting correct
OutputIndex, lying about frame field parity to make it work without
OutputIndex. Not passing reference frames which forced BOB mode always.

Fix all issues and allow forcing BLEND/BOB mode by not passing frames.
Blend mode also sets half rate output. Half rate could be separate
option too, but there is not much gain from it except for debugging
really.

Fixes: #15197
2026-02-18 18:13:18 +01:00
Kacper Michajłow 47ed5785e4 video/filter/refqueue: add mp_refqueue_output_fields 2026-02-18 18:13:18 +01:00
Kacper Michajłow db2352f69a vf_d3d11vpp: update mode selection logging 2026-02-18 18:13:18 +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 aa82213726 select.lua: don't set an empty prompt
Not needed since 44816ef8ff.
2026-02-15 16:36:28 +01:00
Guido Cella 102e693f49 select.lua: sort the track submenu
track-list doesn't necessarily return tracks sorted by type so we need
to sort them ourselves.
2026-02-14 01:07:27 +01:00
llyyr 1a160f9767 Revert "ci/tumbleweed: disable sanitizers for GCC build"
This reverts commit 5b0cfe8849.

Shouldn't be needed after previous commit
2026-02-14 00:43:52 +01:00
llyyr a7523a4afd demux_mf: satisfy gcc ubsan so it doesn't produce bogus warnings
Since we call bstr0 on the string anyway, might as well use it for
printing which implicitly includes a null check that gcc can see so it
doesn't produce the warning as seen in the next commit anymore
2026-02-14 00:43:52 +01:00
Dudemanguy 76a5eba991 player: don't mangle current playlist entry before initialization
Scripts and things using the client API can load up playlists in a
specific order and choose what file to start playing on by using the
loadfile or loadlist commands with the play argument. However if
starting from idle mode, it is possible to send these commands before
all scripts finish initializing. mpv's core then does a prepare_playlist
call on its own for startup which will nuke the current playlist entry
set by the API user and lead to an unexpected item being played. Fix
this by not unconditionally setting pl->current to NULL allow callers to
optionally always overwrite it by getting the first item in the playlist
(e.g. if it's called after startup anywhere else in the code). Other
options like --playlist-start or --shuffle are allowed to win if they
happen to be set.
2026-02-12 04:42:32 +00:00
Dudemanguy 3847a8157f wayland: handle all outputs disappearing without segfaulting
If you switch TTYs while mpv is playing, wlroots compositors will remove
all outputs from the registry. This segfaults when you switch back since
we try to access cleared memory. Rework this so wl->current_output is
given null when appropriate and properly guarded. You still need at
least one output to initially place the surface, but in general they can
all disappear during runtime and it should work. Change the log to
verbose because that becomes just noise in this case (switching TTYs).
The surface entrance event happens later and should get all the proper
parameters.
2026-02-10 00:46:55 +00:00
llyyr f0f9322c57 vo_dmabuf_wayland: only wait for image description if we have a buffer
Waiting for color management from the compositor doesn't make sense in
other cases and this breaks --force-window since the playloop doesn't
advance. Fixes #17391.
2026-02-10 00:35:28 +00:00
Dudemanguy d5bc61596d vo: clear request_redraw in render_frame only if video is playing
27a78276eb almost got it but it should be
an and condition not an or. When we unlock VO to draw the core, the OSD
can update after we flip the page and the player can also pause itself
in that time. That means that we will clear the redraw request but due
to the OSD update it actually needs to draw again. Because the player
paused itself in that time frame, this redraw gets lost and you have the
mismatch. The simplest way to avoid that case is to only clear the
redraw_request while mpv is playing. The paused case will always get
handled later in do_redraw so it does not get missed. The slight
downside is that it's technically possible to do a redundant redraw
(e.g. what if you pause before draw_frame), but this theoretical
inefficiency is deemed not really relevant or important enough to add
more confusing code to avoid. Fixes #17288.
2026-02-09 14:43:46 +00:00
Kacper Michajłow 4fd2600c65 d3d11: support --d3d11-output-format fully for gpu-next 2026-02-08 22:14:18 +01:00
Kacper Michajłow c9c039b7f1 d3d11: set pl_d3d11_swapchain_params.alpha_bits if alpha is needed 2026-02-08 22:14:18 +01:00
llyyr 67886c97dd vulkan: set pl_vulkan_swapchain_params.alpha_bits if alpha needed
We can try to calculate specific amount of bit required in the future,
and also populate color_bits field but for now this should suffice.

Ref: https://code.videolan.org/videolan/libplacebo/-/merge_requests/767
2026-02-08 18:52:56 +01:00
sfan5 60dd40d007 test/img_format: remove dead code 2026-02-08 11:51:26 +01:00
sfan5 e01165d3db test/repack: test draw_bmp at some uneven sizes
intended to discover bugs like f3c1dcf7a1
2026-02-08 11:51:26 +01:00
sfan5 272404533e test: add reference files for ffmpeg 8 2026-02-08 11:51:26 +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
sfan5 b6512e1f8d wayland_common: improve probing behavior and logging
Any errors when opening the display are now logged.
The WAYLAND_DISPLAY check now also logs and applies only when probing.
This means explicitly setting a wayland `--gpu-context` will always
try to open the display instead of "helpfully" refusing (in some cases).

see also: f6f1721101
2026-02-08 01:56:01 +01:00
Steve Williams 9ccd8899ff sub/draw_bmp: limit memset to available width in last slice
extends f3c1dcf7a1 for all lines not just
the last. This avoid unnecessary write every line and fixes a buffer
overflow for small enough images (for example 78x64).
2026-02-06 11:01:59 +01:00
Kacper Michajłow 97867450ba osdep/w32_register: fix EstimatedSize
Move PathCchRemoveFileSpec after actually getting the file size. It must
have been swapped at some point by accident.

Also use correct unit for the size.

Fixes: #17375
2026-02-05 23:23:38 +01:00
Steve Williams 339ac9b305 wayland: set image_description_processed when not using color mgmnt
otherwise wl->image_description_processed will always be false and
the window will not show.
Follows 468d34c9bd.
2026-02-05 16:07:15 +00:00
verygoodlee 70c893988a select.lua: quote and escape string arguments in menu item commands
try to define a `[foo \ "bar"]` profile in mpv.conf, the command
to apply it in context-menu is `apply-profile foo \ "bar"`,
which is obviously incorrect, the correct command should be
`apply-profile "foo \\ \"bar\""`.

for string arguments that may contain spaces or some special
characters, we need to quote and escape them in JSON-style,
fortunately, `utils.format_json` can do this very well.
2026-02-05 16:14:48 +01:00
Guido Cella ea82915ba7 menu.conf: change duplicate hints
Deduplicate:
Op&en and &Editions/Titles
&Quit and &Quit watch later
2026-02-03 21:05:38 +01:00
llyyr db22a4528f vo: reset wait_on_vo if render_frame is called without current_frame
Fixes a deadlock when switching vo before a frame is displayed (e.g.
with auto profiles) where we'd end up in a state where wait_on_vo is set
to true for the first frame and then draw_frame is never called again so
its value never changes even once dmabuf-wayland is ready to advance
frame

Fixes: 468d34c9bd ("vo: allow VOs to request waiting before advancing frames")
2026-02-02 01:04:16 +00:00
verygoodlee 40d2947fa3 DOCS/man/lua: fix the arg of callback function for "mp.register_event" 2026-01-31 16:56:13 +01:00
Guido Cella d6eeff690d select.lua: handle empty lines at the end of the file
Prevent a crash in this case due to lines[i + 1] being nil.
2026-01-31 14:26:04 +01:00
Guido Cella a0f593202a select.lua: handle carriage returns in menu.conf
Fixes https://github.com/mpv-player/mpv/pull/16816#issuecomment-3804029038
2026-01-31 14:26:04 +01:00
Guido Cella 2cef09820d context_menu.lua: apply disabled_color to separators
As per Samillion's suggestion, reduce the contrast between separators
and the background to match other context menus. Using the already
defined disabled_color works for this and seems to be what GTK and Qt
do at a glance.
2026-01-31 13:20:05 +01:00
Dudemanguy ee843f4db7 player/command: fix repeatable frame stepping with the seek argument
730062b510 fixed the problem with mouse
buttons but unfortunately we forgot to include repeated commands in the
condition. This effectively made any variant of "frame-step X seek"
unrepeatable even though it was supposed to be. So just allow those in
add_step_frame too.

Fixes #17348.
2026-01-31 01:20:14 +00:00
Guido Cella 01cb6433c0 select.lua: always observe --osd-playlist-entry
The playlist submenu does not update in this edge case:

- Have a playlist-count > 99 on the first vo-configured. This makes
  playlist() return before observing --osd-playlist-entry.
- Remove playlist entries until the count is < 100
- Change --osd-playlist-entry
- Show the playlist submenu before changing the playlist
2026-01-30 10:53:19 +01:00
verygoodlee c5c8e8a39a console.lua: allow scrolling up the log until only one line remains
Currently, if some log lines have very long text that actually
renders across multiple lines, even if you scroll to the top,
the topmost content will be pushed out of the screen by these
lines and will never be visible.

In STATS page 2/4/5/0, you can scroll down until there is one
line left on the screen, we can keep the scrolling behavior of
the log consistent with it.
2026-01-30 10:53:07 +01:00
Kacper Michajłow 54da0ba070 demux/packet_pool: unref packet early if we can do it without penalty 2026-01-28 18:40:19 +01:00
Kacper Michajłow a1ea4f3aec demux/packet_pool: always return default packet state from pop
This is not functional change, as pop() is only used in packet_create()
which already cleared the packet, but it's better to make it explcit.
2026-01-28 18:40:19 +01:00
Kacper Michajłow 3b17ab5d3b demux/packet: add demux_packet_unref helper 2026-01-28 18:40:19 +01:00
Guido Cella d79172ac3e select.lua: update the playlist submenu after playlist-move
Observing playlist-pos and playlist-count is not enough to update it
after playlist-move, but we can observe any playlist property with type
none to get notified of every MP_EVENT_CHANGE_PLAYLIST, even if the
property has not changed.

This is similar to the
mp.observe_property("vsync-jitter", "none", recorder) hack used by
stats.lua to replicate the deprecated tick event.

Fixes https://github.com/mpv-player/mpv/pull/16816#discussion_r2727498518
2026-01-28 15:21:38 +01:00
Guido Cella d1743b641b menu.conf: change duplicate hints
Deduplicate:
&Properties and Copy &path
C&enter and D&einterlace
&Speed and &Shuffle
2026-01-26 11:47:16 +01:00
Guido Cella eadba4469f menu.conf: add open-chat to the context menu 2026-01-26 11:11:38 +01:00
Guido Cella d7f0efb67b context_menu.lua: make ESC close only submenus when they are open
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3798278219
2026-01-26 10:50:50 +01:00
Guido Cella 70d3dc58e8 context_menu.lua: activate key hints with caps lock
Fixes https://github.com/mpv-player/mpv/pull/17316#issuecomment-3797615909
2026-01-26 10:32:05 +01:00
Guido Cella 7bfa2cfd3d input.conf: add context menu bindings
Rebind MENU to show the context menu. Shift+F10 is also bound because it
is a standard context menu binding.

MENU is not added to restore-old-bindings.conf because it is uncommon.
2026-01-25 20:56:42 +01:00
Guido Cella f4b37b6455 select.lua: populate the context menu
Make select.lua parse menu.conf on the first vo-configured and fill
menu-data with the properties referenced in menu.conf change. This is
disabled in the libmpv profile.

This is done from select.lua to reuse functions to format the data and
retrieve key bindings.

There is also a script-binding that opens the correct context menu
depending on --load-context-menu.

While the context menu is scrollable, for the playlist it is better to
start from around the current entry rather than from the beginning, and
since menu-data has no way to specify where to start, when there are
more than 25 items playlist items this adds … entries that open the
scrollable console menu when clicked.

input-bindings is parsed to show the shortcuts bound to commands. Since
it is not observable, it just uses the bindings from the first time the
context menu is opened.

Multimedia and numpad keys are also not shown to reduce clutter.

The old Context Menu section of the docs is merged in the more detailed
context_menu.rst to not repeat the same information.
2026-01-25 20:56:42 +01:00
Guido Cella 8f2d69e1cc select.lua: skip key bindings of forced input sections
Avoid showing forced key bindings by modal scripts that temporarily
overwrite keybindings, like console and stats. These have section
input_forced_$scriptName. Unfortunately this skips all keybindings added
with mp.add_forced_key_binding even if you may want to show them.

Also skip the OSC sections "input" and "window-controls"; these sections
are not called input_forced_osc because the OSC uses
mp.enable_key_bindings() directly instead of mp.add_key_binding().

This mainly benefits the shortcuts in the context menu that the next
commit will add, but is also useful select/select-binding.
2026-01-25 20:56:42 +01:00
Guido Cella df7ac1d931 command: add the default-menu property
This property contains the builtin etc/menu.conf, and will be used by
select.lua. It is undocumented because it is for internal usage.
2026-01-25 20:56:42 +01:00
Guido Cella 19adc2d509 menu.conf: add this file
Add a default context menu definition in etc/menu.conf. It will be used
to populate the context menu.

The format is meant to be easily readable with just tabs as separators
and submenus denoted by indentation. It avoids complicating the builtin
input.conf like similar scripts do.

By not defining the shortcut keys in the builtin input.conf, menu
entries won't be associated to wrong shortcuts when the user's
input.conf changes key bindings without redefining the menu. Note that
external scripts don't have this issue.

I used 3+ spaces as separators at first but then realized that since we
have Windows users tabs will look better in editors with proportional
fonts like notepad, though it still won't be perfectly aligned depending
on the font. But I am still not sure what is better.

On a curious note, etc/menu.conf already existed in the past as mplayer
used to have a menu. git log -p etc/menu.conf will show commits from
2002 to 2011.
2026-01-25 20:56:42 +01:00
Guido Cella 7e38052138 input.conf: format some commands more consistently
The formatting of input.conf commands is totally inconsistent. At least
for the commands that will be used in the context menu, make it
consistent. The next commit will define the context menu commands, and
the keys bound to these commands will be shown in the menu only when
they match exactly, so this avoids copy pasting commands with
inconsistent formatting just to make them match.
2026-01-25 20:56:42 +01:00
Kacper Michajłow 6136c01f95 win32/menu: add mnemonic v for mpv sub-menu
`m` is taken by `Move`, use `v` as it's closer to alt+space than `p`.
2026-01-25 15:39:20 +01:00
Guido Cella e99a9168c1 context_menu.lua: implement key hints
When a character in an item's title is preceded by &, underline it and
activate the item when pressing the character.

Cycling between multiple items with the same hint is not supported.

&& escapes & so it works like the Windows context menu.

Hints after &&&, or greater odd numbers of &, are not supported since
Lua patterns don't support {n,m} quantifiers.
2026-01-25 05:21:49 +01:00
Kacper Michajłow dc5145c01d win32/menu: resolve system menu identity crisis
Don't reset system menu state, when menu data is empty, just disable the
items as needed. Fixes erratic behavior of system menu.

Fixes: 861908c70f
Fixes: #17290
2026-01-24 15:55:07 +01:00
Kacper Michajłow 3c09473327 Revert "ci/win32: manually install cmake to fix cpu detection issue"
No longer needed, upstream images has been fixed already.

This reverts commit e612f419f3.
2026-01-24 15:29:17 +01:00
Kacper Michajłow b5abb065a2 wayland_common: remove pl_color_space_infer
Common layer should alter target params anymore, it's on specific VO to
set correct params. Also this should be noop anyway, after
dmabuf_wayland fix in previous commits.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 43824e793b mp_image: call pl_color_space_infer in guess_csp
This will do a little bit more than only setting max_luma. Also will
fallback to bt.709/bt.1886, but that's fine. We would do it anyway
later.

If params goes through guess_csp, they shouldn't have "unknown" fields
anymore.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 9dd598def8 vo_dmabuf_wayland: ensure target params consistency 2026-01-24 14:08:08 +01:00
Filip Hejsek ed83c7c51e select.lua: add dvb_subtitle to the list of image subtitle codecs 2026-01-24 14:07:37 +01:00
Kacper Michajłow 9c6a3c06ec vo_kitty: add missing sequence end on unint
Fixes: #16299
2026-01-24 09:09:44 +01:00
Filip Hejsek 5d6f31f0a8 DOCS/man/options: fix typos and grammar errors 2026-01-24 08:02:28 +01:00
Steve Williams 16d9e12f37 wayland: add identity-rgb format mappings in color-representation 2026-01-24 08:00:07 +01:00
Filip Hejsek 7298ce13b0 test/samples: use mpeg2 codec for video samples
In CI, ffmpeg chooses vp9 by default, which cannot be muxed into mpegts.
2026-01-24 07:54:46 +01:00
Filip Hejsek c2882c3d81 player/loadfile: never autoselect tracks with wrong PID
Currently, we prefer selecting a track that matches the video program
ID, but can fall back on a track with a different program ID when there
is no such track or when no such track matches subs-fallback criteria.

Change this to instead select no track when only tracks with wrong PID
are available. Program ID will now act as a filter, not as a preference,
and only files with either matching or unset PID will be considered for
autoselect.

Also, ignore the program ID of external tracks, as it doesn't make much
sense to compare PIDs from different files.
2026-01-24 07:54:46 +01:00
Filip Hejsek 3e12e6fcff test/libmpv_test_track_selection: add a program ID matching test 2026-01-24 07:54:46 +01:00
Filip Hejsek bdbe40765a test/libmpv_test_track_selection: add a more complex locale test
The purpose of this test is mostly to verify that matching the OS
language is not wrongly prioritized over other things (like the forced
flag, matching the audio language, etc).
2026-01-24 07:54:46 +01:00
Filip Hejsek 79e87fa62d test/libmpv_test_track_selection: add a locale test with forced tracks
This is a copy of the existing locale test, but with forced flag added
to all tracks. The forced flag should not affect language selection in
this case.
2026-01-24 07:54:46 +01:00
Filip Hejsek 8aca078f09 test/libmpv_test_track_selection: add additional multilang test case
The new test case exercises --subs-fallback-forced=always and verifies
that default+forced is preferred over forced.
2026-01-24 07:54:46 +01:00
Filip Hejsek 6bae2c0f53 player/loadfile: simplify how external tracks are excluded
When autoload-files=no, external files are never selected. Simplify the
logic by excluding them up front instead of removing them afterwards.

This doesn't change the outcome of track selection, apart from edge
cases that are already broken because compare_track is not transitive.
2026-01-24 07:54:46 +01:00
Filip Hejsek a6cb319611 player/loadfile: simplify track selection logic
This fixes the problem that a subtitle track that normally wouldn't be
selected if it were the only track available could end up being selected
after a different candidate track was selected first.
2026-01-24 07:54:46 +01:00
Filip Hejsek 82dce233bc player/loadfile: clean up track comparison logic
This brings compare_track closer to implementing a consistent linear
order and fixes many broken edge cases.
2026-01-24 07:54:46 +01:00
Filip Hejsek 8d5fcade02 player/loadfile: remove forced param from compare_track
Use track->forced_select instead. The value would be assigned there
anyway after the track is selected and the field is not used for any
other purpose.
2026-01-24 07:54:46 +01:00
Dudemanguy 731450f883 opengl/context: remove unneeded ra_swapchain_fns redirection
We don't allow backends to override this anymore since
5ae0e0ff9a so we can just set it directly
in ra_swapchain.
2026-01-23 17:04:04 +00:00
Dudemanguy f74adc4243 opengl/context: require swap_buffers param for FenceSync
Commits 8854c74271 and
5ae0e0ff9a eliminated the external
swapchain API that the render backend (vo_libmpv) was previously using.
However, it was missed that this was being used to skip the
gl->FenceSync calls and that logic change was not properly accounted
for. This meant that vo_libmpv would leak fences since
ra_gl_ctx_swap_buffers is never called to clean them up.

Fix this by making sure the ra_ctx_params have swap_buffers defined
before calling gl->FenceSync. All platforms are required to implement
this anyway with the exception of vo_libmpv since it's a funny special
case. Fixes #17217.
2026-01-23 17:04:04 +00:00
Guido Cella dd50a4748e DOCS/man/commands: update an example
Use the new script name instead of relying on the backwards
compatibility script message.
2026-01-23 12:21:11 +01:00
Guido CellaandCogentRedTester cc1e654286 DOCS/man/lua: suggest keep_open for nested mp.input calls
Before 17551b2d43 keep_open was needed to make nested mp.input calls.
Even after that change it is still better to pass it to not show the
console quickly closing and reopening to the user, so recommend it.

Co-authored-by: CogentRedTester <cogent.redtester@outlook.com>
2026-01-23 10:15:04 +01:00
Kacper Michajłow 32a164cc01 DOCS/man/mpv: reference low-latency profile in network example
It makes more sense in this context, than `fast` profile.
2026-01-23 05:18:14 +01:00
Kacper Michajłow 11b2004b91 vo_gpu{,_next}: fix overriding scaling parameters for inherited kernels
If `{d,c}scale` is not specified the scaling kernel is inherited from
`scale`. This made all `{c,d}scale-*` options not work, as they were
silently ignored.

This commits inherits scale options, only if `{c,d}scale` options were
not adjusted in the config.
2026-01-23 05:18:14 +01:00
der richter df51d5500e ci/mac: install ffmpeg-full with homebrew when available
homebrew slimmed down their ffmpeg formula and stripping it off some
essential functionality.
https://github.com/Homebrew/homebrew-core/pull/261303

use ffmpeg-full instead. this is keg only formula and not automatically
symlinked system wide. make sure ffmpeg is not installed in parallel and
install ffmpeg-full system wide.
2026-01-22 09:43:45 +01:00
Kacper Michajłow 6e54aa328d builtin.conf: enable antiringing in high quality profile
General consensus is that ortho scalers antiring while fast is not that
good, let's use it in high-quality profile only.
2026-01-22 00:10:48 +01:00
Guido Cella 7858e1fdaf command: remember the language when reloading tracks
In 5871ba8f3e I took the language from the filename when reloading
tracks noting "that backing up t->lang and restoring it if nt->lang is
NULL would work incorrectly when lang is in the stream and it is removed
before reloading", but actually external tracks don't have language in
the stream, it is set in the container, and reload commands only affect
external tracks. So just back up the language before reloading and then
restore the old language.

This preserves the language after reloading when it is not in the
filename but it was specified manually in an add command, e.g. sub-add
foo.srt '' '' en.

Hearing impaired, forced and default flags were already being set from
their values from before reloading the track, so setting them again from
the filename only caused the same issue that they would get unset if
they were manually added with add commands.

We still don't restore the old language if nt->lang is already set for
the edge case of doing something like sub-add foo.mkv and changing the
foo.mkv's sub track language before reloading.
2026-01-22 00:10:02 +01:00
Guido Cella 2c893e8f30 command: set the language of added tracks from the filename
If you do sub-add foo.en.srt, it doesn't set lang=en.

Fix this by extracting the language from the filename, along with
hearing impaired, forced and default flags.

If a language is explicitly passed to sub-add and related commands, that
takes priority.
2026-01-22 00:10:02 +01:00
Guido Cella 1da08fa332 DOCS/man/options: document that --script is not limited to Lua 2026-01-22 00:08:53 +01:00
CogentRedTester 2aa727bc3d mp.input: send buffer ids with logs to avoid race conditions
This commit modifies the log methods in mp.input to always send the id
of the latest `input.get()` request with log entries.

Previously, the log methods applied to whichever input request happened
to be open when the log message was received. Even when scripts used
these methods correctly, there was the risk of sending a log to the
wrong log buffer if the active input request changed while the log
message was in transit; a race condition.

Now the id of the latest `input.get()` request is sent alongside the log
messages, preventing data races between scripts while also preventing
those logs from being discarded.
2026-01-22 00:04:35 +01:00
CogentRedTester 3ed9b798bb mp.input: avoid rare race condition when supplying completions
It was previously possible for completion messages to be received by a
new input request, if one was created while the message was in transit.

Since it is trivial to avoid this by passing the script name and
existing handle_id value, we may as well do so and guarantee that there
will not be any data races.
2026-01-22 00:04:35 +01:00
CogentRedTester 5d469e6bf5 mp.input: remove race conditions when calling input.terminate()
This commit ensures that `input.terminate()` can only close input
requests made by the same script, and prevents any in-transit events
for old input requests from being processed.

Previously, there was no way to guarantee that the input request being
terminated was the one intended; the asynchronous nature of the API
meant that it was always possible (though unlikely) that another client
may have activated its own input request while the termination request
was in transit.
This commit removes the race condition between different scripts calling
`input.terminate()` by sending the script name alongside the termination
message.

In addition, when a script overwrites one of its own input requests,
there may be incoming events still in transit. Some of these events may
have a decent chance of calling `input.terminate()` if they are
processed (e.g., `submit`). This commit avoids this issue by only
processing `closed` requests once a new `input.get()` request is made.
2026-01-22 00:04:35 +01:00
CogentRedTester 17551b2d43 mp.input: use unique event handlers for input.get requests
This makes changes to mp.input and console.lua so that every input.get
request uses a unique script-message to handle input events.

Previously, making new input.get requests shortly after the termination
of a previous request made by the same script could cause a race
condition where the input handler was closed but the new request
was still being drawn in the UI. This was caused by the `closed` event
for the previous request being received only after the new request was
registered, hence closing the event handler for the new request instead.

In addition, this commit makes the behaviour of calling input.get while
another request is active more consistent. When a new request is
received it overwrites the in-progress request, sending a `closed`
event. However, previously, the `closed` event could not be sent if both
requests came from the same script, as the new request would have
overwritten the event handler. Now, the `closed` event is called
regardless of where the new request comes from.
2026-01-22 00:04:35 +01:00
Dudemanguy 49b6d80e87 player/loadfile: possibly do a reset of sd_ass when turning on video
It's a pretty niche case, but if you start a file with no video with
animated ass subtitles and then turned on the video later, the subtitles
would not actually be rendered animated. This because the subtitles were
already decoded, and we do not do a check for animations expect in the
specific case of an image being played back on the video since the check
can be quite expensive. To fix this edge case, we just need to reset the
ass before doing the track switch in the case where we go from no video
to a track that's an image. SD_CTRL_RESET_SOFT is added as a a sub_ctrl
to accomplish this. Fixes #17268.
2026-01-21 15:18:08 +00:00
Dudemanguy fdb996adbc sd_ass: clear num_packets_animated on every reset
This should be done otherwise it could technically increment forever if
you constant reset.
2026-01-21 15:18:08 +00: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
Guido Cella 833e2f254e select.lua: link to mpv's IRC channel in the menu
Add a menu entry that opens mpv's IRC channel so users can quickly ask
support questions.
2026-01-21 11:27:07 +01:00
llyyr 491802918e f_auto_filters: rework --deinterlace=auto option
Before this commit, deinterlace=auto and deinterlace=yes had the same
exact behavior for d3d11 and vaapi, the only difference being that
`auto` would create/destroy the deinterlacing filter on every frame that
changed the deinterlace flag and with `yes`, we left that the
responsibility to determine whether to deinterlace or not to d3d11vpp
and vavpp and the filters were always inserted.

Inserting and removing filters on every frame the interlaced flag changes
is expensive and it will be more efficient to let the deinterlacing
filters handle this distinction instead.

With this change, `yes` works as it should: the filter is inserted
always and deinterlacing is forced regardless of the frame flag. `auto`
will insert the deinterlacing filter only when mpv sees the first
interlaced frame, and the filter will only deinterlace the frames marked
as interlaced. Note that perfect detection of interlaced frames is not
possible, and in such cases the user has to set `yes` manually.

One downside of this change is that we don't know if the filter is
actually deinterlacing or not, we can only guess that if the filter is
inserted and the frame is interlaced then it should be deinterlacing.
It's possible for it to fail for whatever reason, and it's also possible
future changes to ffmpeg (since bwdif implementation lives in ffmpeg),
might make the logic more complicated than this check. However, for now
this is good enough.
2026-01-21 08:40:50 +01:00
Kacper Michajłow f4db102a2e osdep/language-win: remove use of GetSystemPreferredUILanguages
The system preferred language is the language used during Windows
install. It doesn't have much purpose except that it is the backend
language for core Windows internals. All user facing dialogs and text
should follow the user preferred language, as this is what the user
selected and uses on daily basis.

It makes no sense to include system language in track selection.
2026-01-21 04:39:54 +01:00
Eugene Noble 868b9aa3ca DOCS/man/libmpv: fix typo 2026-01-21 03:54:27 +01:00
nanahi d6e7fb0597 options/options: add several audio extentions
mp1 - MPEG-1 Audio Layer I
mp2 - MPEG-1 Audio Layer II
mpc - Musepack
tak - Tom's lossless Audio Kompressor
tta - The True Audio
2026-01-20 07:49:17 +01:00
nanahi be5ed3bfd1 vo: wake up core when VO requests redraw
a74a324b98 returned responsibility of video
redraw back to playloop. The playloop is only run if something wakes up
the core.

However, the logic for VO requested redraw only wakes up the core when
in->want_redraw is false, which is only resetted by vo_redraw, called
from the core. This creates a situation where it can never wake up the
core, so redrawing never happens even when VO requests it.

efc44d05ff caused the issue to surface
because it also throttles VO requested redraws, and in some cases results
in the above behavior.

Fix this by always waking up core when the VO requests redraw.
2026-01-20 07:28:55 +01:00
llyyr b7e8fe949d wayland: move info_done variable to vo_wayland
vo_wayland_preferred_description_info is destroyed after info_done, so
obviously we can't store it here. This causes a use-after-free.
Embarrassing mistake

Fixes: 7a7d871d0a
2026-01-18 16:11:37 +00:00
Kacper Michajłow 5f6d5b3b7e ci/msys2: add build with -ftrivial-auto-var-init
Just to catch uninitialized variables early. Build all three                                                                                          unint/zero/pattern to compare the results between them and we don't                                                                                   accidentally depend on implicit initialization in tests.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 5fbd1caee2 ci/msys2: build also clang64 without ASAN
To cross compare results on basic build.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 1db89a546a Revert "ci/build-msys2.sh: disable pdf-build for clangarm64"
This reverts commit 25aa402f1d.
2026-01-18 12:59:16 +01:00
Kacper Michajłow a339fe58b5 osdep/language-win: fix use of GetUserPreferredUILanguages()
Commit baf2fd2f28 fixed this for 2nd call
to GetSystemPreferredUILanguages(), but apparently regressed the 1st
call, duh.

To retrieve the size both buffer has to be NULL and size 0.

Memory has a lot of zeros, because it has been working quite
consistently on CI.
2026-01-18 11:09:00 +01:00
Dudemanguy 468d34c9bd vo: allow VOs to request waiting before advancing frames
This is essentially for vo_dmabuf_wayland, but there is a race condition
during initialization where we should wait on an event from the
compositor to set the appropriate description for the image (namely for
color management) before flipping the page. Previously, there was an
off-by-one frame difference which resulted in the initial frame not
being appropriately color managed. Fix this by telling the core render
loop that it is not ready for the next frame. This keeps the frame queue
from advancing and allows the backend to process events appropriately
until it signals that it is ready.
2026-01-17 04:58:17 +00:00
Simonas Kazlauskas 1af136bceb ao_pipewire: remove the node.always-process attribute
With `node.always-process` mpv will force pipewire to continuously keep
driving the source node, even when paused, which causes a relatively
significant increase in power consumption due to frequent CPU wakeups.

I have tested mpv with this option disabled, both for music and video,
pausing and seeking around in various ways and could not notice any
problems with this option disabled. And with it disabled pipewire
properly becomes idle a couple seconds after video/audio is paused.

Pipewire documentation suggests that this option is largely useful for
JACK clients, which `mpv` isn't. Using GitHub-wide search it seems like
the other two notable uses of this property are really just SDL and
OpenAL. All other applications I use work well without this property
being set as well.

Note that this change does not affect the output devices differently as
far as I can tell. Both with and without `always-process` pipewire will
suspend the output device after some idle time and in case
`always-process` is enabled, it will redirect `mpv` to `Dummy-Driver`
instead.
2026-01-17 04:55:01 +00:00
fkroener 00774f5b85 DOCS/man/options: fix typo (double "for") 2026-01-16 00:49:36 +01:00
Hubert Głuchowski fa44f67b0b sub/sd_sbr: pass track language to sbr_load_text
The language hint is required for *correct* handling of RTL in srv3 so
provide the best-effort guess from the subtitle track.

Without this hint some RTL paragraphs are going to be wrongly assumed
LTR and reorder incorrectly. Additionally, subrandr may soon start
treating srv3 segments as `inline-block`s which means guessing is not
going to be possible anymore (at least as part of unicode bidi algorithm).
2026-01-16 00:48:55 +01:00
llyyr 7a7d871d0a wayland: move image description info to separate queue
Helps with presentation when compositor tries to ddos applications, for
example when moving the brightness slider on Kwin.
2026-01-15 17:03:18 +00:00
Hubert Głuchowski 2007f5543c sub/sd_sbr: use instanced rendering to avoid blending in software
The instanced API allows a lot of work to be offloaded to the GPU and
makes software rasterization tolerable performance-wise in most cases.

This is similar to sd_ass but there are some substantial differences:
- It uses a BGRA atlas to allow drawing bitmap emoji.
- De-duplicates images internally to significantly reduce atlas size by
  reusing the same atlas image for different instances.
- Exploits bilinear interpolation to further reduce atlas size of some
  primitives. For example this allows reducing background boxes to one
  very stretched pixel.

Bumps subrandr requirement to `v1.1` since this API is not present in
earlier versions.
2026-01-14 01:56:18 +01:00
Hubert Głuchowski 0babb5778b sub/ass_mp: split out packer into a separate file 2026-01-14 01:56:18 +01:00
Dudemanguy 7ce58f7a07 DOCS/contribute.md: address the AI menace
It's the future and well contributions of this nature aren't going to
disappear. Might as well address it in the contribute.md hope that maybe
a would-be vibe coder out there does a slightly better job before
sending anything our way.
2026-01-13 17:00:17 +01:00
Guido Cella bbcd68f8ed demux_playlist: expand tilde placeholders in playlist files
This allows playing something like an m3u containing ~/foo.mp4 or
~~/foo.mp4.

URLs like memory://#EXTM3U\n~/foo.mp4 also work.
2026-01-12 15:10:37 +00:00
Guido Cella 8bbcdec992 Revert "{osc,select}.lua: show playlist entries with trailing /"
This reverts commit ee05804bfa. Only the
select.lua part since osc.lua list formatting was removed.

Since playlist/N/filename is now normalized, it is never going to have
trailing slashes so there is no need to strip them.
2026-01-12 15:10:37 +00:00
Guido Cella fc86b96a8a various: don't normalize playlist filenames again
Since the previous commit normalized playlist filenames when they are
stored, the code normalizing them can be simplified back to how it was
before implementing normalization.
2026-01-12 15:10:37 +00:00
Guido Cella dfb4164097 common/playlist: store normalized playlist filenames
This normalizes the playlist/N/filename sub-property, making it
consistent with path. As a consequence playlist-path and stream-path are
also normalized.

This will allow simplifying the code by not normalizing playlist
filenames in several places, similar to 23b57e9f7f for tracks.
2026-01-12 15:10:37 +00:00
Guido Cella 616149744a misc/path_utils: ensure mp_normalize_path never returns NULL
If the current working directory or the realpath could not be retrieved,
return the path as it was passed to mp_normalize_path() to avoid
guarding the return value. This is also makes it consistent with what
the Windows code was doing.
2026-01-12 15:10:37 +00:00
Guido Cella 2871471f31 demux_playlist: add base paths when adding playlist entries
Currently entries in playlist files like m3u are first added to the
playlist, and then if they were relative paths the playlist file's
dirname is prepended to them.

Change it to directly add entries with the correct path. This will be
needed to normalize playlist entries as soon as they are added, else
normalization would prepend the working directory to entries with
relative paths.

demux_cue, demux_edl and demux_mkv_timeline don't need to be modified to
work with the next commit.
2026-01-12 15:10:37 +00:00
llyyr 363341afea vo: don't set request_redraw on redraw path
We need to acquire in->lock first before setting this flag, but if we
take this path then request_redraw is true already. So fix the data race
by just not re-setting the value.

This fixes data race detected with checking in->request_redraw value in
vo_redraw detected with TSAN
2026-01-12 09:15:45 +01:00
Brad Barden 39d7bbe2bf video/out/drm_common: fix uninitialized var
Add a missing variable initialization. The variable is only conditionally set
later. Then there is a check for a NULL if no CTA block was found, but the
value is instead uninitialized memory. There would then be a segfault when the
pointer is de-referenced.
2026-01-11 18:30:03 -06:00
der richter beddaec5ab mac/view: make our view aware of possible transparent rendering
the default value of isOpaque is false and it was always assumed that
underlaying content needs to be rendered and blended in some way.

make it dependent on the layer's isOpaque property, which theoretically
could increase render performance.
2026-01-11 13:48:58 +01:00
der richter ce694c1eba mac/common: add support for transparent rendering
this adds support for possible transparent rendering by setting the
window and layer background to transparent.

NOTE: atm only possible with libplacebo master.
2026-01-11 13:48:58 +01:00
der richter 9aebe4cb01 mac/vulkan: force proper opaque state on metal layer
MoltenVK sets this to false even when no transparent content is
rendered. this prevents direct-to-display rendering from working.
2026-01-11 13:48:58 +01:00
Kacper Michajłow 9483d6e12f ci: cancel pr jobs after new push
github.head_ref is only defined for pull_request event, so only those
will be grouped, the rest will fallback to unique run_id, so we neither
cancel them or serialize.
2026-01-10 02:48:15 +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
Kacper Michajłow 3d980d8ecc w32_common: release all input when entering context menu 2026-01-09 20:16:23 +01:00
Kacper Michajłow 2b50cecf86 w32_common: defer context menu update to WM_INITMENU
This avoids issues when menu-data property is updated while context menu
is open.
2026-01-09 20:15:48 +01:00
llyyr 9229d52e75 vo_gpu_next: undo dither-depth=auto meaning 8bpc for SDR when undetected
This commit effectively reverts f914947dda

We don't need this hack anymore
2026-01-09 20:05:37 +01:00
llyyr 81687dbf27 video/out/vulkan/context_wayland: implement color_depth
In f914947dda we implemented a hack to
force 8bpc dithering for SDR playback, because at the time nothing in
the pipeline was doing dithering. mpv would pick 16bpc swapchain, dither
down to 16bpc, then it'd be presented to the user's display as-is and
result in banding. There is no way to detect the real on-the-wire bpc,
so we told users to configure dither-depth manually.

However, it seems most compositors that do color management now handle
10-16bpc input just fine without any banding, so instead implement
color_depth to effectively set dither-depth=auto for compositors that
support expose color_manager and keep the 8bpc hard default for others.

Fixes: https://github.com/mpv-player/mpv/issues/17222
2026-01-09 20:05:37 +01:00
Guido Cella 85bf9f4ff4 console.lua: only clip items between UTF-8 characters
Since with the new horizontal scrolling the end of lines can be visible,
ensure not to clip lines in the middle of UTF-8 characters to not show
mojibake, also adding … to show when items are clipped.

Also replace the existing use of ⋯  with …
2026-01-07 01:09:00 +01:00
Guido Cella a385c0635b console.lua: implement horizontal scroll
Bind Shift+LEFT, Shift+RIGHT, Shift+WHEEL_DOWN, Shift+WHEEL_UP,
WHEEL_LEFT, WHEEL_RIGHT to scroll the menu horizontally.

This lets you see long items that get clipped, like long history entries
and key bindings.
2026-01-07 01:09:00 +01:00
Guido Cella 86466b5745 console.lua: bind Shift+UP and DOWN to scroll the log
We don't know how many log lines wrap, so scrolling the log with page up
and down with wrapped lines would skip lines, and those are also already
bound to history navigation.

This therefore only implements scrolling of one item at a time. While
not perfect because when the item is wrapped it scrolls multiple lines,
it is usable.

The number of log lines kept in memory is increased from 100 to 10000.

Closes https://github.com/mpv-player/mpv/discussions/14718.
2026-01-07 01:08:00 +01:00
verygoodlee 3315ef8f32 console.lua: avoid empty lines at the bottom after resizing window
with `scale_with_window=no` script option, `first_match_to_print`
increases when shrinking the window and no longer decreases when
expanding the window, causing empty lines at the bottom of menu
and a chain reaction of the script crashing due to the mouse wheel
scrolling up.

this commit trys to decrease `first_match_to_print` when its value
is abnormal.

Closes #16682
2026-01-07 01:01:39 +01:00
nanahi 39e5d29879 player/playloop: handle force window in playloop
813c112329 moved force window to option
callback. This happens before the loading of the file has finished
(which is supposed to trigger handle_force_window) so it is too early to
handle certain cases, such as loading of album art failed and therefore
window will never be created because there is no video track.

Adding force window check in playloop to make sure window is always
initialized after file loading is complete.

Fixes: 813c112329
2026-01-07 01:01:11 +01:00
Kacper Michajłow e75a174743 ci/win32: add subrandr
Wrap subrandr build process into meson custom target.

Meson's custom target allow only file output (without path component),
so additionall copy step is added to get the library. Dummy stamp file
is used to connect custom target to dependency, the file is actually not
created, so target will be called each time, but it's fine, because
cargo will resolve it's own dependencies this way and build if needed.

This is glued only for static lib, this is what we need for our CI
script.
2026-01-06 13:58:11 +01:00
Kacper Michajłow 273f1db49e player/loadfile: indent file metadata if it is multiline
And sanitize a bit.
2026-01-06 13:57:21 +01:00
Kacper Michajłow 6c160f1aa8 common/msg: allow only SGR sequence in terminal output
Sanitize the remaining control codes to mitigate malicious files or
scripts that could manipulate the terminal in unintended ways, such as
clearing the screen or changing the terminal title. While the
surface-level impact may seem minimal, control codes can be a vector for
exploiting vulnerabilities in the terminal emulator itself. This can
occur without user interaction, since file tags are displayed by default
in mpv.

Reported by: zefr0x
2026-01-06 13:57:21 +01:00
der richter c63fe8ab95 ci/mac: remove unneeded FFMPEG_SYSROOT pkg-config path
this seems to be a remnant of the very old travis build.
see 56d31ae190
2026-01-06 11:37:14 +01:00
der richter aa0f4e32ba ci/mac: add homebrew libarchive pkg-config path to PKG_CONFIG_PATH
libarchive can't be linked globally because macOS already has an old
outdated version installed.
2026-01-06 11:37:14 +01:00
der richter 5bee8f0f7f ci/mac: add missing libraries for consistency with other platforms
add libbluray, libarchive, libcaca, libcdio-paranoia, libdvdnav,
rubberband and zimg to macOS builds for consistency with other platforms
and detection tests.
2026-01-06 11:37:14 +01:00
der richter b38d22efa8 github/issue_template: add IDs to textarea fields for URL queries
adding IDs to the fields makes them pre-fillable with a URL query.

adds the possibility to procedural generate links to pre-fill specific
data. for example, mpv/library version or platform version data.

possible application, menu entries or CLI output to submit bug reports.
2026-01-06 11:34:16 +01:00
llyyr 0035bb7cbd path-unix: check fopen value, and also call fclose 2026-01-04 21:50:04 +01: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 72efbfd009 version.h.in: bump copyright year 2026-01-01 13:26:59 +01:00
Kacper Michajłow f57c5ca422 ci/win32: upload pdb separately
The job id is now in the artifact filename, so we can identify the
matching pdb file.
2025-12-31 02:04:15 +01:00
Kacper Michajłow afa090317b ci: make artifact names more descriptive
Add git hash, job id and avoid double zipping.
2025-12-31 02:04:15 +01:00
Guido Cella 5cc1094ad6 console.lua: remove selected_color and selected_back_color
42660a8c23 renamed selected_color and selected_back_color to
focused_color and focused_back_color. The new names have been in a
release so remove the backwards compatibility check.
2025-12-30 17:03:48 +01:00
m154k1 468e2a8475 vulkan/context: add driver name to --vulkan-device=help
Some platforms (like macOS) may have multiple Vulkan drivers installed,
so the device list can contain devices with the same name.
Adding driver name to the list of devices can help with identification.
2025-12-29 11:24:36 +01:00
Attila Fidan 4ecf7293f5 playloop: unset last_chapter_flag when queueing non-chapter seeks
This fixes a race condition where if a non-chapter seek is queued
immediately after a chapter seek is queued, the chapter property may
become unavailable until a new file is loaded.

If multiple seeks are queued within the same playloop iteration, only
the last seek is executed. Because the chapter seek is never executed,
last_chapter_flag remains set and last_chapter_seek becomes -2, which
causes get_current_chapter to return -2, which makes the chapter
property unavailable.

Unset this (and also last_chapter_seek) immediately rather than
wait for seek execution, like chapter seeks set these immediately.

Fixes: 233f1e46f6 ("playloop: make chapter property more accurate when seeking chapters")
2025-12-28 11:04:47 +01:00
nanahi 4bbf014f09 sub/draw_bmp: fix rgba alpha blending
Wrong formula was used due to copypasting draw_ass_rgba code.

Fixes: c1a961ad78
2025-12-28 11:02:17 +01:00
nanahi a58dd8ac41 video/out/opengl/context_wayland: cleanup vo when egl fails to init
When the "new" API for OpenGL VO backends was created 10 years ago in
df97c30e0e, it was expected that any
"driver" that fails to init to clean up themselves (the "old" API always
called mpgl_uninit() to clean up on failure).

However, when switching Wayland to the "new" API, this was forgotten.
Wayland VO will never be cleaned up when EGL init fails.

With commit a310a65d35, this issue was
exposed when a leftover Wayland context pointer, which results from a
successful Wayland context init but with failed EGL init, triggers an
assertion in the X11 context init code, which expects the pointer to be
NULL.

Fix this by uninit Wayland context when EGL init fails.

Fixes: bd87598af9
2025-12-27 19:53:29 +01:00
Guido Cella d15f34b24e select.lua: preserve empty LRC lines
Subtitle extraction preserves empty lines in LRC subtitles because they
are useful for separating verses and choruses. 036fae317c changed their
sub codec from subrip to text, so update select.lua accordingly.
2025-12-27 15:42:16 +01:00
Guido Cella 52f2c670d5 console.lua: don't error if compute_bounds doesn't return dimensions
compute_bounds doesn't return any field if the rectangle is empty: its
docs say "If set to true, attempt to determine bounds and write them to
the command's result value as x0, x1, y0, y1 rectangle (default:
false). If the rectangle is empty, not known, or somehow degenerate, it
is not set.". So shrinking mpv as much as possible with a menu open
caused a crash.

This doesn't happen on Xorg because of these lines in video/out/x11_common.c:

// Set minimum height/width to 4 to avoid off-by-one errors.
hint->flags |= PMinSize;
hint->min_width = hint->min_height = 4;

nor on macOS because of

minSize = NSSize(width: 160, height: 90)

in video/out/mac/window.swift.

But this is needed on Wayland and Windows.

Fixes #16682 along with the diff posted there.
2025-12-27 15:41:44 +01:00
llyyr c66204b69b screenshot: correctly detect hardware frame
This only ever worked by accident and relied on broken behavior that was
fixed by 9b1d47ece1
2025-12-27 15:41:24 +01:00
Kacper Michajłow c0d989c839 sub/sd_sbr: check runtime version 2025-12-24 19:01:40 +01:00
Kacper Michajłow 5c80b876db ci/msys2: enable subrandr on clang64
Implib issue has been fixed upstream.

See: https://github.com/afishhh/subrandr/commit/d26a1536bd15fb2c3dbf7866b855fe674a7363bb
2025-12-24 13:38:38 +01:00
Hubert Głuchowski 75bb651945 sub/sd_sbr: respect sub-use-margins 2025-12-24 07:00:07 +01:00
Kacper Michajłow 6dff941c71 ci/{win32,mingw64,msys2}: add amf-headers 2025-12-23 07:06:34 +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 e72807e7a0 mp_image_pool: set D3D11 BindFlags for all hw frame pools
It's always needed, not only in d3d11vpp.
2025-12-23 07:06:34 +01:00
Hubert Głuchowski 2ed355f51f demux/demux_sbr: re-emit packet after seek 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 8ad5066e43 sub/sd_sbr: mark subtitle packets as animated 2025-12-23 07:01:29 +01:00
Hubert Głuchowski b6d7f4e793 sub/sd_sbr: add logging callback 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 111233dbf2 ci: build with subrandr on Linux 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 454573bc08 ci: build with subrandr on mingw64 and msys2 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 4921c61bff sub/sd_sbr: log errors from subrandr functions 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 2b78ac44a9 demux/demux_sbr: allow configuring probe size 2025-12-23 07:01:29 +01:00
Hubert Głuchowski 557e592511 ytdl_hook: recognize srv3 subtitle format if subrandr is present
This allows YouTube videos played directly from a URL to make use of
subrandr's SRV3 support if it is allowed by an overriden `sub-format`.
2025-12-23 07:01:29 +01:00
Hubert Głuchowski a330318592 player/command: add subrandr-version property
Allows script to detect the presence of subrandr at runtime, useful for
determining whether this mpv instance can play SRV3 subtitles.
2025-12-23 07:01:29 +01:00
Hubert Głuchowski bb97882c9a sub: add subrandr renderer support
subrandr is a subtitle rendering library which aims to render
SRV3 (YouTube) subtitles and WebVTT subtitles accurately.

Currently in mpv WebVTT subs are rendered via ffmpeg conversion to ASS
which throws away a lot of the style and completely disregards
the WebVTT non-region-cue positioning algorithm. Furthermore if
one wants to render some more complex SRV3 subtitles one has to
resort to external converters since it's not even supported by ffmpeg.

However subrandr is able to render SRV3 subtitles natively with support
for the most commonly used features. It can render ruby text without
relying on font metrics during conversion which is obviously fragile,
and it can perform correct scaling using the exact calculations used by
YouTube instead of making up ASS approximations. Similarly it follows
the WebVTT spec for the features of WebVTT that it supports (mostly).

It's not perfect of course and there's still many things it doesn't do
or does wrong but those are things that can be incrementally improved
outside of mpv.
2025-12-23 07:01:29 +01:00
der richter 3effff1c43 DOCS/man/options: update macOS requirements and remove unsupported
our minimum requirement is macOS 10.15. we can remove the mentions of
older versions and their different behaviour or feature inclusions.
2025-12-23 06:58:40 +01:00
Dudemanguy 7369b336df wayland: accept version 7 of xdg-shell
Maybe we could use the constrained states that version 7 adds, but for
now just allow binding to version 7.
2025-12-23 06:58:03 +01:00
Dudemanguy ad740caab0 wayland: accept version 2 of wl_shm
No difference for us.
2025-12-23 06:58:03 +01:00
Dudemanguy 0c44abbd67 wayland: accept version 5 of linux-dmabuf
It makes no difference for us so no reason not to accept it.
2025-12-23 06:58:03 +01:00
Dudemanguy b7ad86f120 wayland: bind to the linux-dmabuf in stable instead
It doesn't really matter, but it's probably more correct to use the
stable version.
2025-12-23 06:58:03 +01:00
Kacper Michajłow 670a266475 ci/build-linux-old: remove custom libplacebo build
Alpine 3.21 has libplacebo 6.338.2, we can use that.
2025-12-22 17:30:05 +00:00
Kacper Michajłow 604b43184f ci/linux-ffmpeg-6-1: add wayland-protocols
Bump Alpine to 3.21. It still on ffmpeg 6.1, but has newer Wayland
components that we want to test.
2025-12-22 17:30:05 +00:00
Kacper Michajłow b95846a28c meson: check wayland-scanner version
At least 1.23 is needed for 1.38 protocols. Also check other Wayland
deps to be 1.23, they are likely bundled at the same version as scanner
anyway.
2025-12-22 17:30:05 +00:00
Kacper Michajłow f011d73d5f wayland_common: suppress unused function warning on older protocols 2025-12-22 17:30:05 +00:00
Dudemanguy 4b6ebd79c8 wayland: guard wp_color_manager_v1_get_version usage
Old wayland protocol versions don't have this.

Fixes https://github.com/mpv-player/mpv-build/issues/261
2025-12-22 17:30:05 +00:00
llyyr 8ba0603ffa wayland: bump wayland-protocols minimum version to 1.38
Debian Stable has 1.44 but we're gated by Ubuntu LTS here.
2025-12-22 15:00:02 +01:00
llyyr 9adeeb02ea wayland: bump libwayland minimum version to 1.22
1.23.1 is available in Debian Stable, which was the last distro holding
us back from doing version bumps
2025-12-22 15:00:02 +01:00
Kacper Michajłow 5820906024 vo: limit manual redraws to estimated display fps 2025-12-22 11:14:58 +01:00
Kacper Michajłow c0433f064e vf_format: deprecate --vf=format=sig-peak 2025-12-22 10:19:38 +01:00
der richter 80155c3dc9 mac/touchbar: remove manual 1 second rate limit of position property
duration and position properties were observed as double which lead to a
lot of updates per second (high granularity). it is recommended to not
update the position of the touchbar too frequently, why we had a manual
1 second rate limit.

instead of manually rate limiting the property, just observe it as int64
which only updates every second. it also causes a bit less pressure for
our core.
2025-12-22 10:19:29 +01:00
der richter dc6886ebb5 mac/remote: remove manual 1 second rate limit of position property
duration and position properties were observed as double which lead to
a lot of updates per second (high granularity). it is recommended to not
update the position of the remote command center to frequently, why we
had a manual 1 second rate limit.

instead of manually rate limiting the property, just observe it as int64
which only updates every second. it also causes a bit less pressure for
our core.
2025-12-22 10:19:29 +01:00
der richter f1ad9dfdf0 mac/event: add MPV_FORMAT_INT64 handler 2025-12-22 10:19:29 +01:00
der richter bf9ddf1db2 mac/type: add Int64 type conversion helper 2025-12-22 10:19:29 +01:00
sfan5 d0e24ab17a Update MPV_VERSION 2025-12-21 20:14:18 +01:00
364 changed files with 19865 additions and 4759 deletions

No files matched your search

+3
View File
@@ -21,3 +21,6 @@ indent_style = unset
indent_size = unset indent_size = unset
max_line_length = unset max_line_length = unset
trim_trailing_whitespace = unset trim_trailing_whitespace = unset
[menu.conf]
indent_style = tab
+11 -2
View File
@@ -4,6 +4,7 @@ labels: ["os:linux"]
type: Bug type: Bug
body: body:
- type: textarea - type: textarea
id: mpv_information
attributes: attributes:
label: "mpv Information" label: "mpv Information"
placeholder: | placeholder: |
@@ -24,6 +25,7 @@ body:
validations: validations:
required: false required: false
- type: textarea - type: textarea
id: other_information
attributes: attributes:
label: "Other Information" label: "Other Information"
description: > description: >
@@ -38,7 +40,9 @@ body:
- The time when the problem started to happen (after updating mpv, system, driver, etc.) - The time when the problem started to happen (after updating mpv, system, driver, etc.)
- Possible screenshot or video of visual glitches - Possible screenshot or video of visual glitches
If you're not using git master or the latest release, update. If you're not using the git master branch or the [latest release](https://github.com/mpv-player/mpv/releases/latest), please update.
Older versions are not supported. If your distribution does not provide the latest version, please report the issue to them.
Packages and builds can be found [here](https://mpv.io/installation/). Packages and builds can be found [here](https://mpv.io/installation/).
value: |- value: |-
- Linux version: - Linux version:
@@ -53,6 +57,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: reproduction_steps
attributes: attributes:
label: "Reproduction Steps" label: "Reproduction Steps"
description: > description: >
@@ -74,18 +79,21 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected Behavior" label: "Expected Behavior"
placeholder: "What were you expecting?" placeholder: "What were you expecting?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: actual_behavior
attributes: attributes:
label: "Actual Behavior" label: "Actual Behavior"
placeholder: "What happened instead?" placeholder: "What happened instead?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
placeholder: "Drag and drop log file here (Don't paste content directly)" placeholder: "Drag and drop log file here (Don't paste content directly)"
@@ -109,6 +117,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: sample_files
attributes: attributes:
label: "Sample Files" label: "Sample Files"
placeholder: "Drag and drop sample files here" placeholder: "Drag and drop sample files here"
@@ -133,7 +142,7 @@ body:
attributes: attributes:
label: "I carefully read all instruction and confirm that I did the following:" label: "I carefully read all instruction and confirm that I did the following:"
options: options:
- label: "I tested with the latest mpv version to validate that the issue is not already fixed." - label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
required: true required: true
- label: "I provided all required information including system and mpv version." - label: "I provided all required information including system and mpv version."
required: true required: true
@@ -4,6 +4,7 @@ labels: ["os:mac"]
type: Bug type: Bug
body: body:
- type: textarea - type: textarea
id: mpv_information
attributes: attributes:
label: "mpv Information" label: "mpv Information"
placeholder: | placeholder: |
@@ -24,6 +25,7 @@ body:
validations: validations:
required: false required: false
- type: textarea - type: textarea
id: other_info
attributes: attributes:
label: "Other Information" label: "Other Information"
description: > description: >
@@ -46,6 +48,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: reproduction_steps
attributes: attributes:
label: "Reproduction Steps" label: "Reproduction Steps"
description: > description: >
@@ -67,18 +70,21 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected Behavior" label: "Expected Behavior"
placeholder: "What were you expecting?" placeholder: "What were you expecting?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: actual_behavior
attributes: attributes:
label: "Actual Behavior" label: "Actual Behavior"
placeholder: "What happened instead?" placeholder: "What happened instead?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
placeholder: "Drag and drop log file here (Don't paste content directly)" placeholder: "Drag and drop log file here (Don't paste content directly)"
@@ -104,6 +110,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: sample_files
attributes: attributes:
label: "Sample Files" label: "Sample Files"
placeholder: "Drag and drop sample files here" placeholder: "Drag and drop sample files here"
@@ -128,7 +135,7 @@ body:
attributes: attributes:
label: "I carefully read all instruction and confirm that I did the following:" label: "I carefully read all instruction and confirm that I did the following:"
options: options:
- label: "I tested with the latest mpv version to validate that the issue is not already fixed." - label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
required: true required: true
- label: "I provided all required information including system and mpv version." - label: "I provided all required information including system and mpv version."
required: true required: true
@@ -4,6 +4,7 @@ labels: ["os:win"]
type: Bug type: Bug
body: body:
- type: textarea - type: textarea
id: mpv_information
attributes: attributes:
label: "mpv Information" label: "mpv Information"
placeholder: | placeholder: |
@@ -24,6 +25,7 @@ body:
validations: validations:
required: false required: false
- type: textarea - type: textarea
id: other_information
attributes: attributes:
label: "Other Information" label: "Other Information"
description: > description: >
@@ -48,6 +50,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: reproduction_steps
attributes: attributes:
label: "Reproduction Steps" label: "Reproduction Steps"
description: > description: >
@@ -69,18 +72,21 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected Behavior" label: "Expected Behavior"
placeholder: "What were you expecting?" placeholder: "What were you expecting?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: actual_behavior
attributes: attributes:
label: "Actual Behavior" label: "Actual Behavior"
placeholder: "What happened instead?" placeholder: "What happened instead?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
placeholder: "Drag and drop log file here (Don't paste content directly)" placeholder: "Drag and drop log file here (Don't paste content directly)"
@@ -105,6 +111,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: sample_files
attributes: attributes:
label: "Sample Files" label: "Sample Files"
placeholder: "Drag and drop sample files here" placeholder: "Drag and drop sample files here"
@@ -129,7 +136,7 @@ body:
attributes: attributes:
label: "I carefully read all instruction and confirm that I did the following:" label: "I carefully read all instruction and confirm that I did the following:"
options: options:
- label: "I tested with the latest mpv version to validate that the issue is not already fixed." - label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
required: true required: true
- label: "I provided all required information including system and mpv version." - label: "I provided all required information including system and mpv version."
required: true required: true
+8 -1
View File
@@ -4,6 +4,7 @@ labels: []
type: Bug type: Bug
body: body:
- type: textarea - type: textarea
id: mpv_information
attributes: attributes:
label: "mpv Information" label: "mpv Information"
placeholder: | placeholder: |
@@ -24,6 +25,7 @@ body:
validations: validations:
required: false required: false
- type: textarea - type: textarea
id: important_information
attributes: attributes:
label: "Important Information" label: "Important Information"
description: > description: >
@@ -46,6 +48,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: reproduction_steps
attributes: attributes:
label: "Reproduction Steps" label: "Reproduction Steps"
description: > description: >
@@ -67,18 +70,21 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected Behavior" label: "Expected Behavior"
placeholder: "What were you expecting?" placeholder: "What were you expecting?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: actual_behavior
attributes: attributes:
label: "Actual Behavior" label: "Actual Behavior"
placeholder: "What happened instead?" placeholder: "What happened instead?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
placeholder: "Drag and drop log file here (Don't paste content directly)" placeholder: "Drag and drop log file here (Don't paste content directly)"
@@ -102,6 +108,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: sample_files
attributes: attributes:
label: "Sample Files" label: "Sample Files"
placeholder: "Drag and drop sample files here" placeholder: "Drag and drop sample files here"
@@ -126,7 +133,7 @@ body:
attributes: attributes:
label: "I carefully read all instruction and confirm that I did the following:" label: "I carefully read all instruction and confirm that I did the following:"
options: options:
- label: "I tested with the latest mpv version to validate that the issue is not already fixed." - label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
required: true required: true
- label: "I provided all required information including system and mpv version." - label: "I provided all required information including system and mpv version."
required: true required: true
@@ -4,6 +4,7 @@ labels: ["core:meson"]
type: Bug type: Bug
body: body:
- type: textarea - type: textarea
id: important_information
attributes: attributes:
label: "Important Information" label: "Important Information"
description: > description: >
@@ -21,6 +22,7 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: reproduction_steps
attributes: attributes:
label: "Reproduction Steps" label: "Reproduction Steps"
description: > description: >
@@ -30,18 +32,21 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected Behavior" label: "Expected Behavior"
placeholder: "What were you expecting?" placeholder: "What were you expecting?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: actual_behavior
attributes: attributes:
label: "Actual Behavior" label: "Actual Behavior"
placeholder: "What happened instead?" placeholder: "What happened instead?"
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
placeholder: "Drag and drop log file here (Don't paste content directly)" placeholder: "Drag and drop log file here (Don't paste content directly)"
@@ -55,7 +60,7 @@ body:
attributes: attributes:
label: "I carefully read all instruction and confirm that I did the following:" label: "I carefully read all instruction and confirm that I did the following:"
options: options:
- label: "I tested with the latest mpv version to validate that the issue is not already fixed." - label: "I tested and confirmed that the issue exists with the [latest release version](https://github.com/mpv-player/mpv/releases/latest) or newer."
required: true required: true
- label: "I provided all required information including system and mpv version." - label: "I provided all required information including system and mpv version."
required: true required: true
@@ -4,6 +4,7 @@ labels: ["meta:feature-request"]
type: Feature type: Feature
body: body:
- type: textarea - type: textarea
id: expected_behavior
attributes: attributes:
label: "Expected behavior of the wanted feature" label: "Expected behavior of the wanted feature"
description: > description: >
@@ -20,9 +21,11 @@ body:
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: alternative_behavior
attributes: attributes:
label: "Alternative behavior of the wanted feature" label: "Alternative behavior of the wanted feature"
- type: textarea - type: textarea
id: log_file
attributes: attributes:
label: "Log File" label: "Log File"
description: > description: >
@@ -34,6 +37,7 @@ body:
If you have trouble producing a log file, you can alternatively use `-v -v`, save the If you have trouble producing a log file, you can alternatively use `-v -v`, save the
terminal output to a file, and attach it to the issue. terminal output to a file, and attach it to the issue.
- type: textarea - type: textarea
id: sample_files
attributes: attributes:
label: "Sample Files" label: "Sample Files"
placeholder: "Drag and drop sample files here" placeholder: "Drag and drop sample files here"
+8
View File
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
+218 -33
View File
@@ -29,6 +29,10 @@ on:
- 'README.md' - 'README.md'
- 'RELEASE_NOTES' - 'RELEASE_NOTES'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
mingw: mingw:
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
@@ -36,6 +40,7 @@ jobs:
CCACHE_BASEDIR: ${{ github.workspace }} CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 500M CCACHE_MAXSIZE: 500M
DOWNLOAD_CACHE: ${{ github.workspace }}/.ccache/downloads
TARGET: ${{ matrix.arch }}-w64-mingw32 TARGET: ${{ matrix.arch }}-w64-mingw32
RUST_TARGET: ${{ matrix.arch }}-pc-windows-gnu RUST_TARGET: ${{ matrix.arch }}-pc-windows-gnu
strategy: strategy:
@@ -54,7 +59,7 @@ jobs:
run: echo "timestamp=`date +%s%N`" >> $GITHUB_OUTPUT run: echo "timestamp=`date +%s%N`" >> $GITHUB_OUTPUT
- name: Restore cache - name: Restore cache
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }} key: ${{ env.TARGET }}-${{ steps.get_time.outputs.timestamp }}
@@ -104,13 +109,21 @@ jobs:
run: | run: |
cat ./mingw_build/meson-logs/testlog.txt cat ./mingw_build/meson-logs/testlog.txt
- uses: actions/upload-artifact@v5 - name: Artifact name
id: artifact
run: |
VERSION_FILE=$(find . -path "*/common/version.h" -type f | head -n 1)
VER=$(grep VERSION "$VERSION_FILE" | cut -d'"' -f2)
PR=${{ github.event.pull_request.number && format('-pr{0}', github.event.pull_request.number) || '' }}
echo "name=mpv-$VER$PR-${{ github.run_id }}-$TARGET" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v7
with: with:
name: mpv-${{ env.TARGET }} name: ${{ steps.artifact.outputs.name }}
path: mpv-git-*.zip path: artifact/*
- name: Save Cache - name: Save Cache
uses: actions/cache/save@v4 uses: actions/cache/save@v5
if: always() if: always()
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
@@ -124,19 +137,17 @@ jobs:
include: include:
- target: x86_64-pc-windows-msvc - target: x86_64-pc-windows-msvc
arch: "x64" arch: "x64"
os: "windows-latest" os: "windows-2025-vs2026"
- target: aarch64-pc-windows-msvc - target: aarch64-pc-windows-msvc
arch: "arm64" arch: "arm64"
os: "windows-11-arm" os: "windows-11-arm"
env: env:
VS: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise"
CC: "ccache clang" CC: "ccache clang"
CXX: "ccache clang++" CXX: "ccache clang++"
CC_LD: "lld-link" CC_LD: "lld-link"
CXX_LD: "lld-link" CXX_LD: "lld-link"
WINDRES: "llvm-rc"
RUST_LD: "lld-link" RUST_LD: "lld-link"
RUSTC: "rustc --target ${{ matrix.target }}" WINDRES: "llvm-rc"
CCACHE_BASEDIR: ${{ github.workspace }} CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: "${{ github.workspace }}\\.ccache" CCACHE_DIR: "${{ github.workspace }}\\.ccache"
CCACHE_MAXSIZE: 500M CCACHE_MAXSIZE: 500M
@@ -154,17 +165,26 @@ jobs:
"timestamp=$((Get-Date).Ticks)" >> $env:GITHUB_OUTPUT "timestamp=$((Get-Date).Ticks)" >> $env:GITHUB_OUTPUT
- name: Restore cache - name: Restore cache
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }} key: ${{ matrix.target }}-${{ steps.get_time.outputs.timestamp }}
restore-keys: ${{ matrix.target }}- restore-keys: ${{ matrix.target }}-
- name: Install Winget on windows-11-arm
if: matrix.os == 'windows-11-arm'
shell: pwsh
run: |
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
Repair-WinGetPackageManager -Latest -Force
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install meson==1.9.2 python -m pip install meson
choco install ccache nasm winget install --accept-source-agreements --accept-package-agreements Ccache.Ccache NASM.NASM
./ci/install-cmake.ps1 -arch ${{ matrix.arch }} echo "$env:LOCALAPPDATA\Microsoft\WinGet\Links" >> $env:GITHUB_PATH
# For cargo -C
rustup default nightly
- name: Update Meson WrapDB - name: Update Meson WrapDB
run: | run: |
@@ -175,13 +195,21 @@ jobs:
meson wrap install libpng meson wrap install libpng
meson wrap install zlib meson wrap install zlib
- name: Find Visual Studio
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $vsPath) { throw "Could not find a Visual Studio installation" }
"VS=$vsPath"
"VS=$vsPath" >> $env:GITHUB_ENV
- name: Build - name: Build
id: build id: build
run: | run: |
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and ` $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and `
$_ -ne 'C:\Program Files\CMake\bin' -and ` $_ -ne 'C:\Program Files\CMake\bin' -and `
$_ -ne 'C:\Strawberry\c\bin' }) -join ';' $_ -ne 'C:\Strawberry\c\bin' }) -join ';'
$env:PATH = "$pwd\cmake\bin;" + $env:PATH + ';C:\Program Files\NASM' $env:PATH += ';C:\Program Files\NASM'
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}" Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}"
./ci/build-win32.ps1 ./ci/build-win32.ps1
@@ -197,7 +225,7 @@ jobs:
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and ` $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' -and `
$_ -ne 'C:\Program Files\CMake\bin' -and ` $_ -ne 'C:\Program Files\CMake\bin' -and `
$_ -ne 'C:\Strawberry\c\bin' }) -join ';' $_ -ne 'C:\Strawberry\c\bin' }) -join ';'
$env:PATH = "$pwd\cmake\bin;" + $env:PATH + ';C:\Program Files\NASM' $env:PATH += ';C:\Program Files\NASM'
Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" Import-Module "$env:VS\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}" Enter-VsDevShell -VsInstallPath $env:VS -SkipAutomaticLocation -DevCmdArguments "-arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}"
meson test -C build -t 2 meson test -C build -t 2
@@ -207,17 +235,33 @@ jobs:
run: | run: |
cat ./build/meson-logs/testlog.txt cat ./build/meson-logs/testlog.txt
- uses: actions/upload-artifact@v5 - name: Artifact name
id: artifact
run: |
$VERSION_FILE = gci . -r -Filter "version.h" | ? { $_.FullName -match "[/\\]common[/\\]version\.h$" } | select -First 1 -exp FullName
$VER = (sls $VERSION_FILE -Pattern 'VERSION').Line -replace '.*"([^"]+)".*', '$1'
$PR = if ("${{ github.event.pull_request.number }}") { "-pr${{ github.event.pull_request.number }}" } else { "" }
$name = "mpv-$VER$PR-${{ github.run_id }}-${{ matrix.target }}"
"name=$name" >> $env:GITHUB_OUTPUT
- uses: actions/upload-artifact@v7
with: with:
name: mpv-${{ matrix.target }} name: ${{ steps.artifact.outputs.name }}
path: | path: |
build/mpv.??? build/mpv.???
build/mpv-*.bat build/mpv-*.bat
build/vulkan-*.dll build/vulkan-*.dll
!build/mpv.lib !build/mpv.lib
!build/mpv.pdb
- uses: actions/upload-artifact@v7
with:
name: ${{ steps.artifact.outputs.name }}-pdb
path: |
build/mpv.pdb
- name: Save Cache - name: Save Cache
uses: actions/cache/save@v4 uses: actions/cache/save@v5
if: always() if: always()
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
@@ -266,8 +310,11 @@ jobs:
else else
brew update brew update
fi fi
brew install -q autoconf automake pkgconf libtool python freetype fribidi little-cms2 \ if brew list ffmpeg &> /dev/null; then brew unlink ffmpeg; fi
luajit libass ffmpeg meson rust uchardet mujs libplacebo molten-vk vulkan-loader vulkan-headers brew install -q autoconf automake curl pkgconf libtool python freetype fribidi little-cms2 \
luajit libass ffmpeg-full meson rust uchardet mujs libplacebo molten-vk vulkan-loader vulkan-headers \
libarchive libbluray libcaca libcdio-paranoia libdvdnav rubberband zimg
brew link ffmpeg-full
- name: Build with meson - name: Build with meson
id: build id: build
@@ -299,10 +346,19 @@ jobs:
run: | run: |
cat ./build/meson-logs/testlog.txt cat ./build/meson-logs/testlog.txt
- uses: actions/upload-artifact@v5 - name: Artifact name
id: artifact
run: |
VERSION_FILE=$(find . -path "*/common/version.h" -type f | head -n 1)
VER=$(grep VERSION "$VERSION_FILE" | cut -d'"' -f2)
TARGET=${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }}
PR=${{ github.event.pull_request.number && format('-pr{0}', github.event.pull_request.number) || '' }}
echo "name=mpv-$VER$PR-${{ github.run_id }}-$TARGET" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v7
if: ${{ matrix.arch != 'test' }} if: ${{ matrix.arch != 'test' }}
with: with:
name: mpv-${{ matrix.os }}${{ matrix.arch != '' && format('-{0}', matrix.arch) || '' }} name: ${{ steps.artifact.outputs.name }}
path: mpv.tar.gz path: mpv.tar.gz
linux: linux:
@@ -373,10 +429,10 @@ jobs:
linux-ffmpeg-6-1: linux-ffmpeg-6-1:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
# We want to test ffmpeg 6.1.1 which alpine 3.19 has exactly. # We want to test ffmpeg 6.1.2, which Alpine 3.21 includes.
# Furthermore, this is a very minimal build of mpv without commonly # Also test compatibility with Wayland Protocols 1.38 and Wayland libs 1.23.
# used features to test build compatibility. Musl is a nice bonus as well # Musl support is an added bonus.
image: alpine:3.19 image: alpine:3.21
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: Install dependencies - name: Install dependencies
@@ -384,6 +440,7 @@ jobs:
apk update apk update
apk add \ apk add \
binutils \ binutils \
curl-dev \
ffmpeg-dev \ ffmpeg-dev \
gcc \ gcc \
git \ git \
@@ -391,6 +448,7 @@ jobs:
libass-dev \ libass-dev \
lua5.2-dev \ lua5.2-dev \
pulseaudio-dev \ pulseaudio-dev \
libplacebo-dev \
libx11-dev \ libx11-dev \
libxfixes-dev \ libxfixes-dev \
libxkbcommon-dev \ libxkbcommon-dev \
@@ -400,7 +458,9 @@ jobs:
meson \ meson \
musl-dev \ musl-dev \
rust \ rust \
samurai samurai \
wayland-dev \
wayland-protocols
- name: Build with meson - name: Build with meson
id: build id: build
@@ -428,13 +488,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: Test in OpenBSD VM - name: Test in OpenBSD VM
uses: cross-platform-actions/action@v0.30.0 uses: cross-platform-actions/action@v1.1.0
with: with:
operating_system: openbsd operating_system: openbsd
version: '7.8' version: '7.8'
run: | run: |
sudo pkg_add -U \ sudo pkg_add -U \
cmake \ cmake \
curl \
ffmpeg \ ffmpeg \
git \ git \
libarchive \ libarchive \
@@ -474,15 +535,16 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- name: Test in FreeBSD VM - name: Test in FreeBSD VM
uses: cross-platform-actions/action@v0.30.0 uses: cross-platform-actions/action@v1.1.0
with: with:
operating_system: freebsd operating_system: freebsd
version: '14.3' version: '15.0'
run: | run: |
sudo pkg update sudo pkg update
sudo pkg install -y \ sudo pkg install -y \
alsa-lib \ alsa-lib \
cmake \ cmake \
curl \
evdev-proto \ evdev-proto \
ffmpeg \ ffmpeg \
git \ git \
@@ -529,11 +591,21 @@ jobs:
matrix: matrix:
include: include:
- sys: "clang64" - sys: "clang64"
os: "windows-latest" os: "windows-2025-vs2026"
auto-var-init: "uninitialized"
- sys: "clang64"
os: "windows-2025-vs2026"
asan: true
- sys: "clang64"
os: "windows-2025-vs2026"
auto-var-init: "zero"
- sys: "clang64"
os: "windows-2025-vs2026"
auto-var-init: "pattern"
- sys: "mingw64" - sys: "mingw64"
os: "windows-latest" os: "windows-2025-vs2026"
- sys: "ucrt64" - sys: "ucrt64"
os: "windows-latest" os: "windows-2025-vs2026"
- sys: "clangarm64" - sys: "clangarm64"
os: "windows-11-arm" os: "windows-11-arm"
defaults: defaults:
@@ -552,10 +624,12 @@ jobs:
update: true update: true
install: git install: git
pacboy: >- pacboy: >-
amf-headers:p
angleproject:p angleproject:p
ca-certificates:p ca-certificates:p
cc:p cc:p
cppwinrt:p cppwinrt:p
curl:p
ffmpeg:p ffmpeg:p
lcms2:p lcms2:p
libarchive:p libarchive:p
@@ -584,6 +658,8 @@ jobs:
./ci/build-msys2.sh meson ./ci/build-msys2.sh meson
env: env:
SYS: ${{ matrix.sys }} SYS: ${{ matrix.sys }}
ASAN: ${{ matrix.asan }}
AUTO_VAR_INIT: ${{ matrix.auto-var-init }}
- name: Print meson log - name: Print meson log
if: ${{ failure() && steps.build.outcome == 'failure' }} if: ${{ failure() && steps.build.outcome == 'failure' }}
@@ -594,8 +670,117 @@ jobs:
id: tests id: tests
run: | run: |
meson test -C build meson test -C build
env:
GGML_NO_BACKTRACE: 1
- name: Print meson test log - name: Print meson test log
if: ${{ failure() && steps.tests.outcome == 'failure' }} if: ${{ failure() && steps.tests.outcome == 'failure' }}
run: | run: |
cat ./build/meson-logs/testlog.txt cat ./build/meson-logs/testlog.txt
publish:
name: Publish git release
needs: [mingw, win32, macos]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' &&
github.repository == 'mpv-player/mpv'
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
concurrency:
group: publish-git
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Publish to git release
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
tag=git-release
base_url="https://github.com/$GH_REPO/releases/download/$tag"
artifacts=$(gh api "repos/{owner}/{repo}/actions/runs/${{ github.run_id }}/artifacts")
# Attach every build artifact unchanged; the notes link to them with
# labels derived from the verbose names.
mkdir -p release
jq -r '.artifacts[] | "\(.id)\t\(.name)"' <<< "$artifacts" |
while IFS=$'\t' read -r id name; do
gh api "repos/{owner}/{repo}/actions/artifacts/$id/zip" > "release/$name.zip"
done
section() {
jq -r --arg url "$base_url" --arg re "$1" '
def pretty:
(if test("i686") then "i686"
elif test("aarch64") then "arm64"
elif test("-arm$") then "arm64"
elif test("intel") then "x86_64"
else "x86_64" end) as $arch
| [ (if test("mingw") then "GCC" elif test("msvc") then "Clang" else empty end),
(if test("macos") then "macOS " + capture("macos-(?<v>[0-9]+)").v else empty end),
(if test("-pdb") then "debug symbols" else empty end) ] as $q
| $arch + (if ($q | length) > 0 then " (" + ($q | join(", ")) + ")" else "" end);
# primary builds first (x86_64, arm64, i686; Clang before GCC), debug symbols last
def rank:
[ (if test("-pdb") then 1 else 0 end),
(if test("x86_64|intel") then 0 elif test("i686") then 2 else 1 end),
(if test("mingw") then 1 else 0 end),
(if test("macos") then (capture("macos-(?<v>[0-9]+)").v | tonumber) else 0 end) ];
[ .artifacts[] | select(.name | test($re)) ] | sort_by(.name | rank)
| map("* [\(.name | pretty)](\($url)/\(.name).zip)") | join("\n")
' <<< "$artifacts"
}
# Match the version string baked into the build (see common/meson.build).
version=$(git describe --abbrev=9 --tags --dirty)
notes=$(cat <<EOF
Automated development build of the latest \`master\` branch.
- Version: \`$version\`
- Commit: ${{ github.sha }}
- Built: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
### Windows
$(section 'w64|msvc')
### macOS
$(section 'macos')
> [!WARNING]
> These are untested development builds of the very latest \`master\`.
> They are **not** official releases. For stable builds see the
> [latest release](https://github.com/$GH_REPO/releases/latest).
EOF
)
# Create the release once (which also creates the tag), then only edit
# it in place so watchers aren't notified on every master push. Stale
# assets are dropped first since their names embed the run id.
if gh release view "$tag" >/dev/null 2>&1; then
gh release view "$tag" --json assets --jq '.assets[].name' |
while read -r asset; do
gh release delete-asset "$tag" "$asset" --yes
done
gh release edit "$tag" \
--prerelease \
--latest=false \
--title "mpv development build" \
--notes "$notes"
gh release upload "$tag" release/*
else
gh release create "$tag" \
--target "$GITHUB_SHA" \
--prerelease \
--latest=false \
--title "mpv development build" \
--notes "$notes" \
release/*
fi
+7
View File
@@ -5,6 +5,13 @@ on:
workflows: [build] workflows: [build]
types: [completed] types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
actions: write
jobs: jobs:
cache: cache:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+9
View File
@@ -5,6 +5,15 @@ on:
workflows: [build] workflows: [build]
types: [completed] types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
actions: read
contents: read
pull-requests: write
jobs: jobs:
pr_comment: pr_comment:
if: github.event.workflow_run.event == 'pull_request' && if: github.event.workflow_run.event == 'pull_request' &&
+4
View File
@@ -13,6 +13,10 @@ on:
paths: paths:
- 'DOCS/**' - 'DOCS/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
check-docs: check-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+8 -1
View File
@@ -1,4 +1,5 @@
name: Pull Request Fuzzing name: Pull Request Fuzzing
on: on:
pull_request: pull_request:
branches: [master] branches: [master]
@@ -12,7 +13,13 @@ on:
- 'Copyright' - 'Copyright'
- 'README.md' - 'README.md'
- 'RELEASE_NOTES' - 'RELEASE_NOTES'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {} permissions: {}
jobs: jobs:
Fuzzing: Fuzzing:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -41,7 +48,7 @@ jobs:
report-timeouts: true report-timeouts: true
output-sarif: true output-sarif: true
- name: Upload Crash - name: Upload Crash
uses: actions/upload-artifact@v5 uses: actions/upload-artifact@v7
if: failure() && steps.build.outcome == 'success' if: failure() && steps.build.outcome == 'success'
with: with:
name: ${{ matrix.sanitizer }}-artifacts name: ${{ matrix.sanitizer }}-artifacts
+4
View File
@@ -9,6 +9,10 @@ on:
pull_request: pull_request:
branches: [master] branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
commit-msg: commit-msg:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+2 -1
View File
@@ -57,6 +57,7 @@ local mp_globals = {
disable_key_bindings = {}, disable_key_bindings = {},
enable_key_bindings = {}, enable_key_bindings = {},
find_config_file = {}, find_config_file = {},
flush_keybindings = {},
format_time = {}, format_time = {},
get_mouse_pos = {}, get_mouse_pos = {},
set_key_bindings = {}, set_key_bindings = {},
@@ -78,7 +79,6 @@ local mp_internal = {
UNKNOWN_TYPE = { fields = { info = {}, type = {} }}, UNKNOWN_TYPE = { fields = { info = {}, type = {} }},
_legacy_overlay = { fields = { res_x = {}, res_y = {}, data = {}, update = {} }}, _legacy_overlay = { fields = { res_x = {}, res_y = {}, data = {}, update = {} }},
cancel_timer = {}, cancel_timer = {},
flush_keybindings = {},
get_osd_margins = {}, get_osd_margins = {},
input_define_section = {}, input_define_section = {},
input_disable_section = {}, input_disable_section = {},
@@ -106,4 +106,5 @@ stds = { mp = { read_globals = mp_globals } }
-- mp_internal seems to be merged with mp for other files too... -- mp_internal seems to be merged with mp for other files too...
files["player/lua/defaults.lua"] = { globals = mp_internal } files["player/lua/defaults.lua"] = { globals = mp_internal }
files["player/lua/auto_profiles.lua"] = { globals = { "p", "get" } } files["player/lua/auto_profiles.lua"] = { globals = { "p", "get" } }
files["player/lua/select.lua"] = { globals = { "p", "get" } }
max_line_length = 100 max_line_length = 100
+1 -1
View File
@@ -20,4 +20,4 @@ repos:
hooks: hooks:
- id: codespell - id: codespell
args: ["--ignore-words-list", "ALS,als,datas,DNE,enew,HDA,numer,ontop,optionA,Paeth,pathc,inout,requestor"] args: ["--ignore-words-list", "ALS,als,datas,DNE,enew,HDA,numer,ontop,optionA,Paeth,pathc,inout,requestor"]
exclude: ^misc/language.c$ exclude: ^(etc/menu.conf|misc/language.c)$
+34 -12
View File
@@ -76,7 +76,7 @@ which bootstraps a MinGW-w64 toolchain and builds mpv along with its dependencie
cat <<EOF > subprojects/ffmpeg.wrap cat <<EOF > subprojects/ffmpeg.wrap
[wrap-git] [wrap-git]
url = https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git url = https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git
revision = meson-8.0 revision = meson-8.1
depth = 1 depth = 1
[provide] [provide]
libavcodec = libavcodec_dep libavcodec = libavcodec_dep
@@ -146,11 +146,23 @@ they will be automatically downloaded and built by Meson.
- Clang compiler for Windows - Clang compiler for Windows
- C++ CMake tools for Windows - C++ CMake tools for Windows
- Windows SDK - Windows SDK
- Activate the developer shell: - Activate the developer shell. The target and host architecture must match
(e.g. `amd64` for x86_64, `arm64` for ARM64):
``` ```
& "<Visual Studio Path>\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation | Out-Null & "<Visual Studio Path>\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation | Out-Null
``` ```
2. Install Meson, as outlined in [Getting Meson](https://mesonbuild.com/Getting-meson.html): 2. Install the remaining build tools that are not part of the Visual Studio installer:
- [Meson](https://mesonbuild.com/Getting-meson.html), the build system.
- [NASM](https://www.nasm.us/), required to assemble the hand-written assembly
in FFmpeg, dav1d and aom. Make sure it is in `PATH`.
- [Rust](https://www.rust-lang.org/tools/install) (via `rustup`), required to
build mpv's Rust components and the `subrandr` subproject. A **nightly**
toolchain is needed, as the build relies on Cargo's unstable `-C` option:
```powershell
rustup default nightly
```
3. The following build script utilizes the Meson subprojects system to build mpv and its dependencies. 3. The following build script utilizes the Meson subprojects system to build mpv and its dependencies.
To make sure all dependency versions are up-to-date, update the subprojects database from Meson's WrapDB. To make sure all dependency versions are up-to-date, update the subprojects database from Meson's WrapDB.
Also explicitly download several wraps as some nested projects may pull older versions of them. Also explicitly download several wraps as some nested projects may pull older versions of them.
@@ -162,12 +174,14 @@ they will be automatically downloaded and built by Meson.
meson wrap install libpng meson wrap install libpng
meson wrap install zlib meson wrap install zlib
``` ```
4. Set environment variables or use the `--native-file` option in Meson. 4. Set environment variables so Meson uses the Clang/LLVM toolchain, or pass an
equivalent `--native-file` to Meson.
```powershell ```powershell
$env:CC = 'clang' $env:CC = 'clang'
$env:CXX = 'clang++' $env:CXX = 'clang++'
$env:CC_LD = 'lld' $env:CC_LD = 'lld-link'
$env:CXX_LD = 'lld' $env:CXX_LD = 'lld-link'
$env:RUST_LD = 'lld-link'
$env:WINDRES = 'llvm-rc' $env:WINDRES = 'llvm-rc'
``` ```
Note that some dependencies (e.g. LuaJIT) may require `sed` to configure. Fortunately, it is already bundled in Note that some dependencies (e.g. LuaJIT) may require `sed` to configure. Fortunately, it is already bundled in
@@ -247,16 +261,24 @@ due to differences in compiler flags. Our build system is designed specifically
for GNU-like compiler drivers. However, you can still build programs in for GNU-like compiler drivers. However, you can still build programs in
Visual Studio and link them with libmpv. Visual Studio and link them with libmpv.
If the toolchain used generates a ``.lib`` file, it will be ready for use. When ``libmpv`` is built with the recommended Clang/``lld-link`` toolchain,
Otherwise, you will need to create an import library for the mpv DLL with the ``lld-link`` emits an import library (``mpv.lib``) next to the DLL in the build
following command: directory. Add that ``mpv.lib`` to your MSVC project.
To generate an import library from a DLL yourself, first create a ``.def`` file
listing its exports. There are several ways to do this. One is ``gendef``, which
writes a ``.def``, based on DLL.
```bash ```bash
lib /name:mpv-2.dll /out:mpv.lib /MACHINE:X64 gendef libmpv-2.dll
``` ```
Ensure that the string in the ``/name:`` parameter matches the filename of the Then build the import library from it. ``/name`` must match the DLL filename, and
DLL, as this is the filename that the MSVC linker will reference. ``/machine`` must match the DLL's architecture (e.g. ``x64`` or ``arm64``):
```bash
lib /def:libmpv-2.def /name:libmpv-2.dll /out:mpv.lib /machine:x64
```
**Note:** Static linking is only feasible with matching compilers. For instance, **Note:** Static linking is only feasible with matching compilers. For instance,
if you build with Clang in Visual Studio, static linking is possible. if you build with Clang in Visual Studio, static linking is possible.
+13
View File
@@ -261,6 +261,19 @@ General coding
code. Plain C API usages may stay as C, but can be written in Swift. Existing code. Plain C API usages may stay as C, but can be written in Swift. Existing
Objective-C code can stay as is, though Swift rewrites are welcome. Objective-C code can stay as is, though Swift rewrites are welcome.
AI-assisted Contributions
-------------------------
If you have used an AI/LLM for your contribution, you must disclose this in the
PR description. Such contributions are not forbidden, but the submitter takes
full responsibility for the code changes. This includes having full
understanding of the code (knowing what was changed and why) and the ability to
participate in the code review process with human-written responses. This also
includes confirming that the code can be submitted under the same license as the
relevant files (usually LGPLv2 or GPLv2).
Clearly vibe-coded patches will not be considered.
Code of Conduct Code of Conduct
--------------- ---------------
+4 -2
View File
@@ -214,6 +214,9 @@ It provides following parameters change track metadata:
``byterate`` ``byterate``
Number of bytes per second this stream uses. (Purely informational.) Number of bytes per second this stream uses. (Purely informational.)
``program_id``
Assign this track to a program (integer, default: -1 meaning unset).
``index`` ``index``
The numeric index of the track this should map to (default: -1). This is The numeric index of the track this should map to (default: -1). This is
the 0-based index of the virtual stream as seen by the player, enumerating the 0-based index of the virtual stream as seen by the player, enumerating
@@ -366,8 +369,7 @@ tracks. In this case, it's not obvious, which virtual tracks the EDL show should
expose when being played. expose when being played.
Currently, mpv will apply an arbitrary heuristic which tracks the EDL file Currently, mpv will apply an arbitrary heuristic which tracks the EDL file
should expose. (Before mpv 0.30.0, it always used the first source file in the should expose.
segment list.)
You can set the ``layout`` option to ``this`` to make a specific entry define You can set the ``layout`` option to ``this`` to make a specific entry define
the track layout. the track layout.
+1 -3
View File
@@ -42,9 +42,7 @@ section::
oacopts-add = b=96k oacopts-add = b=96k
It's also possible to define default encoding options by putting them into It's also possible to define default encoding options by putting them into
the section named ``[encoding]``. (This behavior changed after mpv 0.3.x. In the section named ``[encoding]``.
mpv 0.3.x, config options in the default section / no section were applied
to encoding. This is not the case anymore.)
One can then encode using this profile using the command:: One can then encode using this profile using the command::
+1 -1
View File
@@ -852,7 +852,7 @@ Interface changes
(such as "sub-file"), deprecated in mpv 0.26.0 (such as "sub-file"), deprecated in mpv 0.26.0
- deprecate the old command based hook API, and introduce a proper C API - deprecate the old command based hook API, and introduce a proper C API
(the high level Lua API for this does not change) (the high level Lua API for this does not change)
- rename the the lua-settings/ config directory to script-opts/ - rename the lua-settings/ config directory to script-opts/
- the way the player waits for scripts getting loaded changes slightly. Now - the way the player waits for scripts getting loaded changes slightly. Now
scripts are loaded in parallel, and block the player from continuing scripts are loaded in parallel, and block the player from continuing
playback only in the player initialization phase. It could change again in playback only in the player initialization phase. It could change again in
+1
View File
@@ -0,0 +1 @@
change `ytdl_hook-all_formats` default to `yes`
@@ -0,0 +1 @@
make `--autocreate-playlist` only activate for regular files
@@ -0,0 +1 @@
make the `metadata/by-key` property writable
+1
View File
@@ -0,0 +1 @@
'command-list' now also returns a default value and available choices where applicable for each command argument.
+1
View File
@@ -0,0 +1 @@
make `mpv_command_node` accept `_name` for command name
@@ -0,0 +1 @@
add `--demuxer-hysteresis-bytes`
+2
View File
@@ -0,0 +1,2 @@
add `--input-builtin-drag-and-drop` option
add `dropped-file` property
@@ -0,0 +1 @@
remove the deprecated `error` field from `end-file`
+1
View File
@@ -0,0 +1 @@
add `env` property that can be used to retrieve environment variables
@@ -0,0 +1 @@
the `expand-properties` command modifier also applies to string lists now
@@ -0,0 +1 @@
`--geometry` x/y position is now applied only on initial window creation, unless `--force-window-position=yes` is set.
+1
View File
@@ -0,0 +1 @@
add libcurl-based stream backend (http, https, ftp, ftps), with new options `--curl-enabled`, `--curl-http-version`, `--curl-max-redirects`, `--curl-max-retries`, `--curl-connect-timeout`, `--curl-buffer-size` and `--curl-max-request-size`
@@ -0,0 +1 @@
add `libplacebo-version` property
@@ -0,0 +1 @@
the `loadfile` and `loadlist` commands can now take multiple flags (i.e. `append+play`)
+1
View File
@@ -0,0 +1 @@
deprecate `mp.input.log_error()`
+1
View File
@@ -0,0 +1 @@
stop searching the deprecated `lua-settings` directory for script config files
+1
View File
@@ -0,0 +1 @@
add `user-data/mpv/context-menu/open` sub-property
@@ -0,0 +1,4 @@
`mp.input.get()` `complete` callbacks are now passed a second argument,
a function which can be passed the completion values, which allows generating
completions asynchronously. The old method of returning completions from
the callback is now deprecated.
@@ -0,0 +1 @@
add `console_opt_overrides` argument to `mp.input.get()` and `mp.input.select()`
@@ -0,0 +1,2 @@
add `mp.utils.terminal_display_width()` function that measures the width of
a string in terminal cells
+1
View File
@@ -0,0 +1 @@
add `on_loaded` hook
+1
View File
@@ -0,0 +1 @@
add `audioonlyscreen` script option to osc
+2
View File
@@ -0,0 +1,2 @@
add `boxwidth` script option to osc
add `slimboxwidth` script option to osc
+2
View File
@@ -0,0 +1,2 @@
add `skip_{backward,forward}_mbtn_*_down_command` script-opt for osc
add `{close,minimize,maximize}_mbtn_*_command` script-opt for osc
@@ -0,0 +1 @@
add `osc-icon_style` option
+3
View File
@@ -0,0 +1,3 @@
add `osc-dynamic_margins` option
add `osc-sub-margin` option
add `osc-osd-margin` option
+1
View File
@@ -0,0 +1 @@
add `osc-windowcontrols_independent` script-opt
@@ -0,0 +1 @@
remove `windowcontrols_title` script-opt from osc, use `title` mpv option instead
@@ -0,0 +1 @@
make `player-operation-mode` readable as a property
@@ -0,0 +1 @@
add `preserve-options` flag to `playlist-play-index`
@@ -0,0 +1,6 @@
``track-list`` is now filtered by the currently selected edition
add ``edition-list/N/metadata`` sub-property
add ``program_id`` support to EDL ``!track_meta`` header
add ``--flatten-editions`` option to disable program-based edition grouping
add ``track-list/N/program-ids`` sub-property
deprecate ``track-list/N/program-id`` in favor of ``track-list/N/program-ids``
@@ -0,0 +1 @@
change `%tX` format specifier of `--screenshot-template` option to only accept C11 strftime specifiers or `%s` specifier
+1
View File
@@ -0,0 +1 @@
add `--target-trc=scrgb`
@@ -0,0 +1,2 @@
``track-list`` now hides dependent tracks (e.g. tile sub-streams, IAMF audio element layers, LCEVC enhancement streams) by default
add ``--show-dependent-tracks`` option to expose them
@@ -0,0 +1 @@
effective `--image-display-duration` takes `--speed` into consideration now
+2
View File
@@ -0,0 +1,2 @@
add `track_info_selected_only` script option for stats
add `track-list/N/demux-duration` property
+1
View File
@@ -0,0 +1 @@
add `sub-lines` and `secondary-sub-lines` properties
@@ -0,0 +1 @@
`--target-gamut` now accepts custom CIE xy primaries as comma-separated values (Rx,Ry,Gx,Gy,Bx,By,Wx,Wy) in addition to named primary sets
+1
View File
@@ -0,0 +1 @@
remove the deprecated `time-start` property
@@ -0,0 +1 @@
change `--tls-verify` default to `yes`
@@ -0,0 +1,2 @@
add `update-clipboard` command
change `clipboard` property to require `update-clipboard` command when clipboard monitoring is disabled
+1
View File
@@ -0,0 +1 @@
add `--vf=amf_frc`
@@ -0,0 +1 @@
rename `d3d11vpp=mode=ivctc` to `d3d11vpp=mode=ivtc`
+1
View File
@@ -0,0 +1 @@
deprecate `--vf=format=sig-peak`
@@ -0,0 +1 @@
deprecate `--vo=vaapi`
@@ -0,0 +1 @@
add support for (a subset of) tunable parameter for `vo=gpu`
@@ -0,0 +1,2 @@
add `--wayland-session=<string>`
restore the mpv window on wayland using xdg-session-management-v1
+1 -1
View File
@@ -27,7 +27,7 @@ Commands
``% script-message-to commands type "seek absolute-percent" 6`` ``% script-message-to commands type "seek absolute-percent" 6``
Enter a percent position to seek to. Enter a percent position to seek to.
``Ctrl+o script-message-to console type "loadfile ''" 11`` ``Ctrl+o script-message-to commands type "loadfile ''" 11``
Enter a file or URL to play, with autocompletion of paths in the Enter a file or URL to play, with autocompletion of paths in the
filesystem. filesystem.
+8
View File
@@ -81,6 +81,12 @@ PGDN
Ctrl+r Ctrl+r
Search the command history. See `SELECT`_ for the key bindings in this mode. Search the command history. See `SELECT`_ for the key bindings in this mode.
Shift+UP
Scroll the log one line up.
Shift+DOWN
Scroll the log one line down.
INSERT INSERT
Toggle insert mode. Toggle insert mode.
@@ -124,6 +130,8 @@ This script can be customized through a config file ``script-opts/console.conf``
placed in mpv's user directory and through the ``--script-opts`` command-line placed in mpv's user directory and through the ``--script-opts`` command-line
option. The configuration syntax is described in `mp.options functions`_. option. The configuration syntax is described in `mp.options functions`_.
Note that ``mp.input`` clients can selectively override these options.
Configurable Options Configurable Options
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
+50 -6
View File
@@ -1,10 +1,48 @@
CONTEXT MENU SCRIPT CONTEXT MENU
=================== ============
This script provides a context menu for platforms without integration with a The context menu is a menu that pops up on the video window. By default, it is
native context menu. On these platforms, it can be disabled entirely using the bound to right click.
menu.conf
---------
You can define your own menu in ``~~/menu.conf`` (see `FILES`_), or an
alternative path specified with ``--script-opt=select-menu_conf_path``. It is
recommended to use the default ``menu.conf`` from
https://github.com/mpv-player/mpv/blob/master/etc/menu.conf as an example to get
started.
Each line of ``menu.conf`` is a menu item with fields separated by 1 or more
tabs. The first field is the text shown in the menu. The second field is usually
the command that is run when that item is selected. Fields from the third
onwards can specify ``checked=``, ``disabled=`` and ``hidden=`` states in the
same way as `Conditional auto profiles`_.
When there is no command, the item will open a submenu. Fields below indented
with leading whitespace are added to this submenu. Nested submenu items are
defined by adding more leading whitespace than the parent menu entry.
Empty lines are interpreted as separators.
The second field can also be one of the following tokens to make that entry a
submenu with the relative items: ``$playlist``, ``$tracks``, ``$video-tracks``,
``$audio-tracks``, ``$sub-tracks``, ``$secondary-sub-tracks``, ``$chapters``,
``$editions``, ``$audio-devices``, ``$profiles``. These menus are automatically
disabled when empty.
To use the native context menu, you need to fill the ``menu-data`` property with
menu definition data, and call the ``context-menu`` command. In builtin scripts,
this is done by ``select.lua``, which parses ``menu.conf`` to populate
``menu-data``. It then calls the ``context-menu`` command on platforms where
integration with the native context menu is implemented, while on platforms
where it is not, it opens ``context_menu.lua``.
On platforms without integration with the native context menu,
``context_menu.lua`` can be disabled entirely using the
``--load-context-menu=no`` option. On platforms where the integration is ``--load-context-menu=no`` option. On platforms where the integration is
implemented, it is already disabled by default. implemented, it is already disabled by default, and ``--load-context-menu=yes``
will make ``select.lua`` use it.
Script messages Script messages
--------------- ---------------
@@ -56,6 +94,12 @@ Configurable Options
The color of the menu's border. The color of the menu's border.
``background_alpha``
Default: ``0``
The transparency of the menu's background. Ranges from 0 (opaque) to 255
(fully transparent).
``corner_radius`` ``corner_radius``
Default: 5 Default: 5
@@ -83,7 +127,7 @@ Configurable Options
``disabled_color`` ``disabled_color``
Default: ``#555555`` Default: ``#555555``
The color of disabled items. The color of disabled items and separators.
``seconds_to_open_submenus`` ``seconds_to_open_submenus``
Default: 0.2 Default: 0.2
+1 -1
View File
@@ -102,5 +102,5 @@ You can encode files from one format/codec to another using this facility.
.. admonition:: Example .. admonition:: Example
"``--oremove-metadata=comment,genre``" "``--oremove-metadata=comment,genre``"
excludes copying of the the comment and genre tags to the output excludes copying of the comment and genre tags to the output
file. file.
+355 -120
View File
@@ -271,7 +271,7 @@ This applies to certain APIs, such as ``mp.command_native()`` (with tables that
have string keys) in Lua scripting, or ``mpv_command_node()`` (with have string keys) in Lua scripting, or ``mpv_command_node()`` (with
MPV_FORMAT_NODE_MAP) in the C libmpv client API. MPV_FORMAT_NODE_MAP) in the C libmpv client API.
The name of the command is provided with a ``name`` string field. The name of The name of the command is provided with a ``_name`` string field. The name of
each command is defined in each command description in the each command is defined in each command description in the
`List of Input Commands`_. ``--input-cmdlist`` also lists them. See the `List of Input Commands`_. ``--input-cmdlist`` also lists them. See the
``subprocess`` command for an example. ``subprocess`` command for an example.
@@ -322,10 +322,6 @@ Playback Control
and ``absolute-percent`` seeks, while ``exact`` is used for ``absolute`` and ``absolute-percent`` seeks, while ``exact`` is used for ``absolute``
seeks. seeks.
Before mpv 0.9, the ``keyframes`` and ``exact`` flags had to be passed as
3rd parameter (essentially using a space instead of ``+``). The 3rd
parameter is still parsed, but is considered deprecated.
This is a scalable command. See the documentation of ``nonscalable`` input This is a scalable command. See the documentation of ``nonscalable`` input
command prefix in `Input Command Prefixes`_ for details. command prefix in `Input Command Prefixes`_ for details.
@@ -517,7 +513,7 @@ Playlist Manipulation
Go to the first of the previous entries on the playlist with a different Go to the first of the previous entries on the playlist with a different
``playlist-path``. ``playlist-path``.
``playlist-play-index <integer|current|none>`` ``playlist-play-index <integer|current|none> [preserve-options]``]
Start (or restart) playback of the given playlist index. In addition to the Start (or restart) playback of the given playlist index. In addition to the
0-based playlist entry index, it supports the following values: 0-based playlist entry index, it supports the following values:
@@ -531,6 +527,9 @@ Playlist Manipulation
Playback is stopped. If idle mode (``--idle``) is enabled, the player Playback is stopped. If idle mode (``--idle``) is enabled, the player
will enter idle mode, otherwise it will exit. will enter idle mode, otherwise it will exit.
Setting ``preserve-options`` (``MPV_FORMAT_FLAG``) will not reset file-local
options when the playback of the current playlist index is restarted.
This command is similar to ``loadfile`` in that it only manipulates the This command is similar to ``loadfile`` in that it only manipulates the
state of what to play next, without waiting until the current file is state of what to play next, without waiting until the current file is
unloaded, and the next one is loaded. unloaded, and the next one is loaded.
@@ -553,29 +552,44 @@ Playlist Manipulation
Stop playback of the current file, and play the new file immediately. Stop playback of the current file, and play the new file immediately.
<append> <append>
Append the file to the playlist. Append the file to the playlist.
<insert-next>
Insert the file into the playlist, directly after the current entry.
<insert-at>
Insert the file into the playlist, at the index given in the third
argument.
<play>
If nothing is currently playing, start playback. (Always starts with the
added file, even if the playlist was not empty before running this
command).
Multiple flags can be combined, e.g.: ``append+play``.
By default, ``append``, ``insert-next``, and ``insert-at`` will not
immediately start playback even if the playlist was previously empty. Adding
the ``play`` flag to them forces playback to start.
The following values are considered deprecated and were the old way
(before mpv 0.42) of forcing playback to start before the ``play`` flag was
added.
<append-play> <append-play>
Append the file, and if nothing is currently playing, start playback. Append the file, and if nothing is currently playing, start playback.
(Always starts with the added file, even if the playlist was not empty (Always starts with the added file, even if the playlist was not empty
before running this command.) before running this command.)
<insert-next>
Insert the file into the playlist, directly after the current entry.
<insert-next-play> <insert-next-play>
Insert the file next, and if nothing is currently playing, start playback. Insert the file next, and if nothing is currently playing, start playback.
(Always starts with the added file, even if the playlist was not empty (Always starts with the added file, even if the playlist was not empty
before running this command.) before running this command.)
<insert-at>
Insert the file into the playlist, at the index given in the third
argument.
<insert-at-play> <insert-at-play>
Insert the file at the index given in the third argument, and if nothing Insert the file at the index given in the third argument, and if nothing
is currently playing, start playback. (Always starts with the added is currently playing, start playback. (Always starts with the added
file, even if the playlist was not empty before running this command.) file, even if the playlist was not empty before running this command.)
The third argument is an insertion index, used only by the ``insert-at`` and The third argument is an insertion index, used only by the ``insert-at``
``insert-at-play`` actions. When used with those actions, the new item will action. When used with those actions, the new item will be inserted at the
be inserted at the index position in the playlist, or appended to the end if index position in the playlist, or appended to the end if index is less than
index is less than 0 or greater than the size of the playlist. This argument 0 or greater than the size of the playlist. This argument will be ignored for
will be ignored for all other actions. This argument is added in mpv 0.38.0. all other actions. This argument was added in mpv 0.38.0.
The fourth argument is a list of options and values which should be set The fourth argument is a list of options and values which should be set
while the file is playing. It is of the form ``opt1=value1,opt2=value2,..``. while the file is playing. It is of the form ``opt1=value1,opt2=value2,..``.
@@ -601,30 +615,45 @@ Playlist Manipulation
Stop playback and replace the internal playlist with the new one. Stop playback and replace the internal playlist with the new one.
<append> <append>
Append the new playlist at the end of the current internal playlist. Append the new playlist at the end of the current internal playlist.
<insert-next>
Insert the new playlist into the current internal playlist, directly
after the current entry.
<insert-at>
Insert the new playlist at the index given in the third argument.
<play>
If nothing is currently playing, start playback. (Always starts with the
added playlist, even if the internal playlist was not empty before running
this command).
Multiple flags can be combined, e.g.: ``append+play``.
By default, ``append``, ``insert-next``, and ``insert-at`` will not
immediately start playback even if the playlist was previously empty. Adding
the ``play`` flag to them forces playback to start.
The following values are considered deprecated and were the old way
(before mpv 0.42) of forcing playback to start before the ``play`` flag was
added.
<append-play> <append-play>
Append the new playlist, and if nothing is currently playing, start Append the new playlist, and if nothing is currently playing, start
playback. (Always starts with the new playlist, even if the internal playback. (Always starts with the new playlist, even if the internal
playlist was not empty before running this command.) playlist was not empty before running this command.)
<insert-next>
Insert the new playlist into the current internal playlist, directly
after the current entry.
<insert-next-play> <insert-next-play>
Insert the new playlist, and if nothing is currently playing, start Insert the new playlist, and if nothing is currently playing, start
playback. (Always starts with the new playlist, even if the internal playback. (Always starts with the new playlist, even if the internal
playlist was not empty before running this command.) playlist was not empty before running this command.)
<insert-at>
Insert the new playlist at the index given in the third argument.
<insert-at-play> <insert-at-play>
Insert the new playlist at the index given in the third argument, and if Insert the new playlist at the index given in the third argument, and if
nothing is currently playing, start playback. (Always starts with the nothing is currently playing, start playback. (Always starts with the
new playlist, even if the internal playlist was not empty before running new playlist, even if the internal playlist was not empty before running
this command.) this command.)
The third argument is an insertion index, used only by the ``insert-at`` and The third argument is an insertion index, used only by the ``insert-at`` action.
``insert-at-play`` actions. When used with those actions, the new playlist When used with those actions, the new playlist will be inserted at the index
will be inserted at the index position in the internal playlist, or appended position in the internal playlist, or appended to the end if index is less
to the end if index is less than 0 or greater than the size of the internal than 0 or greater than the size of the internal playlist. This argument will be
playlist. This argument will be ignored for all other actions. ignored for all other actions. This argument was added in mpv 0.38.0.
``playlist-clear`` ``playlist-clear``
Clear the playlist, except the currently played file. Clear the playlist, except the currently played file.
@@ -695,6 +724,14 @@ Track Manipulation
Marks the track as default. Marks the track as default.
<original>
Marks the track as being in the original language.
<commentary>
Marks the track as containing commentary.
<attached-picture> (only for ``video-add``) <attached-picture> (only for ``video-add``)
Marks the track as an attached picture, same as ``albumart`` argument Marks the track as an attached picture, same as ``albumart`` argument
@@ -891,20 +928,17 @@ OSD Commands
``file`` specifies the file the raw image data is read from. It can be ``file`` specifies the file the raw image data is read from. It can be
either a numeric UNIX file descriptor prefixed with ``@`` (e.g. ``@4``), either a numeric UNIX file descriptor prefixed with ``@`` (e.g. ``@4``),
or a filename. The file will be mapped into memory with ``mmap()``, or a filename. The file will be read into memory before the command returns.
copied, and unmapped before the command returns (changed in mpv 0.18.1). Note that since mpv 0.42.0, if a file descriptor is specified, the file
offset of the descriptor will be modified.
It is also possible to pass a raw memory address for use as bitmap memory It is also possible to pass a raw memory address for use as bitmap memory
by passing a memory address as integer prefixed with an ``&`` character. by passing a memory address as integer prefixed with an ``&`` character.
Passing the wrong thing here will crash the player. This mode might be Passing the wrong thing here will crash the player. This mode might be
useful for use with libmpv. The ``offset`` parameter is simply added to the useful for use with libmpv. The ``offset`` parameter is simply added to the
memory address (since mpv 0.8.0, ignored before). memory address.
``offset`` is the byte offset of the first pixel in the source file. ``offset`` is the byte offset of the first pixel in the source file.
(The current implementation always mmap's the whole file from position 0 to
the end of the image, so large offsets should be avoided. Before mpv 0.8.0,
the offset was actually passed directly to ``mmap``, but it was changed to
make using it easier.)
``fmt`` is a string identifying the image format. Currently, only ``bgra`` ``fmt`` is a string identifying the image format. Currently, only ``bgra``
is defined. This format has 4 bytes per pixels, with 8 bits per component. is defined. This format has 4 bytes per pixels, with 8 bits per component.
@@ -932,12 +966,20 @@ OSD Commands
.. note:: .. note::
Before mpv 0.42.0, the file was mapped into memory with ``mmap()``,
copied, and unmapped before the command returns. Changing the file
before the command returns is highly discouraged as this could lead to
crashes on versions before 0.42.0.
Before mpv 0.18.1, you had to do manual "double buffering" when updating Before mpv 0.18.1, you had to do manual "double buffering" when updating
an overlay by replacing it with a different memory buffer. Since mpv an overlay by replacing it with a different memory buffer. If you want
0.18.1, the memory is simply copied and doesn't reference any of the to use this command before mpv 0.18.1, read the old docs to see how to
memory indicated by the command's arguments after the command returns. handle this correctly.
If you want to use this command before mpv 0.18.1, reads the old docs
to see how to handle this correctly. Larger offsets should be avoided as mpv versions before 0.42.0 used to
mmap the whole file from position 0 to the end of the image. Before mpv
0.8.0, the offset was actually passed directly to ``mmap``. Since mpv
0.42.0, no mmap happens, so offset is handled by seeking on the file.
``overlay-remove <id>`` ``overlay-remove <id>``
Remove an overlay added with ``overlay-add`` and the same ID. Does nothing Remove an overlay added with ``overlay-add`` and the same ID. Does nothing
@@ -1166,10 +1208,11 @@ Execution Commands
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
``run <command> [<arg1> [<arg2> [...]]]`` ``run <command> [<arg1> [<arg2> [...]]]``
Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of Run the given command.
mpv (0.2.x and older), this doesn't call the shell. Instead, the command
is run directly, with each argument passed separately. Each argument is This doesn't call the shell. Instead, the command is run directly, with each
expanded like in `Property Expansion`_. argument passed separately. Each argument is expanded like in `Property
Expansion`_.
This command has a variable number of arguments, and cannot be used with This command has a variable number of arguments, and cannot be used with
named arguments. named arguments.
@@ -1254,8 +1297,6 @@ Execution Commands
``passthrough_stdin`` (``MPV_FORMAT_FLAG``) ``passthrough_stdin`` (``MPV_FORMAT_FLAG``)
If enabled, wire the new process' stdin to mpv's stdin (default: no). If enabled, wire the new process' stdin to mpv's stdin (default: no).
Before mpv 0.33.0, this argument did not exist, but the behavior was as
if this was set to true.
The command returns the following result (as ``MPV_FORMAT_NODE_MAP``): The command returns the following result (as ``MPV_FORMAT_NODE_MAP``):
@@ -1314,7 +1355,7 @@ Execution Commands
:: ::
local r = mp.command_native({ local r = mp.command_native({
name = "subprocess", _name = "subprocess",
playback_only = false, playback_only = false,
capture_stdout = true, capture_stdout = true,
args = {"cat", "/proc/cpuinfo"}, args = {"cat", "/proc/cpuinfo"},
@@ -1374,7 +1415,7 @@ Scripting Commands
1. The string ``key-binding``. 1. The string ``key-binding``.
2. The name of the binding (as established above). 2. The name of the binding (as established above).
3. The key state as string (see below). 3. The key state as string (see below).
4. The key name (since mpv 0.15.0). 4. The key name.
5. The text the key would produce, or empty string if not applicable. 5. The text the key would produce, or empty string if not applicable.
6. The scale of the key, such as the ones produced by ``WHEEL_*`` keys. 6. The scale of the key, such as the ones produced by ``WHEEL_*`` keys.
The scale is 1 if the key is nonscalable. The scale is 1 if the key is nonscalable.
@@ -1411,6 +1452,11 @@ Scripting Commands
return value of the ``mpv_client_id()`` API call of the newly created script return value of the ``mpv_client_id()`` API call of the newly created script
handle. handle.
::
MPV_FORMAT_NODE_MAP
"client_id" MPV_FORMAT_STRING
Screenshot Commands Screenshot Commands
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
@@ -1451,11 +1497,16 @@ Screenshot Commands
If you combine this command with another one using ``;``, you can use the If you combine this command with another one using ``;``, you can use the
``async`` flag to make encoding/writing the image file asynchronous. For ``async`` flag to make encoding/writing the image file asynchronous. For
normal standalone commands, this is always asynchronous, and the flag has normal standalone commands, this is always asynchronous, and the flag has
no effect. (This behavior changed with mpv 0.29.0.) no effect.
On success, returns a ``mpv_node`` with a ``filename`` field set to the On success, returns a ``mpv_node`` with a ``filename`` field set to the
saved screenshot location. saved screenshot location.
::
MPV_FORMAT_NODE_MAP
"filename" MPV_FORMAT_STRING
``screenshot-to-file <filename> [<flags>]`` ``screenshot-to-file <filename> [<flags>]``
Take a screenshot and save it to a given file. The format of the file will Take a screenshot and save it to a given file. The format of the file will
be guessed by the extension (and ``--screenshot-format`` is ignored - the be guessed by the extension (and ``--screenshot-format`` is ignored - the
@@ -1506,6 +1557,15 @@ Screenshot Commands
The ``flags`` argument is like the first argument to ``screenshot`` and The ``flags`` argument is like the first argument to ``screenshot`` and
supports ``subtitles``, ``video``, ``window``. supports ``subtitles``, ``video``, ``window``.
::
MPV_FORMAT_NODE_MAP
"w" MPV_FORMAT_INT64
"h" MPV_FORMAT_INT64
"stride" MPV_FORMAT_INT64
"format" MPV_FORMAT_STRING
"data" MPV_FORMAT_BYTE_ARRAY
Filter Commands Filter Commands
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
@@ -1693,6 +1753,22 @@ Miscellaneous Commands
``context-menu`` ``context-menu``
Show context menu on the video window. See `Context Menu`_ section for details. Show context menu on the video window. See `Context Menu`_ section for details.
``update-clipboard <type> [timeout]``
Update the clipboard content so that the ``clipboard`` property reflects
up-to-date value. This command is required to update the ``clipboard``
property value if ``--clipboard-monitor=no``. ``<type>`` must be ``text``
or ``text-primary`` to indicate whether to update clipboard or primary
selection. ``[timeout]`` specifies the maximum timeout in ms to wait for
the clipboard content to be updated. A negative timeout means infinite.
The default timeout is 10 ms.
This command returns as soon as the clipboard content is updated or the
timeout has reached. On some platforms, this command does nothing and
returns immediately.
This command can be asynchronously aborted via API. See `Asynchronous
command details`_.
Undocumented commands: ``ao-reload`` (experimental/internal). Undocumented commands: ``ao-reload`` (experimental/internal).
List of events List of events
@@ -1753,8 +1829,7 @@ This list uses the event name field value, and the C API symbol in brackets:
Playback was ended by sending the quit command. Playback was ended by sending the quit command.
``error`` ``error``
An error happened. In this case, an ``error`` field is present with An error happened.
the error string.
``redirect`` ``redirect``
Happens with playlists and similar. Details see Happens with playlists and similar. Details see
@@ -1773,10 +1848,7 @@ This list uses the event name field value, and the C API symbol in brackets:
``file_error`` ``file_error``
Set to mpv error string describing the approximate reason why playback Set to mpv error string describing the approximate reason why playback
failed. Unset if no error known. (In Lua scripting, this value was set failed. Unset if no error known.
on the ``error`` field directly. This is deprecated since mpv 0.33.0.
In the future, this ``error`` field will be unset for this specific
event.)
``playlist_insert_id`` ``playlist_insert_id``
If loading ended, because the playlist entry to be played was for example If loading ended, because the playlist entry to be played was for example
@@ -1921,7 +1993,7 @@ The following hooks are currently defined:
Ordered after ``start-file`` and before ``playback-restart``. Ordered after ``start-file`` and before ``playback-restart``.
``on_load_fail`` ``on_load_fail``
Called after after a file has been opened, but failed to. This can be Called after a file has been opened, but failed to. This can be
used to provide a fallback in case native demuxers failed to recognize used to provide a fallback in case native demuxers failed to recognize
the file, instead of always running before the native demuxers like the file, instead of always running before the native demuxers like
``on_load``. Demux will only be retried if ``stream-open-filename`` ``on_load``. Demux will only be retried if ``stream-open-filename``
@@ -1932,7 +2004,7 @@ The following hooks are currently defined:
``on_preloaded`` ``on_preloaded``
Called after a file has been opened, and before tracks are selected and Called after a file has been opened, and before tracks are selected and
decoders are created. This has some usefulness if an API users wants decoders are created. This has some usefulness if an API user wants
to select tracks manually, based on the set of available tracks. It's to select tracks manually, based on the set of available tracks. It's
also useful to initialize ``--lavfi-complex`` in a specific way by API, also useful to initialize ``--lavfi-complex`` in a specific way by API,
without having to "probe" the available streams at first. without having to "probe" the available streams at first.
@@ -1943,6 +2015,13 @@ The following hooks are currently defined:
Ordered after ``on_load_fail`` etc. and before ``playback-restart``. Ordered after ``on_load_fail`` etc. and before ``playback-restart``.
``on_loaded``
Called after a file has been loaded, after tracks are selected but before
starting playback. This has some usefulness if an API user wants
to act on selected track metadata before the media is shown.
Ordered after ``on_preloaded``. and before ``playback-restart``.
``on_unload`` ``on_unload``
Run before closing a file, and before actually uninitializing Run before closing a file, and before actually uninitializing
everything. It's not possible to resume playback in this state. everything. It's not possible to resume playback in this state.
@@ -1990,8 +2069,7 @@ prefixes can be specified. They are separated by whitespace.
``repeatable`` ``repeatable``
For some commands, keeping a key pressed doesn't run the command repeatedly. For some commands, keeping a key pressed doesn't run the command repeatedly.
This prefix forces enabling key repeat in any case. For a list of commands: This prefix forces enabling key repeat in any case. For a list of commands:
the first command determines the repeatability of the whole list (up to and the first command determines the repeatability of the whole list.
including version 0.33 - a list was always repeatable).
``nonrepeatable`` ``nonrepeatable``
For some commands, keeping a key pressed runs the command repeatedly. For some commands, keeping a key pressed runs the command repeatedly.
This prefix forces disabling key repeat in any case. This prefix forces disabling key repeat in any case.
@@ -2045,10 +2123,6 @@ command behaves by itself. There are the following cases:
have an asynchronous implementation. The async libmpv API still never blocks have an asynchronous implementation. The async libmpv API still never blocks
the caller in these cases. the caller in these cases.
Before mpv 0.29.0, the ``async`` prefix was only used by screenshot commands,
and made them run the file saving code in a detached manner. This is the
default now, and ``async`` changes behavior only in the ways mentioned above.
Currently the following commands have different waiting characteristics with Currently the following commands have different waiting characteristics with
sync vs. async: sub-add, audio-add, sub-reload, audio-reload, sync vs. async: sub-add, audio-add, sub-reload, audio-reload,
rescan-external-files, screenshot, screenshot-to-file, dump-cache, rescan-external-files, screenshot, screenshot-to-file, dump-cache,
@@ -2158,6 +2232,15 @@ Property list
.. note:: This is only an estimate. (It's computed from two unreliable .. note:: This is only an estimate. (It's computed from two unreliable
quantities: fps and possibly rounded timestamps.) quantities: fps and possibly rounded timestamps.)
``env``
Read-only table of all the environment variables. A specific variable can be
accessed as a sub-property, e.g. ``${env/HOME}`` returns ``$HOME`` if set.
.. note:: On certain platforms (e.g Windows) environment variables are case
insensitive and so ``${env/PATH}`` and ``${env/Path}`` will
resolve to the same thing. However, the returned table will
contain the variable name as is without any case-normalization.
``pid`` ``pid``
Process-id of mpv. Process-id of mpv.
@@ -2204,9 +2287,6 @@ Property list
property is unavailable. Note that the file duration is not always exactly property is unavailable. Note that the file duration is not always exactly
known, so this is an estimate. known, so this is an estimate.
This replaces the ``length`` property, which was deprecated after the
mpv 0.9 release. (The semantics are the same.)
This has a sub-property: This has a sub-property:
``duration/full`` ``duration/full``
@@ -2263,11 +2343,6 @@ Property list
``time-pos/full`` ``time-pos/full``
``time-pos`` with milliseconds. ``time-pos`` with milliseconds.
``time-start``
Deprecated. Always returns 0. Before mpv 0.14, this used to return the start
time of the file (could affect e.g. transport streams). See
``--rebase-start-time`` option.
``time-remaining`` ``time-remaining``
Remaining length of the file in seconds. Note that the file duration is not Remaining length of the file in seconds. Note that the file duration is not
always exactly known, so this is an estimate. always exactly known, so this is an estimate.
@@ -2336,12 +2411,11 @@ Property list
restart playback. The number of the first edition is 0. restart playback. The number of the first edition is 0.
For Matroska files, this is the edition. For DVD/Blu-ray, this is the title. For Matroska files, this is the edition. For DVD/Blu-ray, this is the title.
For MPEG-TS, HLS, and EDL streams, this maps to the underlying program/variant.
Before mpv 0.31.0, this showed the actual edition selected at runtime, if This strictly returns the user-set option or property value, and the
you didn't set the option or property manually. With mpv 0.31.0 and later, ``current-edition`` property returns the runtime selected edition (this
this strictly returns the user-set option or property value, and the matters with ``--edition=auto``, the default).
``current-edition`` property was added to return the runtime selected
edition (this matters with ``--edition=auto``, the default).
``current-edition`` ``current-edition``
Currently selected edition. This property is unavailable if no file is Currently selected edition. This property is unavailable if no file is
@@ -2374,6 +2448,9 @@ Property list
``edition-list/N/title`` ``edition-list/N/title``
Edition title as stored in the file. Not always available. Edition title as stored in the file. Not always available.
``edition-list/N/metadata``
Per-edition metadata key/value pairs.
When querying the property with the client API using ``MPV_FORMAT_NODE``, When querying the property with the client API using ``MPV_FORMAT_NODE``,
or with Lua ``mp.get_property_native``, this will return a mpv_node with or with Lua ``mp.get_property_native``, this will return a mpv_node with
the following contents: the following contents:
@@ -2385,6 +2462,7 @@ Property list
"id" MPV_FORMAT_INT64 "id" MPV_FORMAT_INT64
"title" MPV_FORMAT_STRING "title" MPV_FORMAT_STRING
"default" MPV_FORMAT_FLAG "default" MPV_FORMAT_FLAG
"metadata" MPV_FORMAT_NODE_MAP
``metadata`` ``metadata``
Metadata key/value pairs. Metadata key/value pairs.
@@ -2399,7 +2477,7 @@ Property list
This has a number of sub-properties: This has a number of sub-properties:
``metadata/by-key/<key>`` ``metadata/by-key/<key>`` (RW)
Value of metadata entry ``<key>``. Value of metadata entry ``<key>``.
``metadata/list/count`` ``metadata/list/count``
@@ -2456,7 +2534,8 @@ Property list
Equivalent to ``vf-metadata/<filter-label>``, but for audio filters. Equivalent to ``vf-metadata/<filter-label>``, but for audio filters.
``deinterlace-active`` ``deinterlace-active``
Returns ``yes``/true if mpv's deinterlacing filter is active. Note that it Returns ``yes``/true if mpv's deinterlacing filter is active. This is only
a guess with ``--deinterlace=auto`` and may not be accurate. Note that it
will not detect any manually inserted deinterlacing filters done via will not detect any manually inserted deinterlacing filters done via
``--vf``. ``--vf``.
@@ -2473,7 +2552,7 @@ Property list
This also returns ``yes``/true if playback is restarting or if nothing is This also returns ``yes``/true if playback is restarting or if nothing is
playing at all. In other words, it's only ``no``/false if there's actually playing at all. In other words, it's only ``no``/false if there's actually
video playing. (Behavior since mpv 0.7.0.) video playing.
``cache-speed`` ``cache-speed``
Current I/O read speed between the cache and the lower layer (like network). Current I/O read speed between the cache and the lower layer (like network).
@@ -2552,8 +2631,8 @@ Property list
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_MAP
"seekable-ranges" MPV_FORMAT_NODE_ARRAY "seekable-ranges" MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_MAP
"start" MPV_FORMAT_DOUBLE "start" MPV_FORMAT_DOUBLE
"end" MPV_FORMAT_DOUBLE "end" MPV_FORMAT_DOUBLE
"bof-cached" MPV_FORMAT_FLAG "bof-cached" MPV_FORMAT_FLAG
"eof-cached" MPV_FORMAT_FLAG "eof-cached" MPV_FORMAT_FLAG
"fw-bytes" MPV_FORMAT_INT64 "fw-bytes" MPV_FORMAT_INT64
@@ -2564,10 +2643,10 @@ Property list
"raw-input-rate" MPV_FORMAT_INT64 "raw-input-rate" MPV_FORMAT_INT64
"ts-per-stream" MPV_FORMAT_NODE_ARRAY "ts-per-stream" MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_MAP
"type" MPV_FORMAT_STRING "type" MPV_FORMAT_STRING
"cache-duration" MPV_FORMAT_DOUBLE "cache-duration" MPV_FORMAT_DOUBLE
"reader-pts" MPV_FORMAT_DOUBLE "reader-pts" MPV_FORMAT_DOUBLE
"cache-end" MPV_FORMAT_DOUBLE "cache-end" MPV_FORMAT_DOUBLE
Other fields (might be changed or removed in the future): Other fields (might be changed or removed in the future):
@@ -2618,8 +2697,7 @@ Property list
``mixer-active`` ``mixer-active``
Whether the audio mixer is active. Whether the audio mixer is active.
This option is relatively useless. Before mpv 0.18.1, it could be used to This option is relatively useless.
infer behavior of the ``volume`` property.
``ao-volume`` (RW) ``ao-volume`` (RW)
System volume. This property is available only if mpv audio output is System volume. This property is available only if mpv audio output is
@@ -2692,9 +2770,8 @@ Property list
seek to refresh the video properly.) You can watch the other hwdec seek to refresh the video properly.) You can watch the other hwdec
properties to see whether this was successful. properties to see whether this was successful.
Unlike in mpv 0.9.x and before, this does not return the currently active This does not return the currently active hardware decoder.
hardware decoder. Since mpv 0.18.0, ``hwdec-current`` is available for ``hwdec-current`` is available for this purpose.
this purpose.
``hwdec-current`` ``hwdec-current``
The current hardware decoding in use. If decoding is active, return one of The current hardware decoding in use. If decoding is active, return one of
@@ -2852,6 +2929,7 @@ Property list
"dw" MPV_FORMAT_INT64 "dw" MPV_FORMAT_INT64
"dh" MPV_FORMAT_INT64 "dh" MPV_FORMAT_INT64
"aspect" MPV_FORMAT_DOUBLE "aspect" MPV_FORMAT_DOUBLE
"aspect-name" MPV_FORMAT_STRING
"par" MPV_FORMAT_DOUBLE "par" MPV_FORMAT_DOUBLE
"colormatrix" MPV_FORMAT_STRING "colormatrix" MPV_FORMAT_STRING
"colorlevels" MPV_FORMAT_STRING "colorlevels" MPV_FORMAT_STRING
@@ -3080,8 +3158,15 @@ Property list
``mouse-pos/hover`` ``mouse-pos/hover``
Boolean - whether the mouse pointer hovers the video window. The Boolean - whether the mouse pointer hovers the video window. The
coordinates should be ignored when this value is false, because the coordinates should be ignored when this value is false if no mouse
video backends update them only when the pointer hovers the window. button is being pressed, because the video backends update them only
when the pointer hovers the window in this case.
If a mouse button is pressed while the pointer hovers the video window
and then the mouse pointer moves out of window region without releasing
the button, some video backends "capture" the pointer and still report
the coordinates. In this case, the value of this property may be true or
false depending on the video backend.
``touch-pos`` ``touch-pos``
Read-only - last known touch point positions, normalized to OSD dimensions. Read-only - last known touch point positions, normalized to OSD dimensions.
@@ -3132,6 +3217,52 @@ Property list
``tablet-pos/pad-btns/N`` ``tablet-pos/pad-btns/N``
The state of the Nth tablet pad button, ``pressed`` or ``released``. The state of the Nth tablet pad button, ``pressed`` or ``released``.
::
MPV_FORMAT_NODE_MAP
"x" MPV_FORMAT_INT64
"y" MPV_FORMAT_INT64
"tool-in-proximity" MPV_FORMAT_FLAG
"tool-tip" MPV_FORMAT_STRING
"tool-stylus-btn1" MPV_FORMAT_STRING
"tool-stylus-btn2" MPV_FORMAT_STRING
"tool-stylus-btn3" MPV_FORMAT_STRING
"pad-focus" MPV_FORMAT_FLAG
"pad-btns" MPV_FORMAT_NODE_MAP
(key and string value for each pad-btn entry)
``dropped-files``
Information of the most recent drag-and-drop event mpv received.
A client can observe this property to detect when a drag-and-drop event
happens. This property is unavailable if no drag-and-drop event has
happened.
Has the following sub-properties:
``dropped-files/time``
The timestamp of the last drag-and-drop event mpv received, in
nanoseconds. This uses the same clock as ``mpv_get_time_ns()``.
``dropped-files/action``
The action of the drag-and-drop event. This is normally ``replace``.
Depending on the platform, this can also be ``append`` in some cases,
such as shift key being held while files are dropped.
``dropped-files/files``
The dropped file names of the drag-and-drop event.
When querying the property with the client API using ``MPV_FORMAT_NODE``,
or with Lua ``mp.get_property_native``, this will return a mpv_node with
the following contents:
::
MPV_FORMAT_NODE_MAP
"time" MPV_FORMAT_INT64
"action" MPV_FORMAT_STRING
"files" MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_STRING
``sub-ass-extradata`` ``sub-ass-extradata``
The current ASS subtitle track's extradata. There is no formatting done. The current ASS subtitle track's extradata. There is no formatting done.
The extradata is returned as a string as-is. This property is not The extradata is returned as a string as-is. This property is not
@@ -3191,6 +3322,29 @@ Property list
``secondary-sub-end`` ``secondary-sub-end``
Same as ``sub-end``, but for the secondary subtitles. Same as ``sub-end``, but for the secondary subtitles.
``sub-lines``
The list of subtitle lines in memory. Not available if the subtitle is not
text-based (i.e. DVD/BD subtitles).
When querying the property with the client API using ``MPV_FORMAT_NODE``,
or with Lua ``mp.get_property_native``, this will return a mpv_node with
the following contents:
::
MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP (for each subtitle line)
"text" MPV_FORMAT_STRING
"start" MPV_FORMAT_DOUBLE
"end" MPV_FORMAT_DOUBLE
ASS tags are stripped from ``text``.
``end`` is absent if unknown.
``secondary-sub-lines``
Same as ``sub-lines``, but for the secondary subtitles.
``playlist-pos`` (RW) ``playlist-pos`` (RW)
Current position on playlist. The first entry is on position 0. Writing to Current position on playlist. The first entry is on position 0. Writing to
this property may start playback at the new position. this property may start playback at the new position.
@@ -3202,8 +3356,6 @@ Property list
"current", this property returns -1. Likewise, writing -1 will put the "current", this property returns -1. Likewise, writing -1 will put the
player into idle mode (or exit playback if idle mode is not enabled). If an player into idle mode (or exit playback if idle mode is not enabled). If an
out of range index is written to the property, this behaves as if writing -1. out of range index is written to the property, this behaves as if writing -1.
(Before mpv 0.33.0, instead of returning -1, this property was unavailable
if no playlist entry was current.)
Writing the current value back to the property will have no effect. Writing the current value back to the property will have no effect.
Use ``playlist-play-index`` to restart the playback of the current entry if Use ``playlist-play-index`` to restart the playback of the current entry if
@@ -3299,14 +3451,16 @@ Property list
MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP (for each playlist entry) MPV_FORMAT_NODE_MAP (for each playlist entry)
"filename" MPV_FORMAT_STRING "filename" MPV_FORMAT_STRING
"current" MPV_FORMAT_FLAG (might be missing; since mpv 0.7.0) "current" MPV_FORMAT_FLAG (might be missing)
"playing" MPV_FORMAT_FLAG (same) "playing" MPV_FORMAT_FLAG (same)
"title" MPV_FORMAT_STRING (optional) "title" MPV_FORMAT_STRING (optional)
"id" MPV_FORMAT_INT64 "id" MPV_FORMAT_INT64
"playlist-path" MPV_FORMAT_STRING (optional)
``track-list`` ``track-list``
List of audio/video/sub tracks, current entry marked. List of audio/video/sub tracks, current entry marked. When the file has
editions, only tracks belonging to the currently selected edition are listed.
This has a number of sub-properties. Replace ``N`` with the 0-based track This has a number of sub-properties. Replace ``N`` with the 0-based track
index. index.
@@ -3380,7 +3534,13 @@ Property list
The bitrate of the HLS stream, if available. The bitrate of the HLS stream, if available.
``track-list/N/program-id`` ``track-list/N/program-id``
The program ID of the HLS stream, if available. The first program ID this stream belongs to, if any. Deprecated,
use ``track-list/N/program-ids``.
``track-list/N/program-ids``
A list of all program IDs this stream belongs to. A stream can belong
to more than one program (e.g. in MPEG-TS or HLS). Unavailable if the
stream does not belong to any program.
``track-list/N/codec`` ``track-list/N/codec``
The codec name used by this track, for example ``h264``. Unavailable The codec name used by this track, for example ``h264``. Unavailable
@@ -3448,7 +3608,7 @@ Property list
Video FPS as indicated by the container. (Not always accurate.) Video FPS as indicated by the container. (Not always accurate.)
``track-list/N/demux-bitrate`` ``track-list/N/demux-bitrate``
Audio average bitrate, in bits per second. (Not always accurate.) Average bitrate, in bits per second. (Not always accurate.)
``track-list/N/demux-rotation`` ``track-list/N/demux-rotation``
Video clockwise rotation metadata, in degrees. Video clockwise rotation metadata, in degrees.
@@ -3456,6 +3616,9 @@ Property list
``track-list/N/demux-par`` ``track-list/N/demux-par``
Pixel aspect ratio. Pixel aspect ratio.
``track-list/N/demux-duration``
Track duration as indicated by the container.
``track-list/N/format-name`` ``track-list/N/format-name``
Short name for format from ffmpeg. If the track is audio, this will be Short name for format from ffmpeg. If the track is audio, this will be
the name of the sample format. If the track is video, this will be the the name of the sample format. If the track is video, this will be the
@@ -3504,6 +3667,7 @@ Property list
"hearing-impaired" MPV_FORMAT_FLAG "hearing-impaired" MPV_FORMAT_FLAG
"hls-bitrate" MPV_FORMAT_INT64 "hls-bitrate" MPV_FORMAT_INT64
"program-id" MPV_FORMAT_INT64 "program-id" MPV_FORMAT_INT64
"program-ids" MPV_FORMAT_NODE_ARRAY[MPV_FORMAT_INT64]
"selected" MPV_FORMAT_FLAG "selected" MPV_FORMAT_FLAG
"main-selection" MPV_FORMAT_INT64 "main-selection" MPV_FORMAT_INT64
"external" MPV_FORMAT_FLAG "external" MPV_FORMAT_FLAG
@@ -3551,6 +3715,8 @@ Property list
If tracks of the requested type are selected via ``--lavfi-complex``, the If tracks of the requested type are selected via ``--lavfi-complex``, the
first one is returned. first one is returned.
Note that this property cannot be used directly, a sub-property is required.
``chapter-list`` (RW) ``chapter-list`` (RW)
List of chapters, current entry marked. List of chapters, current entry marked.
@@ -3592,8 +3758,7 @@ Property list
"label" MPV_FORMAT_STRING [optional] "label" MPV_FORMAT_STRING [optional]
"enabled" MPV_FORMAT_FLAG [optional] "enabled" MPV_FORMAT_FLAG [optional]
"params" MPV_FORMAT_NODE_MAP [optional] "params" MPV_FORMAT_NODE_MAP [optional]
"key" MPV_FORMAT_STRING (key and string value for each param entry)
"value" MPV_FORMAT_STRING
It's also possible to write the property using this format. It's also possible to write the property using this format.
@@ -3699,15 +3864,16 @@ Property list
:: ::
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_MAP
"TYPE" MPV_FORMAT_NODE_ARRAY (key and array value for each TYPE entry)
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_ARRAY (for each pass entry)
"desc" MPV_FORMAT_STRING MPV_FORMAT_NODE_MAP
"last" MPV_FORMAT_INT64 "desc" MPV_FORMAT_STRING
"avg" MPV_FORMAT_INT64 "last" MPV_FORMAT_INT64
"peak" MPV_FORMAT_INT64 "avg" MPV_FORMAT_INT64
"count" MPV_FORMAT_INT64 "peak" MPV_FORMAT_INT64
"samples" MPV_FORMAT_NODE_ARRAY "count" MPV_FORMAT_INT64
MP_FORMAT_INT64 "samples" MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_INT64
Note that directly accessing this structure via subkeys is not supported, Note that directly accessing this structure via subkeys is not supported,
the only access is through aforementioned ``MPV_FORMAT_NODE``. the only access is through aforementioned ``MPV_FORMAT_NODE``.
@@ -3827,6 +3993,10 @@ Property list
the left, right, top, and bottom margins respectively. the left, right, top, and bottom margins respectively.
Values are between 0.0 and 1.0, normalized to window width/height. Values are between 0.0 and 1.0, normalized to window width/height.
``user-data/osc/draw-preview``
Used to communicate between osc and compatible thumbnailer (if
installed). See `OSC Preview API`_ section for more details.
``user-data/mpv/ytdl`` ``user-data/mpv/ytdl``
Data shared by the builtin ytdl hook script. Data shared by the builtin ytdl hook script.
@@ -3843,6 +4013,9 @@ Property list
``user-data/mpv/console/open`` ``user-data/mpv/console/open``
Whether the console is open. Whether the console is open.
``user-data/mpv/context-menu/open``
Whether the context menu script is open.
``menu-data`` (RW) ``menu-data`` (RW)
This property stores the raw menu definition. See `Context Menu`_ section for details. This property stores the raw menu definition. See `Context Menu`_ section for details.
@@ -3960,6 +4133,17 @@ Property list
somewhat weird form (apparently "hex BCD"), indicating the release version somewhat weird form (apparently "hex BCD"), indicating the release version
of the libass library linked to mpv. of the libass library linked to mpv.
``libplacebo-version``
The contents of the ``PL_VERSION`` macro. This is a string which identifies
the build in some way, either through a release version number, or a git
hash.
``subrandr-version``
The value of ``sbr_library_version()`` as a string in the format
``<major>.<minor>.<patch>``, indicating the release version of the subrandr
library at runtime. This property is unavailable if mpv is not compiled
with subrandr enabled.
``platform`` ``platform``
Returns a string describing what target platform mpv was built for. The value Returns a string describing what target platform mpv was built for. The value
of this is dependent on what the underlying build system detects. Some of the of this is dependent on what the underlying build system detects. Some of the
@@ -4029,6 +4213,20 @@ Property list
are not actual choice options internally, may not have this info are not actual choice options internally, may not have this info
available. available.
::
MPV_FORMAT_NODE_MAP
"name" MPV_FORMAT_STRING
"type" MPV_FORMAT_STRING
"set-from-commandline" MPV_FORMAT_FLAG
"set-locally" MPV_FORMAT_FLAG
"expects-file" MPV_FORMAT_FLAG
"default-value" MPV_FORMAT_NODE (optional, value of "type")
"min" MPV_FORMAT_DOUBLE (optional)
"max" MPV_FORMAT_DOUBLE (optional)
"choices" MPV_FORMAT_NODE_ARRAY (optional)
MPV_FORMAT_STRING
``property-list`` ``property-list``
The list of top-level properties. The list of top-level properties.
@@ -4044,6 +4242,16 @@ Property list
value (either because it was not set, or set explicitly to ``default``), value (either because it was not set, or set explicitly to ``default``),
but in the future it might hold the value ``default``. but in the future it might hold the value ``default``.
::
MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP (for each profile entry)
"name" MPV_FORMAT_STRING
"options" MPV_FORMAT_NODE_ARRAY (for each option entry)
MPV_FORMAT_NODE_MAP
"key" MPV_FORMAT_STRING
"value" MPV_FORMAT_STRING
``command-list`` ``command-list``
The list of input commands. This returns an array of maps, where each map The list of input commands. This returns an array of maps, where each map
node represents a command. This map has the following entries: node represents a command. This map has the following entries:
@@ -4079,9 +4287,12 @@ Property list
"vararg" MPV_FORMAT_FLAG "vararg" MPV_FORMAT_FLAG
"args" MPV_FORMAT_NODE_ARRAY "args" MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP MPV_FORMAT_NODE_MAP
"name" MPV_FORMAT_STRING "name" MPV_FORMAT_STRING
"type" MPV_FORMAT_STRING "type" MPV_FORMAT_STRING
"optional" MPV_FORMAT_FLAG "optional" MPV_FORMAT_FLAG
"default-value" MPV_FORMAT_NODE (optional, value of "type")
"choices" MPV_FORMAT_NODE_ARRAY (optional)
MPV_FORMAT_STRING
``input-bindings`` ``input-bindings``
The list of current input key bindings. This returns an array of maps, The list of current input key bindings. This returns an array of maps,
@@ -4121,6 +4332,18 @@ Property list
example, the input.conf entry ``f cycle bla # toggle bla`` would example, the input.conf entry ``f cycle bla # toggle bla`` would
result in an entry with ``comment = "toggle bla", cmd = "cycle bla"``.) result in an entry with ``comment = "toggle bla", cmd = "cycle bla"``.)
::
MPV_FORMAT_NODE_ARRAY
MPV_FORMAT_NODE_MAP
"key" MPV_FORMAT_STRING
"cmd" MPV_FORMAT_STRING
"is_weak" MPV_FORMAT_FLAG
"owner" MPV_FORMAT_STRING (optional)
"section" MPV_FORMAT_STRING
"priority" MPV_FORMAT_INT64
"comment" MPV_FORMAT_STRING (optional)
This property is read-only, and change notification is not supported. This property is read-only, and change notification is not supported.
``clipboard`` ``clipboard``
@@ -4146,10 +4369,28 @@ Property list
does not have this limitation. does not have this limitation.
See ``current-clipboard-backend`` property for more details. See ``current-clipboard-backend`` property for more details.
.. warning::
Since mpv 0.42.0, this property does not return the current clipboard
content on certain platforms if ``--clipboard-monitor=no``.
When reading clipboard content, you must run ``update-clipboard``
command to update the clipboard content manually in this case.
::
MPV_FORMAT_NODE_MAP
"text" MPV_FORMAT_STRING
"text-primary" MPV_FORMAT_STRING
``current-clipboard-backend`` ``current-clipboard-backend``
A string containing the currently active clipboard backend. A string containing the currently active clipboard backend.
See ``--clipboard-backends`` option for the list of available backends. See ``--clipboard-backends`` option for the list of available backends.
``player-operation-mode``
A read-only string of the current player operation mode, mirroring the
``--player-operation-mode`` option. To set operation mode, set the option
at startup instead.
``clock`` ``clock``
The current local time in hour:minutes format. The current local time in hour:minutes format.
@@ -4164,8 +4405,6 @@ caveats with some properties (due to historical reasons):
example, if you set ``aid=5``, and the currently played file contains no example, if you set ``aid=5``, and the currently played file contains no
audio track with ID 5, the ``aid`` property will return ``no``. audio track with ID 5, the ``aid`` property will return ``no``.
Before mpv 0.31.0, you could set existing tracks at runtime only.
``display-fps`` ``display-fps``
This inconsistent behavior is deprecated. Post-deprecation, the reported This inconsistent behavior is deprecated. Post-deprecation, the reported
value and the option value are cleanly separated (``override-display-fps`` value and the option value are cleanly separated (``override-display-fps``
@@ -4177,10 +4416,6 @@ caveats with some properties (due to historical reasons):
change. On the other hand, the next video to be played will fail, because change. On the other hand, the next video to be played will fail, because
the initial filter chain cannot be created. the initial filter chain cannot be created.
This behavior changed in mpv 0.31.0. Before this, the new value was rejected
*iff* a video (for ``vf``) or an audio (for ``af``) track was active. If
playback was not active, the behavior was the same as the current one.
``playlist`` ``playlist``
The property is read-only and returns the current internal playlist. The The property is read-only and returns the current internal playlist. The
option is for loading playlist during command line parsing. For client API option is for loading playlist during command line parsing. For client API
-4
View File
@@ -204,8 +204,6 @@ string/boolean/number)
``mp.input.log(message, style)`` ``mp.input.log(message, style)``
``mp.input.log_error(message)``
``mp.input.set_log(log)`` ``mp.input.set_log(log)``
``exit()`` (global) ``exit()`` (global)
@@ -352,8 +350,6 @@ paths - like ``<script-dir>/modules`` for scripts which load from a directory).
The custom-init file is ignored if mpv is invoked with ``--no-config``. The custom-init file is ignored if mpv is invoked with ``--no-config``.
Before mpv 0.34, the file name was ``.init.js`` (with dot) at the same dir.
The event loop The event loop
-------------- --------------
+1 -1
View File
@@ -22,7 +22,7 @@ You can write C plugins for mpv. These use the libmpv API, although they do not
use the libmpv library itself. use the libmpv library itself.
They are enabled by default if compiler supports linking with the ``-rdynamic`` They are enabled by default if compiler supports linking with the ``-rdynamic``
flag on Linux/BSD platforms. On Windows the are always enabled. flag on Linux/BSD platforms. On Windows they are always enabled.
C plugins location C plugins location
------------------ ------------------
+77 -38
View File
@@ -61,8 +61,7 @@ that uses the ``.foo`` file extension.
mpv also appends the top level directory of the script to the start of Lua's mpv also appends the top level directory of the script to the start of Lua's
package path so you can import scripts from there too. Be aware that this will package path so you can import scripts from there too. Be aware that this will
shadow Lua libraries that use the same package path. (Single file scripts do not shadow Lua libraries that use the same package path. (Single file scripts do not
include mpv specific directories in the Lua package path. This was silently include mpv specific directories in the Lua package path.)
changed in mpv 0.32.0.)
Using a script directory is the recommended way to package a script that Using a script directory is the recommended way to package a script that
consists of multiple source files, or requires other files (you can use consists of multiple source files, or requires other files (you can use
@@ -100,17 +99,14 @@ The event loop will wait for events and dispatch events registered with
``mp.register_event``. It will also handle timers added with ``mp.add_timeout`` ``mp.register_event``. It will also handle timers added with ``mp.add_timeout``
and similar (by waiting with a timeout). and similar (by waiting with a timeout).
Since mpv 0.6.0, the player will wait until the script is fully loaded before The player will wait until the script is fully loaded before continuing normal
continuing normal operation. The player considers a script as fully loaded as operation. The player considers a script as fully loaded as soon as it starts
soon as it starts waiting for mpv events (or it exits). In practice this means waiting for mpv events (or it exits). In practice this means the player will
the player will more or less hang until the script returns from the main chunk more or less hang until the script returns from the main chunk (and
(and ``mp_event_loop`` is called), or the script calls ``mp_event_loop`` or ``mp_event_loop`` is called), or the script calls ``mp_event_loop`` or
``mp.dispatch_events`` directly. This is done to make it possible for a script ``mp.dispatch_events`` directly. This is done to make it possible for a script
to fully setup event handlers etc. before playback actually starts. In older to fully setup event handlers etc. before playback actually starts. Scripts run
mpv versions, this happened asynchronously. With mpv 0.29.0, this changes though initialization in parallel.
slightly, and it merely waits for scripts to be loaded in this manner before
starting playback as part of the player initialization phase. Scripts run though
initialization in parallel. This might change again.
mp functions mp functions
------------ ------------
@@ -159,11 +155,14 @@ The ``mp`` module is preloaded, although it can be loaded manually with
``mp.commandv()`` (but can be a native type instead of a string). ``mp.commandv()`` (but can be a native type instead of a string).
If the table contains string keys, it's interpreted as command with named If the table contains string keys, it's interpreted as command with named
arguments. This requires at least an entry with the key ``name`` to be arguments. This requires at least an entry with the key ``_name`` to be
present, which must be a string, and contains the command name. The special present, which must be a string, and contains the command name.
entry ``_flags`` is optional, and if present, must be an array of For compatibility, if the key ``_name`` does not exist, then the entry with
`Input Command Prefixes`_ to apply. All other entries are interpreted as the key ``name`` will be used instead. The special entry ``_flags`` is
arguments. optional, and if present, must be an array of `Input Command Prefixes`_ to
apply. All other entries are interpreted as arguments. Note that some
commands have arguments named ``name``, and can only be used if the command
name is specified with key ``_name`` instead of ``name``.
Returns a result table on success (usually empty), or ``def, error`` on Returns a result table on success (usually empty), or ``def, error`` on
error. ``def`` is the second parameter provided to the function, and is error. ``def`` is the second parameter provided to the function, and is
@@ -419,7 +418,7 @@ The ``mp`` module is preloaded, although it can be loaded manually with
and the function fn is a Lua function value. and the function fn is a Lua function value.
Some events have associated data. This is put into a Lua table and passed Some events have associated data. This is put into a Lua table and passed
as argument to fn. The Lua table by default contains a ``name`` field, as argument to fn. The Lua table by default contains a ``event`` field,
which is a string containing the event name. If the event has an error which is a string containing the event name. If the event has an error
associated, the ``error`` field is set to a string describing the error, associated, the ``error`` field is set to a string describing the error,
on success it's not set. on success it's not set.
@@ -850,7 +849,7 @@ strictly part of the guaranteed API.
- rename ``cancellable`` field to ``playback_only`` - rename ``cancellable`` field to ``playback_only``
- rename ``max_size`` to ``capture_size`` - rename ``max_size`` to ``capture_size``
- set ``capture_stdout`` field to ``true`` if unset - set ``capture_stdout`` field to ``true`` if unset
- set ``name`` field to ``subprocess`` - set ``_name`` field to ``subprocess``
- call ``mp.command_native(copied_t)`` - call ``mp.command_native(copied_t)``
- if the command failed, create a dummy result table - if the command failed, create a dummy result table
- copy ``error_string`` to ``error`` field if the string is non-empty - copy ``error_string`` to ``error`` field if the string is non-empty
@@ -913,8 +912,7 @@ strictly part of the guaranteed API.
mp.input functions mp.input functions
-------------------- --------------------
This module lets scripts get textual input from the user using the console This module lets scripts get textual input from the user using the console.
REPL.
``input.get(table)`` ``input.get(table)``
Show the console to let the user enter text. Show the console to let the user enter text.
@@ -929,11 +927,16 @@ REPL.
the text in the console. the text in the console.
``keep_open`` ``keep_open``
Whether to keep the console open on submit. Defaults to ``false``. Whether to keep the console open on submit, allowing further input.
Defaults to ``false``.
If calling ``input.get()`` or ``input.select()`` again from inside the
``submit`` callback, setting this option to ``true`` allows a seamless
transition without the console closing and reopening.
``opened`` ``opened``
A callback invoked when the console is shown. This can be used to A callback invoked when the console is shown. This can be used to
present a list of options with ``input.set_log()``. override keybinds set by the console with ``mp.add_forced_key_binding()``.
``edited`` ``edited``
A callback invoked when the text changes. The first argument is the text A callback invoked when the text changes. The first argument is the text
@@ -941,14 +944,21 @@ REPL.
``complete`` ``complete``
A callback invoked when the user edits the text or moves the cursor. The A callback invoked when the user edits the text or moves the cursor. The
first argument is the text before the cursor. The callback should return first argument is the text before the cursor, and the second argument is
a table of the string candidate completion values and the 1-based cursor a response function which can be called to present completion values to
the user.
The first argument to the response function is a table of the string
candidate completion values, and the second argument is the 1-based cursor
position from which the completion starts. console will show the position from which the completion starts. console will show the
completions that fuzzily match the text between this position and the completions that fuzzily match the text between this position and the
cursor and allow selecting them. cursor, which the user can select with ``TAB``. The completions will only
be shown to the user if the text before the cursor has not since changed.
The response function should be called with an empty table if there are no
completion values to display.
The third and optional return value is a string that will be appended to The third and optional argument to the response function is a string that
the input line without displaying it in the completions. will be appended to the input line without displaying it in the completions.
``autoselect_completion`` ``autoselect_completion``
Whether to automatically select the first completion on submit if one Whether to automatically select the first completion on submit if one
@@ -975,20 +985,23 @@ REPL.
among the ones stored for ``input.get()`` calls. Defaults to the calling among the ones stored for ``input.get()`` calls. Defaults to the calling
script name with ``prompt`` appended. script name with ``prompt`` appended.
``console_opt_overrides``
A table containing configuration overrides for the console script.
Can be used to change the visual style of the text input, among other things.
See `CONSOLE`_ for the full list of options.
``input.terminate()`` ``input.terminate()``
Close the console. Closes any currently active input request. This will not close
requests made by other scripts.
``input.log(message, style, terminal_style)`` ``input.log(message, style, terminal_style)``
Add a line to the log buffer. ``style`` can contain additional ASS tags to Add a line to the log buffer of the latest ``input.get()`` request.
apply to ``message``, and ``terminal_style`` can contain escape sequences ``style`` can contain additional ASS tags to apply to ``message``,
that are used when the console is displayed in the terminal. and ``terminal_style`` can contain escape sequences that are used
when the console is displayed in the terminal.
``input.log_error(message)``
Helper to add a line to the log buffer with the same color as the one used
for commands that error. Useful when the user submits invalid input.
``input.set_log(log)`` ``input.set_log(log)``
Replace the entire log buffer. Replace the entire log buffer of the latest ``input.get()`` request.
``log`` is a table of strings, or tables with ``text``, ``style`` and ``log`` is a table of strings, or tables with ``text``, ``style`` and
``terminal_style`` keys. ``terminal_style`` keys.
@@ -1025,7 +1038,33 @@ REPL.
the 1-based index of the selected item. the 1-based index of the selected item.
``keep_open`` ``keep_open``
Whether to keep the console open on submit. Defaults to ``false``. Whether to keep the console open on submit, allowing further input.
Defaults to ``false``.
If calling ``input.get()`` or ``input.select()`` again from inside the
``submit`` callback, setting this option to ``true`` allows a seamless
transition without the console closing and reopening.
``opened``
A callback invoked when the console is shown. This can be used to
override keybinds set by the console with ``mp.add_forced_key_binding()``.
``closed``
A callback invoked when the console is hidden, either because
``input.terminate()`` was invoked from the other callbacks, or because
the user closed it with a key binding. The first argument is the text in
the console, and the second argument is the cursor position.
``default_text``
A string to pre-fill the input field with.
``cursor_position``
The initial cursor position, starting from 1.
``console_opt_overrides``
A table containing configuration overrides for the console script.
Can be used to change the visual style of the select window, among other things.
See `CONSOLE`_ for the full list of options.
Example: Example:
+66 -39
View File
@@ -257,6 +257,10 @@ Ctrl+v
currently playing, it is played immediately. Only works on platforms that currently playing, it is played immediately. Only works on platforms that
support the ``clipboard`` property. support the ``clipboard`` property.
Ctrl+r
Reload the current file, preserving the time position and any changed
option. Empties any network cache.
i and I i and I
Show/toggle an overlay displaying statistics about the currently playing Show/toggle an overlay displaying statistics about the currently playing
file such as codec, framerate, number of dropped frames and so on. See file such as codec, framerate, number of dropped frames and so on. See
@@ -332,8 +336,10 @@ g-e
Select an MKV edition or DVD/Blu-ray title. Select an MKV edition or DVD/Blu-ray title.
g-l g-l
Select a subtitle line to seek to. This currently requires ``ffmpeg`` in Select a subtitle line to seek to.
``PATH``, or in the same folder as mpv on Windows.
g-L
Select a secondary subtitle line to seek to.
g-d g-d
Select an audio device. Select an audio device.
@@ -351,11 +357,14 @@ g-b
g-r g-r
Show the values of all properties. Show the values of all properties.
g-m, MENU, Ctrl+p g-m, Ctrl+p
Show a menu with miscellaneous entries. Show a menu with miscellaneous entries.
See `SELECT`_ for more information. See `SELECT`_ for more information.
MENU, Shift+F10
Show the context menu (see `CONTEXT MENU`_).
(The following keys are valid if you have a keyboard with multimedia keys.) (The following keys are valid if you have a keyboard with multimedia keys.)
PAUSE PAUSE
@@ -399,16 +408,6 @@ Ctrl+Wheel up/down
Change video zoom keeping the part of the video hovered by the cursor under Change video zoom keeping the part of the video hovered by the cursor under
it. it.
Context Menu
-------------
Context Menu is a menu that pops up on the video window on user interaction
(mouse right click, etc.).
To use this feature, you need to fill the ``menu-data`` property with menu
definition data, and add a keybinding to run the ``context-menu`` command,
which can be done with a user script.
USAGE USAGE
===== =====
@@ -443,12 +442,10 @@ because ``--fs`` is a flag option that requires no parameter. If an option
changes and its parameter becomes optional, then a command line using the changes and its parameter becomes optional, then a command line using the
alternative syntax will break. alternative syntax will break.
Until mpv 0.31.0, there was no difference whether an option started with ``--`` For options starting with ``--``, mpv expects that you pass the option value
or a single ``-``. Newer mpv releases strictly expect that you pass the option after a ``=``. For example, ``mpv --log-file f.txt`` will fail, as
value after a ``=``. For example, before ``mpv --log-file f.txt`` would write ``--log-file`` expects an option value, and ``f.txt`` is simply considered a
a log to ``f.txt``, but now this command line fails, as ``--log-file`` expects normal file to be played (as in ``mpv f.txt``).
an option value, and ``f.txt`` is simply considered a normal file to be played
(as in ``mpv f.txt``).
The future plan is that ``-option value`` will not work anymore, and options The future plan is that ``-option value`` will not work anymore, and options
with a single ``-`` behave the same as ``--`` options. with a single ``-`` behave the same as ``--`` options.
@@ -487,9 +484,9 @@ quotes.
The ``[...]`` form of quotes wraps everything between ``[`` and ``]``. It's The ``[...]`` form of quotes wraps everything between ``[`` and ``]``. It's
useful with shells that don't interpret these characters in the middle of useful with shells that don't interpret these characters in the middle of
an argument (like bash). These quotes are balanced (since mpv 0.9.0): the ``[`` an argument (like bash). These quotes are balanced: the ``[`` and ``]`` nest,
and ``]`` nest, and the quote terminates on the last ``]`` that has no matching and the quote terminates on the last ``]`` that has no matching ``[`` within the
``[`` within the string. (For example, ``[a[b]c]`` results in ``a[b]c``.) string. (For example, ``[a[b]c]`` results in ``a[b]c``.)
The fixed-length quoting syntax is intended for use with external The fixed-length quoting syntax is intended for use with external
scripts and programs. scripts and programs.
@@ -528,6 +525,13 @@ UNIX path. To avoid problems with arbitrary paths, you should be sure that
absolute paths passed to mpv start with ``/``, and prefix relative paths with absolute paths passed to mpv start with ``/``, and prefix relative paths with
``./``. ``./``.
URLs that are passed to mpv should be percent-encoded for it to work reliably.
There are some heuristics in place that tries to automatically do it, but these
heuristics are not foolproof. For example, in order to play a file literally
named ``foo%20.mp4``, using ``http://localhost/foo%20.mp4`` without any
percent-encoding will not work. Percent-encoding it as
``http://localhost/foo%2520.mp4`` will work as expected.
Using the ``file://`` pseudo-protocol is discouraged, because it involves Using the ``file://`` pseudo-protocol is discouraged, because it involves
strange URL unescaping rules. strange URL unescaping rules.
@@ -699,8 +703,6 @@ recommended to use the ``-append`` variant. When using libmpv, prefer using
``MPV_FORMAT_NODE_MAP``; when using a scripting backend or the JSON IPC, use an ``MPV_FORMAT_NODE_MAP``; when using a scripting backend or the JSON IPC, use an
appropriate structured data type. appropriate structured data type.
Prior to mpv 0.33, ``:`` was also recognized as separator by ``-set``.
Object settings list options Object settings list options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -858,7 +860,7 @@ or at runtime with the ``apply-profile <name>`` command.
[network] [network]
demuxer-max-back-bytes=512MiB demuxer-max-back-bytes=512MiB
# reference a builtin profile # reference a builtin profile
profile=fast profile=low-latency
Runtime profiles Runtime profiles
---------------- ----------------
@@ -1439,22 +1441,28 @@ PROTOCOLS
Only works with seekable streams. Only works with seekable streams.
Examples:: .. admonition:: Example
mpv slice://1g-2g@cap.ts ::
This starts reading from cap.ts after seeking 1 GiB, then mpv slice://1g-2g@cap.ts
reads until reaching 2 GiB or end of file.
mpv slice://1g-+2g@cap.ts This starts reading from cap.ts after seeking 1 GiB, then
reads until reaching 2 GiB or end of file.
This starts reading from cap.ts after seeking 1 GiB, then ::
reads until reaching 3 GiB or end of file.
mpv slice://100m@appending://cap.ts mpv slice://1g-+2g@cap.ts
This starts reading from cap.ts after seeking 100MiB, then This starts reading from cap.ts after seeking 1 GiB, then
reads until end of file. reads until reaching 3 GiB or end of file.
::
mpv slice://100m@appending://cap.ts
This starts reading from cap.ts after seeking 100MiB, then
reads until end of file.
``null://`` ``null://``
@@ -1470,6 +1478,20 @@ PROTOCOLS
Like ``memory://``, but the string is interpreted as hexdump. Like ``memory://``, but the string is interpreted as hexdump.
``archive://[ARCHIVE PATH]|[FILE PATH IN ARCHIVE]``
Open a file at the specified path inside an archive. Requires libarchive
feature enabled. The archive path must have all ``%`` and ``|`` characters
URL escaped. The file path should not be URL escaped.
.. admonition:: Example
::
mpv "archive://file.zip|video.mkv"
This will play ``video.mkv`` in the archive file ``file.zip``.
PSEUDO GUI MODE PSEUDO GUI MODE
=============== ===============
@@ -1498,7 +1520,7 @@ The profile is currently defined as follows:
[builtin-pseudo-gui] [builtin-pseudo-gui]
terminal=no terminal=no
force-window=yes force-window=yes
idle=once idle=yes
screenshot-directory=~~desktop/ screenshot-directory=~~desktop/
The ``pseudo-gui`` profile exists for compatibility. The options in the The ``pseudo-gui`` profile exists for compatibility. The options in the
@@ -1514,10 +1536,15 @@ works like in older mpv releases:
.. warning:: .. warning::
Currently, you can extend the ``pseudo-gui`` profile in the config file the Currently, you can extend the ``pseudo-gui`` profile in the config file the
normal way. This is deprecated. In future mpv releases, the behavior might normal way. This is deprecated and will be removed in future mpv releases.
change, and not apply your additional settings, and/or use a different
profile name.
As an alternative, a conditional autoprofile can be used instead:
::
[gui]
profile-cond=p["player-operation-mode"]=="pseudo-gui"
idle=once
.. include:: options.rst .. include:: options.rst
+328 -145
View File
@@ -55,7 +55,7 @@ Track Selection
behavior tends to change around with each mpv release. behavior tends to change around with each mpv release.
The track selection properties will return the option value outside of The track selection properties will return the option value outside of
playback (as expected), but during playback, the affective track playback (as expected), but during playback, the effective track
selection is returned. For example, with ``--aid=auto``, the ``aid`` selection is returned. For example, with ``--aid=auto``, the ``aid``
property will suddenly return ``2`` after playback initialization property will suddenly return ``2`` after playback initialization
(assuming the file has at least 2 audio tracks, and the second is the (assuming the file has at least 2 audio tracks, and the second is the
@@ -69,8 +69,8 @@ Track Selection
still had the value ``2``, and writing the same value has no effect. still had the value ``2``, and writing the same value has no effect.
With mpv 0.33.0, the behavior was changed. Now track selection options With mpv 0.33.0, the behavior was changed. Now track selection options
are reset to ``auto`` at playback initialization, if the option had are reset to ``auto`` at playback initialization, if the option tried
tries to select a track that does not exist. The same is done if the to select a track that does not exist. The same is done if the
track exists, but fails to initialize. The consequence is that unlike track exists, but fails to initialize. The consequence is that unlike
before mpv 0.33.0, the user's track selection parameters are clobbered before mpv 0.33.0, the user's track selection parameters are clobbered
in certain situations. in certain situations.
@@ -84,10 +84,10 @@ Track Selection
file might reset the track selection to defaults, if the fingerprint file might reset the track selection to defaults, if the fingerprint
of the track list of the new file is different. of the track list of the new file is different.
Be aware of tricky combinations of all of all of the above: for example, Be aware of tricky combinations of all of the above: for example,
``mpv --aid=2 file_with_2_audio_tracks.mkv file_with_1_audio_track.mkv`` ``mpv --aid=2 file_with_2_audio_tracks.mkv file_with_1_audio_track.mkv``
would first play the correct track, and the second file without audio. would first play the correct track, and the second file without audio.
If you then go back the first file, its first audio track will be played, If you then go back to the first file, its first audio track will be played,
and the second file is played with audio. If you do the same thing again and the second file is played with audio. If you do the same thing again
but instead of using ``--aid=2`` you run ``set aid 2`` while the file is but instead of using ``--aid=2`` you run ``set aid 2`` while the file is
playing, then changing to the second file will play its audio track. playing, then changing to the second file will play its audio track.
@@ -120,6 +120,25 @@ Track Selection
to ``auto`` (the default), mpv will choose the first edition declared as a to ``auto`` (the default), mpv will choose the first edition declared as a
default, or if there is no default, the first edition defined. default, or if there is no default, the first edition defined.
``--flatten-editions=<yes|no>``
Some container formats (such as HLS or MPEG-TS with multiple programs)
expose multiple programs or rendition groups. By default, mpv respects the
format and groups tracks into editions, filtering the track list to only
show tracks belonging to the currently selected edition.
Setting this option to ``yes`` ignores the program structure of the file.
No editions are created, and all tracks from all programs are shown as a
flat list. Note that depending on the file, tracks from different programs
may be completely unrelated to each other.
``--show-dependent-tracks=<yes|no>``
Show dependent tracks in the track list (default: no). Dependent tracks
carry coded data that is not independently decodable. For example, the
tile sub-streams that make up a tiled HEIF image, the raw coded layers of
an IAMF audio element, or the enhancement stream in an LCEVC group. They
are hidden by default because exposing them would clutter the track list
with entries that cannot be meaningfully selected on their own.
``--track-auto-selection=<yes|no>`` ``--track-auto-selection=<yes|no>``
Enable the default track auto-selection (default: yes). Enabling this will Enable the default track auto-selection (default: yes). Enabling this will
make the player select streams according to ``--aid``, ``--alang``, and make the player select streams according to ``--aid``, ``--alang``, and
@@ -134,7 +153,7 @@ Track Selection
``--subs-with-matching-audio=<yes|forced|no>`` ``--subs-with-matching-audio=<yes|forced|no>``
When autoselecting a subtitle track, select it even if the selected audio When autoselecting a subtitle track, select it even if the selected audio
stream matches you preferred subtitle language (default: yes). If this stream matches your preferred subtitle language (default: yes). If this
option is set to ``no``, then no subtitle track that matches the audio option is set to ``no``, then no subtitle track that matches the audio
language will ever be autoselected by mpv regardless of ``--slang`` or language will ever be autoselected by mpv regardless of ``--slang`` or
``subs-fallback``. If set to ``forced``, then only forced subtitles ``subs-fallback``. If set to ``forced``, then only forced subtitles
@@ -293,13 +312,11 @@ Playback Control
different demuxers and will not work with this option. They still can be different demuxers and will not work with this option. They still can be
played directly, without using this option. played directly, without using this option.
You can play playlists directly, without this option. Before mpv version By default, mpv doesn't play URLs from playlists which are considered
0.31.0, this option disabled any security mechanisms that might be in unsafe. If you trust the playlist file, you can disable any security checks
place, but since 0.31.0 it uses the same security mechanisms as playing a with ``--load-unsafe-playlists``. Because playlists can load other playlist
playlist file directly. If you trust the playlist file, you can disable entries, consider applying this option only to the playlist itself and not
any security checks with ``--load-unsafe-playlists``. Because playlists its entries, using something along these lines:
can load other playlist entries, consider applying this option only to the
playlist itself and not its entries, using something along these lines:
``mpv --{ --playlist=filename --load-unsafe-playlists --}`` ``mpv --{ --playlist=filename --load-unsafe-playlists --}``
@@ -513,8 +530,8 @@ Playback Control
``--play-direction=<forward|+|backward|->`` ``--play-direction=<forward|+|backward|->``
Control the playback direction (default: forward). Setting ``backward`` Control the playback direction (default: forward). Setting ``backward``
will attempt to play the file in reverse direction, with decreasing will attempt to play the file in reverse direction, with decreasing
playback time. If this is set on playback starts, playback will start from playback time. If this is set on playback start, playback will start from
the end of the file. If this is changed at during playback, a hr-seek will the end of the file. If this is changed during playback, a hr-seek will
be issued to change the direction. be issued to change the direction.
``+`` and ``-`` are aliases for ``forward`` and ``backward``. ``+`` and ``-`` are aliases for ``forward`` and ``backward``.
@@ -656,8 +673,7 @@ Playback Control
- Setting ``--demuxer-cache-wait`` may be useful to cache the entire file - Setting ``--demuxer-cache-wait`` may be useful to cache the entire file
into the demuxer cache. Set ``--demuxer-max-bytes`` to a large size to into the demuxer cache. Set ``--demuxer-max-bytes`` to a large size to
make sure it can read the entire cache; ``--demuxer-max-back-bytes`` make sure it can read the entire cache; ``--demuxer-max-back-bytes``
should also be set to a large size to prevent that tries to trim the should also be set to a large size to prevent it from trimming the cache.
cache.
- If audio artifacts are audible, even though the AO does not underrun, - If audio artifacts are audible, even though the AO does not underrun,
increasing ``--audio-backward-overlap`` might help in some cases. increasing ``--audio-backward-overlap`` might help in some cases.
@@ -798,7 +814,7 @@ Program Behavior
``--dump-stats=<filename>`` ``--dump-stats=<filename>``
Write certain statistics to the given file. The file is truncated on Write certain statistics to the given file. The file is truncated on
opening. The file will contain raw samples, each with a timestamp. To opening. The file will contain raw samples, each with a timestamp. To
make this file into a readable, the script ``TOOLS/stats-conv.py`` can be visualize the statistics, the script ``TOOLS/stats-conv.py`` can be
used (which currently displays it as a graph). used (which currently displays it as a graph).
This option is useful for debugging only. This option is useful for debugging only.
@@ -820,8 +836,9 @@ Program Behavior
(Default: ``yes``) (Default: ``yes``)
``--script=<filename>``, ``--scripts=file1.lua:file2.lua:...`` ``--script=<filename>``, ``--scripts=file1.lua:file2.lua:...``
Load a Lua script. The second option allows you to load multiple scripts by Load a script (Lua or JS) or a C plugin. The second option allows you to
separating them with the path separator (``:`` on Unix, ``;`` on Windows). load multiple scripts by separating them with the path separator (``:`` on
Unix, ``;`` on Windows).
``--scripts`` is a path list option. See `List Options`_ for details. ``--scripts`` is a path list option. See `List Options`_ for details.
@@ -928,7 +945,7 @@ Program Behavior
``all_formats=<yes|no>`` ``all_formats=<yes|no>``
If 'yes' will attempt to add all formats found reported by youtube-dl If 'yes' will attempt to add all formats found reported by youtube-dl
(default: no). Each format is added as a separate track. In addition, (default: yes). Each format is added as a separate track. In addition,
they are delay-loaded, and actually opened only when a track is selected they are delay-loaded, and actually opened only when a track is selected
(this should keep load times as low as without this option). (this should keep load times as low as without this option).
@@ -941,11 +958,6 @@ Program Behavior
default will have the default flag set. This means mpv should generally default will have the default flag set. This means mpv should generally
still select formats chosen with ``--ytdl-format`` by default. still select formats chosen with ``--ytdl-format`` by default.
Although this mechanism makes it possible to switch streams at runtime,
it's not suitable for this purpose for various technical reasons. (It's
slow, which can't be really fixed.) In general, this option is not
useful, and was only added to show that it's possible.
There are two cases that must be considered when doing quality/bandwidth There are two cases that must be considered when doing quality/bandwidth
selection: selection:
@@ -1230,11 +1242,10 @@ Video
This is the recommended mode, and the default. This is the recommended mode, and the default.
<decoder> <decoder>
Old, decoder-based framedrop mode. (This is the same as ``--framedrop=yes`` Old, decoder-based framedrop mode. This tells the decoder to skip frames
in mpv 0.5.x and before.) This tells the decoder to skip frames (unless (unless they are needed to decode future frames). May help with slow
they are needed to decode future frames). May help with slow systems, systems, but can produce unwatchable choppy output, or even freeze the
but can produce unwatchable choppy output, or even freeze the display display completely.
completely.
This uses a heuristic which may not make sense, and in general cannot This uses a heuristic which may not make sense, and in general cannot
achieve good results, because the decoder's frame dropping cannot be achieve good results, because the decoder's frame dropping cannot be
@@ -1337,8 +1348,8 @@ Video
- If you're not sure, but want hardware decoding always enabled by - If you're not sure, but want hardware decoding always enabled by
default, put ``hwdec=yes`` into your ``mpv.conf``, and acknowledge that default, put ``hwdec=yes`` into your ``mpv.conf``, and acknowledge that
this may cause problems. this may cause problems.
- If you want to test available hardware decoding methods, pass - If you want to test all available hardware decoding methods, pass
``--hwdec=auto --hwdec-codecs=all`` and look at the terminal output. ``--hwdec=auto-unsafe --hwdec-codecs=all`` and look at the terminal output.
- If you're a developer, or want to perform elaborate tests, you may - If you're a developer, or want to perform elaborate tests, you may
need any of the other possible option values. need any of the other possible option values.
@@ -1362,9 +1373,9 @@ Video
:d3d11va: requires ``--vo=gpu`` or ``--vo=gpu-next`` with ``--gpu-context=d3d11`` or :d3d11va: requires ``--vo=gpu`` or ``--vo=gpu-next`` with ``--gpu-context=d3d11`` or
``--gpu-context=angle`` (Windows 8+ only) ``--gpu-context=angle`` (Windows 8+ only)
:d3d11va-copy: copies video back to system RAM (Windows 8+ only) :d3d11va-copy: copies video back to system RAM (Windows 8+ only)
:videotoolbox: requires ``--vo=gpu`` or ``--vo=gpu-next`` (macOS 10.8 and up), :videotoolbox: requires ``--vo=gpu`` or ``--vo=gpu-next`` (macOS only),
or ``--vo=libmpv`` (iOS 9.0 and up) or ``--vo=libmpv`` (iOS 9.0 and up)
:videotoolbox-copy: copies video back into system RAM (macOS 10.8 or iOS 9.0 and up) :videotoolbox-copy: copies video back into system RAM (macOS 10.15 or iOS 9.0 and up)
:vaapi: requires ``--vo=gpu``, ``--vo=gpu-next``, ``--vo=vaapi`` or ``--vo=dmabuf-wayland`` (Linux only) :vaapi: requires ``--vo=gpu``, ``--vo=gpu-next``, ``--vo=vaapi`` or ``--vo=dmabuf-wayland`` (Linux only)
:vaapi-copy: copies video back into system RAM (Linux with some GPUs or Windows) :vaapi-copy: copies video back into system RAM (Linux with some GPUs or Windows)
:nvdec: requires ``--vo=gpu`` or ``--vo=gpu-next`` (Any platform CUDA is available) :nvdec: requires ``--vo=gpu`` or ``--vo=gpu-next`` (Any platform CUDA is available)
@@ -1720,7 +1731,7 @@ Video
Whether to behave as if ``--video-align-x`` and ``--video-align-y`` were 0 Whether to behave as if ``--video-align-x`` and ``--video-align-y`` were 0
when the video becomes smaller than the window in the respective direction when the video becomes smaller than the window in the respective direction
After zooming in until the video is bigger the window, panning with After zooming in until the video is bigger than the window, panning with
`--video-align-x` and/or `--video-align-y`, and zooming out until the video `--video-align-x` and/or `--video-align-y`, and zooming out until the video
is smaller than the window, this is useful to recenter the video in the is smaller than the window, this is useful to recenter the video in the
window. window.
@@ -1831,8 +1842,8 @@ Video
You can get the list of allowed codecs with ``mpv --vd=help``. Remove the You can get the list of allowed codecs with ``mpv --vd=help``. Remove the
prefix, e.g. instead of ``lavc:h264`` use ``h264``. prefix, e.g. instead of ``lavc:h264`` use ``h264``.
By default, this is set to ``h264,vc1,hevc,vp8,vp9,av1,prores,prores_raw,ffv1,dpx``. Note that By default, this is set to ``h264,vc1,hevc,vp8,vp9,av1,prores,prores_raw,ffv1,dpx,apv``.
the hardware acceleration special codecs like ``h264_vdpau`` are not Note that the hardware acceleration special codecs like ``h264_vdpau`` are not
relevant anymore, and in fact have been removed from FFmpeg in this form. relevant anymore, and in fact have been removed from FFmpeg in this form.
This is usually only needed with broken GPUs, where a codec is reported This is usually only needed with broken GPUs, where a codec is reported
@@ -2128,8 +2139,7 @@ Audio
amplification. Negative values can be passed for compatibility, but are amplification. Negative values can be passed for compatibility, but are
treated as 0. treated as 0.
Since mpv 0.18.1, this always controls the internal mixer (aka software This always controls the internal mixer (aka software volume).
volume).
``--volume-max=<100.0-1000.0>`` ``--volume-max=<100.0-1000.0>``
Set the maximum amplification level in percent (default: 130). A value of Set the maximum amplification level in percent (default: 130). A value of
@@ -2795,10 +2805,12 @@ Subtitles
canvas size. Can be useful to test broken subtitles, which often happen canvas size. Can be useful to test broken subtitles, which often happen
when the video was transcoded, while attempting to keep the old subtitles. when the video was transcoded, while attempting to keep the old subtitles.
``--image-subs-hdr-peak=<sdr|video|10-10000>`` ``--image-subs-hdr-peak=<sdr|video|video-static|video-dynamic|10-10000>``
Controls the image subtitle diffuse white level in cd/m² (nits) for HDR Controls the image subtitle diffuse white level in cd/m² (nits) for HDR
output (default: sdr). ``sdr`` is 203 cd/m² for standard SDR white, while videos (default: 1000). ``sdr`` is 203 cd/m² for standard SDR white,
``video`` uses video metadata. (``--vo=gpu-next`` only) ``video`` uses all video metadata including peak detection,
``video-dynamic`` uses only per-scene video metadata,
``video-static`` uses only static video metadata, (``--vo=gpu-next`` only)
This also affects image subtitle brightness in HDR tone mapping with This also affects image subtitle brightness in HDR tone mapping with
``--blend-subtitles=<yes|video>``. ``--blend-subtitles=<yes|video>``.
@@ -3015,9 +3027,6 @@ Subtitles
options) are ignored when ASS-subtitles are rendered, unless options) are ignored when ASS-subtitles are rendered, unless
``--sub-ass=no`` is specified. ``--sub-ass=no`` is specified.
This used to support fontconfig patterns. Starting with libass 0.13.0,
this stopped working.
``--sub-font-size=<size>`` ``--sub-font-size=<size>``
Specify the sub font size. The unit is the size in scaled pixels at a Specify the sub font size. The unit is the size in scaled pixels at a
window height of 720. The actual pixel size is scaled with the window window height of 720. The actual pixel size is scaled with the window
@@ -3134,6 +3143,16 @@ Subtitles
Default: 34 Default: 34
``--sub-margin-y-offset=<size>``
Additional vertical offset added to the subtitle margin, in scaled pixels.
This is added on top of ``--sub-margin-y``.
This is intended for dynamic margin adjustments at runtime (e.g. by
scripts like the OSC to avoid subtitle/UI overlap). For persistent
settings, use ``--sub-margin-y`` instead.
Default: 0
``--sub-align-x=<left|center|right>`` ``--sub-align-x=<left|center|right>``
Control to which corner of the screen text subtitles should be Control to which corner of the screen text subtitles should be
aligned to (default: ``center``). aligned to (default: ``center``).
@@ -3149,8 +3168,6 @@ Subtitles
Control how multi line subs are justified irrespective of where they Control how multi line subs are justified irrespective of where they
are aligned (default: ``auto`` which justifies as defined by are aligned (default: ``auto`` which justifies as defined by
``--sub-align-x``). ``--sub-align-x``).
Left justification is recommended to make the subs easier to read
as it is easier for the eyes.
``--sub-ass-justify=<yes|no>`` ``--sub-ass-justify=<yes|no>``
Applies justification as defined by ``--sub-justify`` on ASS subtitles Applies justification as defined by ``--sub-justify`` on ASS subtitles
@@ -3383,12 +3400,11 @@ Window
Also, if errors or unusual circumstances happen, the player can quit Also, if errors or unusual circumstances happen, the player can quit
anyway. anyway.
Since mpv 0.6.0, this doesn't pause if there is a next file in the playlist, ``yes`` doesn't pause if there is a next file in the playlist, or the
or the playlist is looped. Approximately, this will pause when the player playlist is looped. Approximately, this will pause when the player would
would normally exit, but in practice there are corner cases in which this normally exit, but in practice there are corner cases in which this is not
is not the case (e.g. ``mpv --keep-open file.mkv /dev/null`` will play the case (e.g. ``mpv --keep-open file.mkv /dev/null`` will play file.mkv
file.mkv normally, then fail to open ``/dev/null``, then exit). (In normally, then fail to open ``/dev/null``, then exit).
mpv 0.8.0, ``always`` was introduced, which restores the old behavior.)
``--keep-open-pause=<yes|no>`` ``--keep-open-pause=<yes|no>``
If set to ``no``, instead of pausing when ``--keep-open`` is active, just If set to ``no``, instead of pausing when ``--keep-open`` is active, just
@@ -3409,6 +3425,9 @@ Window
example if ``--length`` is used to reduce the length to 1 frame, or if example if ``--length`` is used to reduce the length to 1 frame, or if
you seek to the last frame. you seek to the last frame.
The effective duration is now `--speed` aware, which was not the case in
older mpv versions before v0.41.0.
This option does not affect the framerate used for ``mf://`` or This option does not affect the framerate used for ``mf://`` or
``--merge-files``. For that, use ``--mf-fps`` instead. ``--merge-files``. For that, use ``--mf-fps`` instead.
@@ -3445,13 +3464,12 @@ Window
(Windows only) Snap the player window to screen edges. (Windows only) Snap the player window to screen edges.
``--drag-and-drop=<no|auto|replace|append|insert-next>`` ``--drag-and-drop=<no|auto|replace|append|insert-next>``
Controls the default behavior of drag and drop on platforms that support Controls the default built-in drag-and-drop behavior
this. ``auto`` will obey what the underlying os/platform gives mpv. (``--input-builtin-drag-and-drop``).
Typically, holding shift during the drag and drop will append the item to ``auto`` will obey the ``action`` value in ``dropped-files`` property.
the playlist. Otherwise, it will completely replace it. ``replace``, ``replace``, ``append``, and ``insert-next`` always force replacing,
``append``, and ``insert-next`` always force replacing, appending to, and appending to, and inserting next into the playlist respectively.
inserting next into the playlist respectively. ``no`` disables all drag and ``no`` disables all drag and drop behavior.
drop behavior.
``--ontop`` ``--ontop``
Makes the player window stay on top of other windows. Makes the player window stay on top of other windows.
@@ -3470,7 +3488,7 @@ Window
:level: A level as integer. :level: A level as integer.
``--focus-on=<never|open|all>``, ``--focus-on=<never|open|all>``,
(macOS only) (X11 and macOS only)
Focus the video window and make it the front most window on specific events (default: open). Focus the video window and make it the front most window on specific events (default: open).
:never: Never focus the window on open or new file load events. :never: Never focus the window on open or new file load events.
@@ -3519,6 +3537,15 @@ Window
The coordinates are relative to the screen given with ``--screen`` for the The coordinates are relative to the screen given with ``--screen`` for the
video output drivers that fully support ``--screen``. video output drivers that fully support ``--screen``.
.. note::
The geometry size and position are applied during window initialization.
Subsequent automatic resizes (via ``--auto-window-resize``) reapply the
size from ``--geometry`` but not the position, unless
``--force-window-position`` is enabled. Updating ``--geometry`` during
playback always applies the position, regardless of the
``--force-window-position`` setting.
.. note:: .. note::
Generally only supported by GUI VOs. Ignored for encoding. Generally only supported by GUI VOs. Ignored for encoding.
@@ -3673,10 +3700,14 @@ Window
only ones that have this optimization (i.e. everything else always renders only ones that have this optimization (i.e. everything else always renders
regardless of visibility). regardless of visibility).
``--force-window-position`` ``--force-window-position=<yes|no>``
Forcefully move mpv's video output window to default location whenever Controls whether the window is moved back to its initial position after an
there is a change in video parameters, video stream or file. This used to automatic resize due to video stream size changes (see
be the default behavior. Currently only affects X11, macvk and SDL VOs. ``--auto-window-resize``). When disabled, the window preserves its current
position and only resizes to match the new video size. When enabled, the
window is repositioned to the initial location set by ``--geometry``, or
the center of the screen if no geometry is specified. Currently only
affects Windows, X11, macvk and SDL VOs. (default: no)
``--auto-window-resize=<yes|no>`` ``--auto-window-resize=<yes|no>``
By default, mpv will automatically resize itself if the video's size changes By default, mpv will automatically resize itself if the video's size changes
@@ -3736,10 +3767,9 @@ Window
possible if a video output is available (i.e. there is an open mpv window). possible if a video output is available (i.e. there is an open mpv window).
This is not supported on all video outputs, platforms, or desktop environments. This is not supported on all video outputs, platforms, or desktop environments.
Before mpv 0.33.0, the X11 backend ran ``xdg-screensaver reset`` in 10 second On Wayland, this depends on the compositor supporting the idle inhibit
intervals when not paused in order to support screensaver inhibition in some protocol. On compositors without support, you can periodically call
environments. This functionality was removed in 0.33.0, but it is possible to ``xdg-screensaver reset`` from a user script to inhibit the screensaver.
call the ``xdg-screensaver`` command line program from a user script instead.
``--wid=<ID|-1>`` ``--wid=<ID|-1>``
This tells mpv to attach to an existing window. If a VO is selected that This tells mpv to attach to an existing window. If a VO is selected that
@@ -4304,6 +4334,19 @@ Demuxer
The default value is 0 seconds, which disables the caching hysteresis. A The default value is 0 seconds, which disables the caching hysteresis. A
value of 10 seconds probably works well for most usecases. value of 10 seconds probably works well for most usecases.
``--demuxer-hysteresis-bytes=<bytesize>``
Same as ``--demuxer-hysteresis-secs``, but specifies the hysteresis in
bytes of forward buffered data instead of seconds. Once the demuxer limit
is reached, the demuxer will not buffer ahead again until the amount of
forward buffered data drops to this value.
This option is useful for streams with variable or unknown bitrate, where
a byte-based threshold is more meaningful than a time-based one. It can
also be combined with ``--demuxer-hysteresis-secs``. In that case buffering
can resume when either threshold is reached.
The default value is 0, which disables the byte-based caching hysteresis.
``--prefetch-playlist=<yes|no>`` ``--prefetch-playlist=<yes|no>``
Prefetch next playlist entry while playback of the current entry is ending Prefetch next playlist entry while playback of the current entry is ending
(default: no). This merely opens the URL of the next playlist entry as soon (default: no). This merely opens the URL of the next playlist entry as soon
@@ -4353,15 +4396,16 @@ Demuxer
``--shuffle``, and like ``lazy`` otherwise. ``--shuffle``, and like ``lazy`` otherwise.
``--directory-filter-types=<video,audio,image,archive,playlist>`` ``--directory-filter-types=<video,audio,image,archive,playlist>``
Media file types to filter when opening directory. If the list is empty, Media file types to filter when opening directories and archives. To have
all files are added to the playlist. (Default: all files added to the playlist, clear the list using
``--directory-filter-types-clr``. (Default:
``video,audio,image,archive,playlist``) ``video,audio,image,archive,playlist``)
This is a string list option. See `List Options`_ for details. This is a string list option. See `List Options`_ for details.
``--autocreate-playlist=<no|filter|same>`` ``--autocreate-playlist=<no|filter|same>``
When opening a local file, act as if the parent directory is opened and When opening a local regular file, act as if the parent directory is opened
create a playlist automatically. and create a playlist automatically.
:no: Load a single file (default). :no: Load a single file (default).
:filter: Create a playlist from the parent directory with files matching :filter: Create a playlist from the parent directory with files matching
@@ -4421,6 +4465,10 @@ Input
option, this option only affects VOs which support the ``begin-vo-dragging`` option, this option only affects VOs which support the ``begin-vo-dragging``
command, and does not disable window dragging initialized with the command. command, and does not disable window dragging initialized with the command.
``--input-builtin-drag-and-drop=<yes|no>``
Enable the built-in drag-and-drop behavior (default: yes). Setting it to no
disables the built-in drag-and-drop handling.
``--input-cmdlist`` ``--input-cmdlist``
Prints all commands that can be bound to keys. Prints all commands that can be bound to keys.
@@ -4472,8 +4520,11 @@ Input
``--input-ipc-server=<filename>`` ``--input-ipc-server=<filename>``
Enable the IPC support and create the listening socket at the given path. Enable the IPC support and create the listening socket at the given path.
On Linux and Unix, the given path is a regular filesystem path. On Windows, On Linux and Unix, if the first character of the path is ``@``, then it
named pipes are used, so the path refers to the pipe namespace is internally replaced with a null character, which represents an abstract
socket address on Linux, but can have unspecified behavior on other UNIX
platforms. Otherwise, the given path is a regular filesystem path.
On Windows, named pipes are used, so the path refers to the pipe namespace
(``\\.\pipe\<name>``). If the ``\\.\pipe\`` prefix is missing, mpv will add (``\\.\pipe\<name>``). If the ``\\.\pipe\`` prefix is missing, mpv will add
it automatically before creating the pipe, so it automatically before creating the pipe, so
``--input-ipc-server=/tmp/mpv-socket`` and ``--input-ipc-server=/tmp/mpv-socket`` and
@@ -4815,6 +4866,16 @@ OSD
Default: 16 Default: 16
``--osd-margin-y-offset=<size>``
Additional vertical offset added to the OSD margin, in scaled pixels.
This is added on top of ``--osd-margin-y``.
This is intended for dynamic margin adjustments at runtime (e.g. by
scripts like the OSC to avoid OSD/UI overlap). For persistent settings,
use ``--osd-margin-y`` instead.
Default: 0
``--osd-align-x=<left|center|right>`` ``--osd-align-x=<left|center|right>``
Control to which corner of the screen OSD should be Control to which corner of the screen OSD should be
aligned to (default: ``left``). aligned to (default: ``left``).
@@ -4997,6 +5058,12 @@ Screenshot
the result of passing "%X" to ``strftime``. For example, ``%tm`` will the result of passing "%X" to ``strftime``. For example, ``%tm`` will
insert the number of the current month as number. You have to use insert the number of the current month as number. You have to use
multiple ``%tX`` specifiers to build a full date/time string. multiple ``%tX`` specifiers to build a full date/time string.
.. note::
Since mpv 0.42.0, this only supports the ``strftime`` format
specifiers specified in C11 standard, or the ``%s`` extension for
UNIX timestamp. Other format specifiers are unsupported.
``%{prop[:fallback text]}`` ``%{prop[:fallback text]}``
Insert the value of the input property 'prop'. E.g. ``%{filename}`` is Insert the value of the input property 'prop'. E.g. ``%{filename}`` is
the same as ``%f``. If the property does not exist or is not available, the same as ``%f``. If the property does not exist or is not available,
@@ -5185,7 +5252,7 @@ Software Scaler
a and b are the bicubic b and c parameters. a and b are the bicubic b and c parameters.
``--zimg-scaler-chroma=...`` ``--zimg-scaler-chroma=...``
Same as ``--zimg-scaler``, for for chroma interpolation (default: bilinear). Same as ``--zimg-scaler``, for chroma interpolation (default: bilinear).
``--zimg-scaler-chroma-param-a``, ``--zimg-scaler-chroma-param-b`` ``--zimg-scaler-chroma-param-a``, ``--zimg-scaler-chroma-param-b``
Same as ``--zimg-scaler-param-a`` / ``--zimg-scaler-param-b``, for chroma. Same as ``--zimg-scaler-param-a`` / ``--zimg-scaler-param-b``, for chroma.
@@ -5241,7 +5308,7 @@ libavfilter, within the system audio API resampler, or any other places).
``--audio-resample-max-output-size=<length>`` ``--audio-resample-max-output-size=<length>``
Limit maximum size of audio frames filtered at once, in ms (default: 40). Limit maximum size of audio frames filtered at once, in ms (default: 40).
The output size size is limited in order to make resample speed changes The output size is limited in order to make resample speed changes
react faster. This is necessary especially if decoders or filters output react faster. This is necessary especially if decoders or filters output
very large frame sizes (like some lossless codecs or some DRC filters). very large frame sizes (like some lossless codecs or some DRC filters).
This option does not affect the resampling algorithm in any way. This option does not affect the resampling algorithm in any way.
@@ -5359,11 +5426,7 @@ Terminal
line. Expands properties. See `Property Expansion`_. line. Expands properties. See `Property Expansion`_.
``--term-title=<string>`` ``--term-title=<string>``
Set the terminal title. Currently, this simply concatenates the escape Set the terminal title.
sequence setting the window title with the provided (property expanded)
string. This will mess up if the expanded string contain bytes that end the
escape sequence, or if the terminal does not understand the sequence. The
latter probably includes the regrettable win32.
Expands properties. See `Property Expansion`_. Expands properties. See `Property Expansion`_.
@@ -5390,9 +5453,7 @@ Cache
to involve network accesses or other slow media (this is an imperfect to involve network accesses or other slow media (this is an imperfect
heuristic). heuristic).
Before mpv 0.30.0, this used to accept a number, which specified the size Use ``--demuxer-max-bytes`` to specify the size of the cache.
of the cache in kilobytes. Use e.g. ``--cache --demuxer-max-bytes=123k``
instead.
``--cache-secs=<seconds>`` ``--cache-secs=<seconds>``
How many seconds of audio/video to prefetch if the cache is active. This How many seconds of audio/video to prefetch if the cache is active. This
@@ -5602,9 +5663,16 @@ Network
Certificate authority database file for use with TLS. (Silently fails with Certificate authority database file for use with TLS. (Silently fails with
older FFmpeg versions.) older FFmpeg versions.)
``--tls-verify`` ``--tls-verify=<yes|no>``
Verify peer certificates when using TLS (e.g. with ``https://...``). Verify peer certificates when using TLS (e.g. with ``https://...``)
(Silently fails with older FFmpeg versions.) (default: yes*). Disabling this option allows man-in-the-middle attacks
to silently substitute the content of an HTTPS stream and is only
recommended as a per-stream override when verification fails for a
known-good reason (e.g. an outdated CA bundle, a corporate proxy, a
development server with a self-signed certificate).
This is disabled by default, if mpv is built without libcurl and
libavformat is older than 63.0.100.
``--tls-cert-file`` ``--tls-cert-file``
A file containing a certificate to use in the handshake with the A file containing a certificate to use in the handshake with the
@@ -5654,6 +5722,75 @@ Network
The bitrate as used is sent by the server, and there's no guarantee it's The bitrate as used is sent by the server, and there's no guarantee it's
actually meaningful. actually meaningful.
Network backend (libcurl)
-------------------------
When mpv is built with libcurl support, ``http://``, ``https://``, ``ftp://``
and ``ftps://`` URLs are served by an internal libcurl-based stream backend
instead of FFmpeg. The backend fully supports all features of libcurl, making it
more robust and compatible with a wide range of servers and CDNs, and faster too.
For HTTP transfers, the backend transparently negotiates HTTP/1.1, HTTP/2
multiplexing or HTTP/3 (QUIC) when the server offers them, with HSTS enabled
and TCP keep-alive turned on. Content compression (gzip, deflate, zstd,
brotli) is always advertised in the request. If the server applies it, the
transfer is treated as non-seekable. Servers normally do not compress
already-compressed media payloads. Otherwise, it's great improvement for text
playlist data transfers.
The backend honors the network options listed above (``--user-agent``,
``--http-proxy``, ``--http-header-fields``, ``--referrer``, ``--cookies*``,
``--tls-*``).
If libcurl is not available at build time, mpv uses FFmpeg's networking
implementation instead.
To inspect libcurl's debug output (requests, response headers,
TLS/connection diagnostics), set ``--msg-level=curl=trace``.
``--curl-enabled=<yes|no>``
Enable the libcurl-based network backend (default: ``yes``).
Defaults to ``no`` with libavformat < 62.15.101, which has a nested IO
cleanup bug that can cause crashes or memory leaks. The issue happens only
on transfer failures or aborts, can be enabled if you don't mind possible
stability issues.
``--curl-http-version=<auto|1.0|1.1|2|2tls|2-prior-knowledge|3|3only>``
Select the maximum HTTP protocol version libcurl is allowed to negotiate.
If libcurl was built without HTTP/3 support, it will fallback to ``auto``.
(default: ``auto``, i.e. let libcurl pick)
``--curl-max-redirects=<0-100>``
Maximum number of HTTP redirects to follow before reporting an error
(default: 16).
``--curl-max-retries=<0-100>``
Number of times a single seekable transfer may be transparently
re-attempted after a recoverable error (timeout, connection drop,
HTTP/2 stream reset, ...) before the stream gives up (default: 5).
Non-seekable transfers cannot be retried and ignore this option.
``--curl-connect-timeout=<seconds>``
TCP/TLS connect timeout in seconds (default: 30, range 0-600). 0 lets
libcurl use its built-in default. The overall transfer timeout is
controlled by ``--network-timeout``.
``--curl-buffer-size=<bytes>``
Size of the per-stream producer-side ring buffer that decouples the
network thread from the consumer (default: 4 MiB, minimum: 32 KiB).
Lower values may reduce in-flight data and reduce latency.
``--curl-max-request-size=<bytes>``
For seekable streams, split the transfer into Range requests of at most
this size (default: 0, i.e. one open-ended request for the whole stream).
A non-zero value can help with very long-running connections that some
CDNs or proxies recycle aggressively, and is also a common workaround for
per-connection bandwidth throttling employed by some CDNs (notably some
video hosting services), where each individual Range request is served at
full speed but a single long-lived connection is rate-limited. Ignored for
non-seekable streams.
DVB DVB
--- ---
@@ -5867,12 +6004,15 @@ them.
being increased a bit). being increased a bit).
``--scale-antiring=<value>``, ``--cscale-antiring=<value>``, ``--dscale-antiring=<value>``, ``--tscale-antiring=<value>`` ``--scale-antiring=<value>``, ``--cscale-antiring=<value>``, ``--dscale-antiring=<value>``, ``--tscale-antiring=<value>``
Set the antiringing strength. This tries to eliminate ringing, but can Set the antiringing strength. This option tries to eliminate ringing, but can
introduce other artifacts in the process. Must be a float number between introduce other artifacts in the process. The value must be a floating-point
0.0 and 1.0. The default value of 0.0 disables antiringing entirely. number between 0.0 and 1.0.
The default is 0.0. The ``high-quality`` profile sets this to 0.6, which is
a fairly conservative value and should subtly enhance image quality.
Note that this doesn't affect the special filters ``bilinear`` and Note that this doesn't affect the special filters ``bilinear`` and
``bicubic_fast``, nor does it affect any polar (EWA) scalers. ``bicubic_fast``, nor does it affect any polar (EWA) scalers with vo_gpu.
On ``--vo=gpu-next``, this also affects polar (EWA) scalers. Certain On ``--vo=gpu-next``, this also affects polar (EWA) scalers. Certain
filter aliases may also implicitly enable antiringing, regardless of this filter aliases may also implicitly enable antiringing, regardless of this
@@ -5957,7 +6097,6 @@ them.
.. warning:: This requires setting the ``--video-sync`` option to one .. warning:: This requires setting the ``--video-sync`` option to one
of the ``display-`` modes, or it will be silently disabled. of the ``display-`` modes, or it will be silently disabled.
This was not required before mpv 0.14.0.
This essentially attempts to interpolate the missing frames by convoluting This essentially attempts to interpolate the missing frames by convoluting
the video along the temporal axis. The filter used can be controlled using the video along the temporal axis. The filter used can be controlled using
@@ -6013,7 +6152,7 @@ them.
auto auto
Automatic selection. Automatic selection.
On ``--vo=gpu``: detected depth or 8 bpc otherwise On ``--vo=gpu``: detected depth or 8 bpc otherwise
On ``--vo=gpu-next``: detected depth or 8 bpc (for SDR target) On ``--vo=gpu-next``: detected depth
8 8
Dither to 8 bit output. Dither to 8 bit output.
@@ -6114,10 +6253,6 @@ them.
according to the bit depth of your display. according to the bit depth of your display.
This option also affects the auto-detection of ``--dither-depth``. This option also affects the auto-detection of ``--dither-depth``.
.. note::
Unlike ``--d3d11-output-format``, this option also takes effect with ``--vo=gpu-next``.
``--vulkan-device=<device name|UUID>`` ``--vulkan-device=<device name|UUID>``
The name or UUID of the Vulkan device to use for rendering and presentation. Use The name or UUID of the Vulkan device to use for rendering and presentation. Use
``--vulkan-device=help`` to see the list of available devices and their ``--vulkan-device=help`` to see the list of available devices and their
@@ -6253,6 +6388,11 @@ them.
For ``--vo=gpu-next``, this is used as a best-effort hint and For ``--vo=gpu-next``, this is used as a best-effort hint and
libplacebo has the last say on which format is utilized. libplacebo has the last say on which format is utilized.
.. note::
For ``--vo=gpu-next``, ``rgba16f`` enables scRGB output. Alternatively,
``--target-trc=scrgb`` can be used to request scRGB output.
``--d3d11-output-csp=<auto|srgb|linear|pq|bt.2020>`` ``--d3d11-output-csp=<auto|srgb|linear|pq|bt.2020>``
Select a specific D3D11 output color space to utilize for D3D11 rendering. Select a specific D3D11 output color space to utilize for D3D11 rendering.
"auto" is the default, which will select the color space of the desktop "auto" is the default, which will select the color space of the desktop
@@ -6297,12 +6437,13 @@ them.
``--wayland-edge-pixels-pointer=<value>`` ``--wayland-edge-pixels-pointer=<value>``
Defines the size of an edge border (default: 16) to initiate client side Defines the size of an edge border (default: 16) to initiate client side
resize events in the wayland contexts with the mouse. This is only active if resize events in the wayland contexts with the mouse or tablet. This is only
there are no server side decorations from the compositor. active if there are no server side decorations from the compositor.
``--wayland-edge-pixels-touch=<value>`` ``--wayland-edge-pixels-touch=<value>``
Defines the size of an edge border (default: 32) to initiate client side Defines the size of an edge border (default: 32) to initiate client side
resizes events in the wayland contexts with touch events. resizes events in the wayland contexts with touch events. This is only
active if there are no server side decorations from the compositor.
``--wayland-internal-vsync=<no|auto|yes>`` ``--wayland-internal-vsync=<no|auto|yes>``
Controls whether to use mpv's internal vsync for Wayland-base video outputs Controls whether to use mpv's internal vsync for Wayland-base video outputs
@@ -6318,6 +6459,11 @@ them.
frame presentation if it is supported by the compositor (default: ``yes``). frame presentation if it is supported by the compositor (default: ``yes``).
This only has an effect if ``--video-sync=display-...`` is being used. This only has an effect if ``--video-sync=display-...`` is being used.
``--wayland-session=<string>``
Set the wayland session name for window restoration (default: unset).
Not setting this or setting it to the empty string disables session
management.
``--spirv-compiler=<compiler>`` ``--spirv-compiler=<compiler>``
Controls which compiler is used to translate GLSL to SPIR-V. This is Controls which compiler is used to translate GLSL to SPIR-V. This is
only relevant for ``--gpu-api=d3d11`` with ``--vo=gpu``. only relevant for ``--gpu-api=d3d11`` with ``--vo=gpu``.
@@ -6364,8 +6510,8 @@ them.
... ...
Each section of metadata, along with the non-metadata lines after it, Each section of metadata, along with the non-metadata lines after it,
defines a single block. There are currently two types of blocks, HOOKs and defines a single block. There are currently three types of blocks, HOOKs,
TEXTUREs. TEXTUREs, and PARAMs.
A ``TEXTURE`` block can set the following options: A ``TEXTURE`` block can set the following options:
@@ -6400,6 +6546,45 @@ them.
define the raw texture data, corresponding to the format specified by define the raw texture data, corresponding to the format specified by
`FORMAT`, on a single line with no extra whitespace. `FORMAT`, on a single line with no extra whitespace.
A ``PARAM`` block can set the following options:
PARAM <name> (required)
Starts a parameter block that defines a tunable shader parameter.
Parameters are global across the entire shader file, all hooks in the
file can reference them, regardless of declaration order.
TYPE [ENUM] <DEFINE | <type>> (required)
The parameter type. Supported types are ``float`` and ``int``.
The special type ``DEFINE`` emits a preprocessor define which can be
used inside ``#if`` directives.
If the ``ENUM`` qualifier is used then the type must be either
``DEFINE`` or ``int``. Instead of accepting a default value, ``ENUM``
qualified parameter body lists all the possible enumeration values
separated by newlines. These values are assigned integer values starting
from 0 incremented by 1. Each enumeration will also be emitted as a
preprocessor define and will be accessible within RPN expressions.
``MINIMUM`` and ``MAXIMUM`` are ignored.
MINIMUM <value>
Minimum allowed value for this parameter.
MAXIMUM <value>
Maximum allowed value for this parameter.
DESC <text>
Human-readable description of the parameter.
The initial/default value of the parameter is the first non-metadata line
after the parameter headers.
.. note::
``vo=gpu`` supports only a subset of the parameter features available in
``vo=gpu-next``. See libplacebo documentation for more detailed
information about PARAM features supported in ``vo=gpu-next``. Notably
``uint``, ``DYNAMIC``, and ``CONSTANT`` types are not available.
A ``HOOK`` block can set the following options: A ``HOOK`` block can set the following options:
HOOK <name> (required) HOOK <name> (required)
@@ -6427,11 +6612,11 @@ them.
WIDTH <szexpr>, HEIGHT <szexpr> WIDTH <szexpr>, HEIGHT <szexpr>
Specifies the size of the resulting texture for this pass. ``szexpr`` Specifies the size of the resulting texture for this pass. ``szexpr``
refers to an expression in RPN (reverse polish notation), using the refers to an expression in RPN (reverse polish notation), using the
operators + - * / > < !, floating point literals, and references to operators + - * / > < ! = %, floating point literals, and references to
sizes of existing texture (such as MAIN.width or CHROMA.height), sizes of existing texture (such as MAIN.width or CHROMA.height),
OUTPUT, or NATIVE_CROPPED (size of an input texture cropped after OUTPUT, tunable parameters, or NATIVE_CROPPED (size of an input texture
pan-and-scan, video-align-x/y, video-pan-x/y, etc. and possibly cropped after pan-and-scan, video-align-x/y, video-pan-x/y, etc. and
prescaled). By default, these are set to HOOKED.w and HOOKED.h, possibly prescaled). By default, these are set to HOOKED.w and HOOKED.h,
espectively. espectively.
WHEN <szexpr> WHEN <szexpr>
@@ -6593,7 +6778,7 @@ them.
specific named shaders by prefixing the shader name with a ``/``, e.g. specific named shaders by prefixing the shader name with a ``/``, e.g.
``shader/param=value``. Without a prefix, parameters affect all shaders. ``shader/param=value``. Without a prefix, parameters affect all shaders.
The shader name is the base part of the shader filename, without the The shader name is the base part of the shader filename, without the
extension. (``--vo=gpu-next`` only) extension.
Some parameters are filled automatically if the shader requests them. Some parameters are filled automatically if the shader requests them.
Currently following parameters are available: Currently following parameters are available:
@@ -6825,18 +7010,15 @@ them.
``<appearance>`` can be one of the following: ``<appearance>`` can be one of the following:
:auto: Detects the system settings and sets the title :auto: Detects the system settings and sets the title
bar appearance appropriately. On macOS 10.14 it bar appearance appropriately.
also detects run time changes.
:aqua: The standard macOS Light appearance. :aqua: The standard macOS Light appearance.
:darkAqua: The standard macOS Dark appearance. (macOS 10.14+) :darkAqua: The standard macOS Dark appearance.
:vibrantLight: Light vibrancy appearance with. :vibrantLight: Light vibrancy appearance.
:vibrantDark: Dark vibrancy appearance with. :vibrantDark: Dark vibrancy appearance.
:aquaHighContrast: Light Accessibility appearance. (macOS 10.14+) :aquaHighContrast: Light Accessibility appearance.
:darkAquaHighContrast: Dark Accessibility appearance. (macOS 10.14+) :darkAquaHighContrast: Dark Accessibility appearance.
:vibrantLightHighContrast: Light vibrancy Accessibility appearance. :vibrantLightHighContrast: Light vibrancy Accessibility appearance.
(macOS 10.14+)
:vibrantDarkHighContrast: Dark vibrancy Accessibility appearance. :vibrantDarkHighContrast: Dark vibrancy Accessibility appearance.
(macOS 10.14+)
``--macos-title-bar-material=<material>`` ``--macos-title-bar-material=<material>``
Sets the material of the title bar (default: titlebar). All deprecated Sets the material of the title bar (default: titlebar). All deprecated
@@ -6851,32 +7033,26 @@ them.
:titlebar: The standard macOS title bar material. :titlebar: The standard macOS title bar material.
:selection: The standard macOS selection material. :selection: The standard macOS selection material.
:menu: The standard macOS menu material. (macOS 10.11+) :menu: The standard macOS menu material.
:popover: The standard macOS popover material. (macOS 10.11+) :popover: The standard macOS popover material.
:sidebar: The standard macOS sidebar material. (macOS 10.11+) :sidebar: The standard macOS sidebar material.
:headerView: The standard macOS header view material. :headerView: The standard macOS header view material.
(macOS 10.14+) :sheet: The standard macOS sheet material.
:sheet: The standard macOS sheet material. (macOS 10.14+)
:windowBackground: The standard macOS window background material. :windowBackground: The standard macOS window background material.
(macOS 10.14+) :hudWindow: The standard macOS hudWindow material.
:hudWindow: The standard macOS hudWindow material. (macOS 10.14+)
:fullScreen: The standard macOS full screen material. :fullScreen: The standard macOS full screen material.
(macOS 10.14+) :toolTip: The standard macOS tool tip material.
:toolTip: The standard macOS tool tip material. (macOS 10.14+)
:contentBackground: The standard macOS content background material. :contentBackground: The standard macOS content background material.
(macOS 10.14+)
:underWindowBackground: The standard macOS under window background material. :underWindowBackground: The standard macOS under window background material.
(macOS 10.14+)
:underPageBackground: The standard macOS under page background material. :underPageBackground: The standard macOS under page background material.
(deprecated in macOS 10.14+) (deprecated in macOS 10.14+)
:dark: The standard macOS dark material. :dark: The standard macOS dark material.
(deprecated in macOS 10.14+) (deprecated in macOS 10.14+)
:light: The standard macOS light material. :light: The standard macOS light material.
(macOS 10.14+)
:mediumLight: The standard macOS mediumLight material. :mediumLight: The standard macOS mediumLight material.
(macOS 10.11+, deprecated in macOS 10.14+) (deprecated in macOS 10.14+)
:ultraDark: The standard macOS ultraDark material. :ultraDark: The standard macOS ultraDark material.
(macOS 10.11+ deprecated in macOS 10.14+) (deprecated in macOS 10.14+)
``--macos-title-bar-color=<color>`` ``--macos-title-bar-color=<color>``
Sets the color of the title bar (default: completely transparent). Is Sets the color of the title bar (default: completely transparent). Is
@@ -6905,7 +7081,7 @@ them.
``--macos-geometry-calculation=<visible|whole>`` ``--macos-geometry-calculation=<visible|whole>``
This changes the rectangle which is used to calculate the screen position This changes the rectangle which is used to calculate the screen position
and size of the window (default: visible). ``visible`` takes the the menu and size of the window (default: visible). ``visible`` takes the menu
bar and Dock into account and the window is only positioned/sized within the bar and Dock into account and the window is only positioned/sized within the
visible screen frame rectangle, ``whole`` takes the whole screen frame visible screen frame rectangle, ``whole`` takes the whole screen frame
rectangle and ignores the menu bar and Dock. Other previous restrictions rectangle and ignores the menu bar and Dock. Other previous restrictions
@@ -7274,6 +7450,12 @@ them.
Sony S-Log1 curve Sony S-Log1 curve
s-log2 s-log2
Sony S-Log2 curve Sony S-Log2 curve
scrgb
scRGB, extended linear light transfer. Supports both HDR
and wide color gamut content. The output gamut defaults to BT.709
unless display primaries are reported by the system. You can also use
``--target-gamut`` to manually specify a wider gamut.
(``--vo=gpu-next`` only)
.. note:: .. note::
@@ -7331,8 +7513,13 @@ them.
Constrains the gamut of the display. You can use this option to output e.g. Constrains the gamut of the display. You can use this option to output e.g.
DCIP3-in-BT.2020. Set ``--target-prim`` to the primaries of the containing DCIP3-in-BT.2020. Set ``--target-prim`` to the primaries of the containing
colorspace (into which values will be encoded), and ``--target-gamut`` to colorspace (into which values will be encoded), and ``--target-gamut`` to
the gamut you want to limit colors to. Takes the same values as the gamut you want to limit colors to.
``--target-prim``. (Only for ``--vo=gpu-next``)
Accepts either a named primary set (same values as ``--target-prim``) or
8 comma-separated CIE xy chromaticity values specifying custom primaries
in the format ``Rx,Ry,Gx,Gy,Bx,By,Wx,Wy`` (red, green, blue, white point).
All values must be in the range 0.0-1.0. Use ``--target-gamut=help`` to
list all named primaries. (Only for ``--vo=gpu-next``)
.. note:: .. note::
@@ -7913,11 +8100,6 @@ Video Sync
mode will display them after the renderer has resumed (typically resulting mode will display them after the renderer has resumed (typically resulting
in a short A/V desync and the video "catching up"). in a short A/V desync and the video "catching up").
Before mpv 0.30.0, there was a fallback to ``audio`` mode on severe A/V
desync. This was changed for the sake of not sporadically stopping. Now,
``display-desync`` does what it promises and may desync with audio by an
arbitrary amount, until it is manually fixed with a seek.
These modes also require a vsync blocked presentation mode. For OpenGL, this These modes also require a vsync blocked presentation mode. For OpenGL, this
translates to ``--opengl-swapinterval=1``. For Vulkan, it translates to translates to ``--opengl-swapinterval=1``. For Vulkan, it translates to
``--vulkan-swap-mode=fifo`` (or ``fifo-relaxed``). ``--vulkan-swap-mode=fifo`` (or ``fifo-relaxed``).
@@ -7954,9 +8136,11 @@ Video Sync
:display-adrop: Drop or repeat audio data to compensate desyncing :display-adrop: Drop or repeat audio data to compensate desyncing
video. This mode will cause severe audio artifacts if video. This mode will cause severe audio artifacts if
the real monitor refresh rate is too different from the real monitor refresh rate is too different from
the reported or forced rate. Since mpv 0.33.0, this the reported or forced rate. This acts on entire audio
acts on entire audio frames, instead of single samples. frames, instead of single samples.
:display-desync: Sync video to display, and let audio play on its own. :display-desync: Sync video to display, and let audio play on its own.
May desync with audio by an arbitrary amount, until it
is manually fixed with a seek.
:desync: Sync video according to system clock, and let audio play :desync: Sync video according to system clock, and let audio play
on its own. on its own.
@@ -7974,7 +8158,7 @@ Video Sync
``--video-sync-max-video-change=<value>`` ``--video-sync-max-video-change=<value>``
Maximum speed difference in percent that is applied to video with Maximum speed difference in percent that is applied to video with
``--video-sync=display-...`` (default: 1). Display sync mode will be ``--video-sync=display-...`` (default: 1). Display sync mode will be
disabled if the monitor and video refresh way do not match within the disabled if the monitor and video refresh rate do not match within the
given range. It tries multiples as well: playing 30 fps video on a 60 Hz given range. It tries multiples as well: playing 30 fps video on a 60 Hz
screen will duplicate every second frame. Playing 24 fps video on a 60 Hz screen will duplicate every second frame. Playing 24 fps video on a 60 Hz
screen will play video in a 2-3-2-3-... pattern. screen will play video in a 2-3-2-3-... pattern.
@@ -8092,8 +8276,7 @@ Miscellaneous
Unlike ``--sub-files`` and ``--audio-files``, this includes all tracks, and Unlike ``--sub-files`` and ``--audio-files``, this includes all tracks, and
does not cause default stream selection over the "proper" file. This makes does not cause default stream selection over the "proper" file. This makes
it slightly less intrusive. (In mpv 0.28.0 and before, this was not quite it slightly less intrusive.
strictly enforced.)
This is a path list option. See `List Options`_ for details. This is a path list option. See `List Options`_ for details.
+166 -15
View File
@@ -175,8 +175,7 @@ Configurable Options
Default: bottombar Default: bottombar
The layout for the OSC. Currently available are: box, slimbox, The layout for the OSC. Currently available are: box, slimbox,
bottombar, topbar, slimbottombar and slimtopbar. Default pre-0.21.0 was bottombar, topbar, slimbottombar, slimtopbar and floating.
'box'.
``seekbarstyle`` ``seekbarstyle``
Default: bar Default: bar
@@ -230,7 +229,7 @@ Configurable Options
Set to ``no`` to disable any special mouse wheel behavior. Set to ``no`` to disable any special mouse wheel behavior.
``deadzonesize`` ``deadzonesize``
Default: 0.5 Default: 0.75
Size of the deadzone. The deadzone is an area that makes the mouse act Size of the deadzone. The deadzone is an area that makes the mouse act
like leaving the window. Movement there won't make the OSC show up and like leaving the window. Movement there won't make the OSC show up and
@@ -238,13 +237,13 @@ Configurable Options
at the window border opposite to the OSC and the size controls how much at the window border opposite to the OSC and the size controls how much
of the window it will span. Values between 0.0 and 1.0, where 0 means the of the window it will span. Values between 0.0 and 1.0, where 0 means the
OSC will always popup with mouse movement in the window, and 1 means the OSC will always popup with mouse movement in the window, and 1 means the
OSC will only show up when the mouse hovers it. Default pre-0.21.0 was 0. OSC will only show up when the mouse hovers it. Default pre-0.42.0 was 0.5.
``minmousemove`` ``minmousemove``
Default: 0 Default: 0
Minimum amount of pixels the mouse has to move between ticks to make Minimum amount of pixels the mouse has to move between ticks to make
the OSC show up. Default pre-0.21.0 was 3. the OSC show up.
``showwindowed`` ``showwindowed``
Default: yes Default: yes
@@ -261,6 +260,11 @@ Configurable Options
Show the mpv logo and message when idle Show the mpv logo and message when idle
``audioonlyscreen``
Default: no
Show the mpv logo when no video track is present or selected.
``scalewindowed`` ``scalewindowed``
Default: 1.0 Default: 1.0
@@ -364,6 +368,16 @@ Configurable Options
The list of visibility modes to cycle through when calling the The list of visibility modes to cycle through when calling the
osc-visibility cycle script message. Modes are separated by ``_``. osc-visibility cycle script message. Modes are separated by ``_``.
``boxwidth``
Default: 550
Width of the ``box`` layout.
``slimboxwidth``
Default: 660
Width of the ``slimbox`` layout.
``boxmaxchars`` ``boxmaxchars``
Default: 80 Default: 80
@@ -379,27 +393,50 @@ Configurable Options
within the areas not covered by the osc (``yes``). If this option is set, within the areas not covered by the osc (``yes``). If this option is set,
the osc may overwrite the ``--video-margin-ratio-*`` options, even if the the osc may overwrite the ``--video-margin-ratio-*`` options, even if the
user has set them. (It will not overwrite them if all of them are set to user has set them. (It will not overwrite them if all of them are set to
default values.) Additionally, ``visibility`` must be set to ``always``. default values.) By default, ``visibility`` must be set to ``always``.
Otherwise, this option does nothing. Use ``dynamic_margins`` to allow margins to update with OSC visibility
instead.
Currently, this is supported for the ``bottombar``, ``slimbottombar``, Currently, this is supported for the ``bottombar``, ``slimbottombar``,
``topbar`` and ``slimtopbar`` layouts only. The other layouts do not change ``topbar`` and ``slimtopbar`` layouts only. The other layouts do not change
if this option is set. Separately, if window controls are present (see if this option is set. Separately, if window controls are present (see
below), they will be affected regardless of which osc layout is in use. below), they will be affected regardless of which osc layout is in use.
The border is static and appears even if the OSC is configured to appear Subtitles may still overlap with the OSC when ``--sub-use-margins`` is set
only on mouse interaction. If the OSC is invisible, the border is simply to ``yes`` (the default), as they are allowed to extend into the margin
filled with the background color (black by default). area. Setting ``--sub-use-margins=no`` confines subtitles to the video
area.
This currently still makes the OSC overlap with subtitles (if the
``--sub-use-margins`` option is set to ``yes``, the default). This may be
fixed later.
This does not work correctly with video outputs like ``--vo=xv``, which This does not work correctly with video outputs like ``--vo=xv``, which
render OSD into the unscaled video. render OSD into the unscaled video.
``dynamic_margins``
Default: no
When set to ``yes``, margins follow the actual OSC visibility: they are
applied when the OSC appears and removed when it hides. Without this
option, margins are only applied when ``visibility`` is set to ``always``.
``sub_margins``
Default: no
Whether to adjust the subtitle margin so that subtitles do not overlap
with the OSC. Requires ``dynamic_margins`` or ``visibility=always`` to
take effect. Uses ``--sub-margin-y-offset`` to apply the adjustment.
With ``boxvideo`` enabled and ``--sub-use-margins=no``, subtitles are
already confined to the video area and this option has no additional
effect.
``osd_margins``
Default: yes
Whether to adjust the OSD margin so that OSD text does not overlap
with the OSC. Requires ``dynamic_margins`` or ``visibility=always`` to
take effect. Uses ``--osd-margin-y-offset`` to apply the adjustment.
``windowcontrols`` ``windowcontrols``
Default: auto (Show window controls if there is no window border) Default: auto (Show window controls if there is no window border/title-bar)
Whether to show window management controls over the video, and if so, Whether to show window management controls over the video, and if so,
which side of the window to place them. This may be desirable when the which side of the window to place them. This may be desirable when the
@@ -411,6 +448,12 @@ Configurable Options
and ``quit``. Not all platforms implement ``minimize`` and ``maximize``, and ``quit``. Not all platforms implement ``minimize`` and ``maximize``,
but ``quit`` will always work. but ``quit`` will always work.
``windowcontrols_independent``
Default: yes
Whether to show window controls independently of the OSC, or show them
together.
``windowcontrols_alignment`` ``windowcontrols_alignment``
Default: right Default: right
@@ -427,6 +470,30 @@ Configurable Options
windowcontrols title. windowcontrols title.
ASS tags are escaped, and newlines and trailing slashes are stripped. ASS tags are escaped, and newlines and trailing slashes are stripped.
``floatingtitle``
Default: yes
Whether to show the title row in the ``floating`` layout. When enabled,
window controls are rendered as compact buttons without a full-width
background bar.
``floatingwidth``
Default: 700
Width of the ``floating`` layout.
``floatingalpha``
Default: 105
Alpha of the ``floating`` layout background, 0 (opaque) to 255 (fully
transparent).
``tracknumberswidth``
Default: 35
Width of the track number labels next to the audio/subtitle track selector
icons. Set to ``0`` to hide track numbers and show only the icons.
``greenandgrumpy`` ``greenandgrumpy``
Default: no Default: no
@@ -451,6 +518,19 @@ Configurable Options
Use a Unicode minus sign instead of an ASCII hyphen when displaying Use a Unicode minus sign instead of an ASCII hyphen when displaying
the remaining playback time. the remaining playback time.
``icon_style``
Default: layout
Selects the icon set used for OSC buttons. Both sets are bundled in the
mpv-osd-symbols font.
``layout``
Select the icon set based on the current layout.
``classic``
The original mpv icon set.
``fluent``
Icons based on Microsoft's Fluent UI System Icons.
``background_color`` ``background_color``
Default: #000000 Default: #000000
@@ -516,8 +596,16 @@ Configurable Options
Use display fps to calculate the interval between OSC redraws. Use display fps to calculate the interval between OSC redraws.
``max_thumb_size``
Default: 200
Maximum display size of the preview thumbnail. Only meaningful when a
Thumbnailer is active. See the `OSC Preview API`_ section.
The following options configure what commands are run when the buttons are The following options configure what commands are run when the buttons are
clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``. clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``.
An option that ends with ``_down_command`` means that the command is
continuously called while the mouse button is held down.
``menu_mbtn_left_command=script-binding select/menu; script-message-to osc osc-hide`` ``menu_mbtn_left_command=script-binding select/menu; script-message-to osc osc-hide``
@@ -597,6 +685,36 @@ clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``.
``fullscreen_mbtn_right_command="cycle window-maximized"`` ``fullscreen_mbtn_right_command="cycle window-maximized"``
``skip_backward_mbtn_left_down_command=seek -5``
``skip_backward_mbtn_mid_down_command=frame-back-step``
``skip_backward_mbtn_right_down_command=seek -30``
``skip_forward_mbtn_left_down_command=seek 10``
``skip_forward_mbtn_mid_down_command=frame-step``
``skip_forward_mbtn_right_down_command=seek 60``
``close_mbtn_left_command=quit``
``close_mbtn_mid_command=``
``close_mbtn_right_command=``
``minimize_mbtn_left_command=cycle window-minimized``
``minimize_mbtn_mid_command=``
``minimize_mbtn_right_command=``
``maximize_mbtn_left_command=cycle ${?fullscreen==yes:fullscreen}${!fullscreen==yes:window-maximized}``
``maximize_mbtn_mid_command=``
``maximize_mbtn_right_command=``
Custom Buttons Custom Buttons
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@@ -649,3 +767,36 @@ to set auto mode (the default) with ``b``::
Controls the visibility of the mpv logo on idle. Valid arguments are ``yes``, Controls the visibility of the mpv logo on idle. Valid arguments are ``yes``,
``no``, and ``cycle`` to toggle between yes and no. If a second argument is ``no``, and ``cycle`` to toggle between yes and no. If a second argument is
passed (any value), then the output on the OSD will be silenced. passed (any value), then the output on the OSD will be silenced.
OSC Preview API
~~~~~~~~~~~~~~~
The OSC supports displaying preview thumbnails when hovering over the seekbar if
a compatible thumbnailer script is installed. It communicates with a thumbnailer
script via the following ``user-data`` properties:
``user-data/osc/draw-preview``
Set by the OSC to request a thumbnail within the currently playing file.
The ``draw-preview`` property is a table with the following fields:
``x``, ``y``
Top-left coordinates (positive integers) to draw the thumbnail at.
``w``, ``h``
Width and height (positive non-zero integers) of the area to draw the
thumbnail in. Note that this only specifies the drawing width and
height, the actual backing thumbnail size may differ.
``hover-sec``
Requested thumbnail timestamp in seconds.
``ass``
Optional ASS string to render alongside the thumbnail, using OSD
coordinates. This can be used for decorations such as a thumbnail
border.
The OSC sets this property to ``nil`` to signal the thumbnailer to clear
the displayed thumbnail.
Avoid installing/enabling multiple thumbnailer script since this api expects
only one to be active at a time.
+37 -3
View File
@@ -7,6 +7,8 @@ providing script bindings that gather and format the data to be selected in the
console and do operations on the selected item. It can be disabled using the console and do operations on the selected item. It can be disabled using the
``--load-select=no`` option. ``--load-select=no`` option.
This script is also used to populate the context menu.
Key bindings Key bindings
------------ ------------
@@ -28,6 +30,12 @@ PGUP and Ctrl+b
PGDN and Ctrl+f PGDN and Ctrl+f
Scroll down one page. Scroll down one page.
Shift+LEFT
Scroll left.
Shift+RIGHT
Scroll right.
Ctrl+y Ctrl+y
Copy the focused item to the clipboard. Copy the focused item to the clipboard.
@@ -41,6 +49,12 @@ WHEEL_UP
WHEEL_DOWN WHEEL_DOWN
Scroll down. Scroll down.
WHEEL_LEFT and Shift+WHEEL_DOWN
Scroll left.
WHEEL_RIGHT and Shift+WHEEL_UP
Scroll right.
Typing printable characters does a fuzzy search of the presented items. Typing printable characters does a fuzzy search of the presented items.
If the query starts with ``'``, only exact matches are filtered. You can also If the query starts with ``'``, only exact matches are filtered. You can also
@@ -88,9 +102,6 @@ Available script bindings are:
``select-subtitle-line`` ``select-subtitle-line``
Select a subtitle line to seek to. This doesn't work with image subtitles. Select a subtitle line to seek to. This doesn't work with image subtitles.
This currently requires ``ffmpeg`` in ``PATH``, or in the same folder as mpv
on Windows.
``select-audio-device`` ``select-audio-device``
Select an audio device. Select an audio device.
@@ -138,9 +149,15 @@ Available script bindings are:
``open-docs`` ``open-docs``
Open mpv's online documentation in the browser. Open mpv's online documentation in the browser.
``open-chat``
Open mpv's chat in the browser.
``menu`` ``menu``
Show a menu with miscellaneous entries. Show a menu with miscellaneous entries.
``context-menu``
Show the context menu.
Configuration Configuration
------------- -------------
@@ -161,3 +178,20 @@ Configurable options
Default: yes Default: yes
Whether to show only the last of history entries with the same path. Whether to show only the last of history entries with the same path.
``menu_conf_path``
Default: ~~/menu.conf (see `FILES`_).
The path from which to read the custom context menu definition (see `CONTEXT
MENU`_).
``max_playlist_items``
Default: 25
The maximum number of playlist entries in the context menu.
``populate_menu_data``
Default: yes, except for libmpv
Whether observe the properties referenced in ``menu.conf`` and update
``menu-data`` with suitable menu items after mpv's window is created.
+5
View File
@@ -120,6 +120,11 @@ Configurable Options
Whether to clip lines to the terminal width. Whether to clip lines to the terminal width.
``track_info_selected_only``
Default: yes
Show track info for selected tracks only instead of all tracks.
``plot_perfdata`` ``plot_perfdata``
Default: no Default: no
+69 -6
View File
@@ -35,7 +35,7 @@ The exact syntax is:
and the ``filter-parameter-list``: and the ``filter-parameter-list``:
``<filter-parameter> | <filter-parameter> "," <filter-parameter-list>`` ``<filter-parameter> | <filter-parameter> ":" <filter-parameter-list>``
and ``filter-parameter``: and ``filter-parameter``:
@@ -741,15 +741,78 @@ Available mpv-only filters are:
NVIDIA RTX Super Resolution. NVIDIA RTX Super Resolution.
``interlaced-only=<yes|no>`` ``interlaced-only=<yes|no>``
If ``yes``, only deinterlace frames marked as interlaced (default: no). If ``yes``, only deinterlace frames marked as interlaced (default: no).
``mode=<blend|bob|adaptive|mocomp|ivctc|none>`` ``mode=<blend|bob|adaptive|mocomp|ivtc|none>``
Tries to select a video processor with the given processing capability. Tries to select a video processor with the given processing capability.
If a video processor supports multiple capabilities, it is not clear If a video processor supports multiple capabilities, it is not guaranteed
which algorithm is actually selected. ``none`` always falls back. On which algorithm will actually be selected, this is left to the driver.
most if not all hardware, this option will probably do nothing, because However, ``blend`` and ``bob`` modes are enforced by not passing reference
a video processor usually supports all modes or none. frames and adjusting the output frame rate. The other modes are used to
select an appropriate video processor, but the algorithm chosen depends
on the driver and the content. ``ivtc`` mode outputs at the half rate.
.. note::
``ivtc`` mode only performs field matching and does not drop duplicate
frames. Duplicated frames can be removed manually using the ``decimate``
filter: ``--vf=d3d11vpp="deint:mode=ivtc,format=nv12,decimate=5"`` for
3:2 pulldown cadence. ``format=nv12`` is required to download frames back
to the CPU for decimation, the format should match the underlying format
of the d3d11 frame.
``nvidia-true-hdr`` ``nvidia-true-hdr``
Enable NVIDIA RTX Video HDR processing. Enable NVIDIA RTX Video HDR processing.
``amf_frc``
AMD Frame Rate Conversion filter. Requires AMD hardware and drivers
supporting AMF FRC.
AMF FRC is a technique for achieving high-end video frame rate conversion
results from lower frame rate video inputs. The filter doubles the input
frame rate by generating intermediate frames.
AMF FRC only supports D3D11 input currently. Use `--hwdec=d3d11va` or
`--vf-pre=format=d3d11` to upload the data. `--d3d11va-zero-copy` is also
recommended for better performance.
``profile=<auto|low|high|super>``
Selects the quality profile for frame rate conversion.
``auto`` (default)
Select profile based on input resolution. Uses ``high`` for
resolutions up to 1440p, and ``super`` for 1440p and higher.
``low``
Less levels of hierarchical motion search. Only recommended for
extremely low resolutions.
``high``
Recommended for any resolution up to 1440p.
``super``
More levels of hierarchical motion search. Recommended for
resolutions 1440p or higher.
``mv-search=<native|performance>``
Selects the motion vector search mode.
``native`` (default)
Conduct motion search on the full resolution of source images.
``performance``
Conduct motion search on the down scaled source images.
Recommended for APU or low end GPU for better performance.
``fallback``
In case confidence is too low to do interpolation, fall back to simple
frame blending. If not set, the filter will repeat the last frame instead.
(default: no)
``indicator``
Specifies whether or not the FRC indicator square is shown in the top
left corner of the video. (default: no)
``future-frame``
When enabled, the information contained in the next frame in the
sequence will be used in FRC interpolation calculations, in addition to
the current pair of frames. This will introduce one extra frame time of
latency. (default: yes)
``fingerprint=...`` ``fingerprint=...``
Compute video frame fingerprints and provide them as metadata. Actually, it Compute video frame fingerprints and provide them as metadata. Actually, it
currently barely deserved to be called ``fingerprint``, because it does not currently barely deserved to be called ``fingerprint``, because it does not
+6 -8
View File
@@ -118,8 +118,7 @@ Available video output drivers are:
Shared memory video output driver without hardware acceleration that works Shared memory video output driver without hardware acceleration that works
whenever X11 is present. whenever X11 is present.
Since mpv 0.30.0, you may need to use ``--profile=sw-fast`` to get decent You may need to use ``--profile=sw-fast`` to get decent performance.
performance.
.. note:: This is a fallback only, and should not be normally used. .. note:: This is a fallback only, and should not be normally used.
@@ -319,6 +318,8 @@ Available video output drivers are:
This is low quality, and has issues with OSD. We strongly recommend that This is low quality, and has issues with OSD. We strongly recommend that
you use ``--vo=gpu`` with ``--hwdec=vaapi`` instead. you use ``--vo=gpu`` with ``--hwdec=vaapi`` instead.
.. warning:: This VO is deprecated will be removed next release.
The following global options are supported by this video output: The following global options are supported by this video output:
``--vo-vaapi-scaling=<algorithm>`` ``--vo-vaapi-scaling=<algorithm>``
@@ -373,8 +374,7 @@ Available video output drivers are:
the images at full color range, but 256-colors output is also supported (see the images at full color range, but 256-colors output is also supported (see
below). On Windows it requires an ansi terminal such as mintty. below). On Windows it requires an ansi terminal such as mintty.
Since mpv 0.30.0, you may need to use ``--profile=sw-fast`` to get decent You may need to use ``--profile=sw-fast`` to get decent performance.
performance.
Note: the TCT image output is not synchronized with other terminal output Note: the TCT image output is not synchronized with other terminal output
from mpv, which can lead to broken images. The options ``--terminal=no`` or from mpv, which can lead to broken images. The options ``--terminal=no`` or
@@ -629,8 +629,7 @@ Available video output drivers are:
environment (e.g. no X). Does not support hardware acceleration (if you environment (e.g. no X). Does not support hardware acceleration (if you
need this, check the ``drm`` backend for ``gpu`` VO). need this, check the ``drm`` backend for ``gpu`` VO).
Since mpv 0.30.0, you may need to use ``--profile=sw-fast`` to get decent You may need to use ``--profile=sw-fast`` to get decent performance.
performance.
The following global options are supported by this video output: The following global options are supported by this video output:
@@ -739,7 +738,6 @@ Available video output drivers are:
Shared memory video output driver without hardware acceleration that works Shared memory video output driver without hardware acceleration that works
whenever Wayland is present. whenever Wayland is present.
Since mpv 0.30.0, you may need to use ``--profile=sw-fast`` to get decent You may need to use ``--profile=sw-fast`` to get decent performance.
performance.
.. note:: This is a fallback only, and should not be normally used. .. note:: This is a fallback only, and should not be normally used.
+3 -2
View File
@@ -272,8 +272,9 @@ sub/:
sd_ass.c's internal state. sd_ass.c's internal state.
etc/: etc/:
The files input.conf and builtin.conf are actually integrated into the mpv The files input.conf, builtin.conf and menu.conf are actually integrated
binary by the build system. They contain the default configs and keybindings. into the mpv binary by the build system. They contain the default configs
and keybindings.
Best practices and Concepts within mpv Best practices and Concepts within mpv
====================================== ======================================
+1 -1
View File
@@ -1 +1 @@
0.41.0 0.41.0-UNKNOWN
+67
View File
@@ -0,0 +1,67 @@
# Security Policy
## Supported Versions
Only the most recent stable release of mpv is supported with security updates.
Older releases are **not** maintained and will not receive patches.
## What Qualifies as a Security Issue
mpv is a desktop media player. It is not designed to be exposed to untrusted
environments. By design, mpv provides features such as loading user scripts,
running subprocesses, and controlling playback via IPC. These documented
mechanisms are not considered security vulnerabilities.
A security issue is a bug in mpv's own code that allows untrusted input to cause
harm beyond the expected scope of playback. Examples include:
- Exploitable memory corruption (buffer overflows, use-after-free, etc.) caused
by crafted media files, subtitles, or playlists.
- Arbitrary code execution or unexpected file system access triggered by
malicious input.
- Information disclosure (e.g. unintended local file reads) through crafted
input.
The following are generally **not** considered security issues:
- Behavior resulting from documented features and interfaces.
- Denial of service (crashes, excessive memory or CPU usage) from crafted input.
These are typically unavoidable when processing complex media formats and are
treated as regular bugs.
- Bugs in third-party dependencies (FFmpeg, libass, libplacebo, etc.) that are
not caused by mpv-specific usage. These should be reported to the respective
upstream projects.
When in doubt, report it. We would rather triage a non-issue than miss a real
vulnerability.
## Reporting a Vulnerability
If you discover a security vulnerability in mpv, please report it responsibly
using **GitHub's private vulnerability reporting** feature:
1. Go to the [Security](https://github.com/mpv-player/mpv/security) tab of the
mpv repository.
2. Click **"Report a vulnerability"**.
3. Fill in the advisory form with as much detail as possible, including steps to
reproduce, affected versions, and potential impact.
This creates a private advisory visible only to you and our security team,
allowing us to discuss and address the issue before any public disclosure.
For more information on this process, see
[GitHub's documentation on private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).
## Direct Contact
If you are unable to use GitHub's reporting feature, you can reach out directly
to the security team:
- **@Akemi** - https://github.com/Akemi
- **@kasper93** - https://github.com/kasper93
## Disclosure Policy
- Please **do not** open public issues for security vulnerabilities.
- We aim to acknowledge reports promptly and work toward a fix in a reasonable
timeframe.
+26 -35
View File
@@ -6,7 +6,6 @@ import re
import shutil import shutil
import subprocess import subprocess
import sys import sys
from functools import partial
sys_re = re.compile("^/System") sys_re = re.compile("^/System")
usr_re = re.compile("^/usr/lib/") usr_re = re.compile("^/usr/lib/")
@@ -25,9 +24,16 @@ def is_user_lib(objfile, libname):
"libswift" not in libname "libswift" not in libname
def otool(objfile, rapths): def otool(objfile, rapths):
command = f"otool -L '{objfile}' | grep -e '\t' | awk '{{ print $1 }}'" output = subprocess.check_output(
output = subprocess.check_output(command, shell=True, universal_newlines=True) ["otool", "-L", objfile], universal_newlines=True,
libs = set(filter(partial(is_user_lib, objfile), output.split())) )
libs = set()
for line in output.splitlines():
if not line.startswith("\t"):
continue
lib = line.split()[0]
if is_user_lib(objfile, lib):
libs.add(lib)
libs_resolved = set() libs_resolved = set()
libs_relative = set() libs_relative = set()
@@ -39,41 +45,27 @@ def otool(objfile, rapths):
return libs_resolved, libs_relative return libs_resolved, libs_relative
def get_rapths(objfile): def iter_rpaths(objfile):
rpaths: list[str] = [] output = subprocess.check_output(
command = f"otool -l '{objfile}' | grep -A2 LC_RPATH | grep path" ["otool", "-l", objfile], universal_newlines=True,
)
path_re = re.compile(r"^\s*path (.*) \(offset \d*\)$") path_re = re.compile(r"^\s*path (.*) \(offset \d*\)$")
for line in output.splitlines():
if match := path_re.match(line):
yield match.group(1).strip()
try: def get_rapths(objfile):
result = subprocess.check_output(command, shell=True, universal_newlines=True) loader_path = os.path.dirname(objfile)
except Exception: return [
return rpaths
for line in result.splitlines():
match = path_re.search(line)
if match is None:
continue
line_clean = match.group(1).strip()
# resolve @loader_path # resolve @loader_path
if line_clean.startswith("@loader_path/"): os.path.normpath(rpath.replace("@loader_path", loader_path, 1))
line_clean = line_clean[len("@loader_path/"):] for rpath in iter_rpaths(objfile)
line_clean = os.path.join(os.path.dirname(objfile), line_clean) ]
line_clean = os.path.normpath(line_clean)
rpaths.append(line_clean)
return rpaths
def get_rpaths_dev_tools(binary): def get_rpaths_dev_tools(binary):
command = (
f"otool -l '{binary}' | grep -A2 LC_RPATH | grep path | "
'grep "Xcode\\|CommandLineTools"'
)
result = subprocess.check_output(command, shell = True, universal_newlines=True)
path_re = re.compile(r"^\s*path (.*) \(offset \d*\)$")
return [ return [
match.group(1).strip() rpath for rpath in iter_rpaths(binary)
for line in result.splitlines() if "Xcode" in rpath or "CommandLineTools" in rpath
if (match := path_re.search(line)) is not None
] ]
def resolve_lib_path(objfile, lib, rapths): def resolve_lib_path(objfile, lib, rapths):
@@ -97,8 +89,7 @@ def resolve_lib_path(objfile, lib, rapths):
def check_vulkan_max_version(version): def check_vulkan_max_version(version):
try: try:
subprocess.check_output( subprocess.check_output(
f"pkg-config vulkan --max-version={version}", ["pkg-config", "vulkan", f"--max-version={version}"],
shell=True,
) )
return True return True
except Exception: except Exception:
+203
View File
@@ -0,0 +1,203 @@
#!/usr/bin/env python3
"""Import Fluent UI System Icons into mpv-osd-symbols font.
Downloads SVG icons from microsoft/fluentui-system-icons and uses FontForge
to import them into the mpv-osd-symbols font.
Usage:
./TOOLS/gen-fluent-glyphs.py
./TOOLS/gen-osd-font.sh
Requirements: fontforge
"""
import os
import subprocess
import sys
import tempfile
import urllib.parse
import urllib.request
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SFDIR = os.path.join(SCRIPT_DIR, "mpv-osd-symbols.sfdir")
REPO_SHA = "9a4a2db2df7f0067b4ef43c5ae5bfcae3759a5a0" # v1.1.320
REPO_BASE = ("https://raw.githubusercontent.com/"
f"microsoft/fluentui-system-icons/{REPO_SHA}/assets")
# Mapping: codepoint -> (fluent_icon_name, size, style, transform)
#
# See https://github.com/microsoft/fluentui-system-icons/tree/main/assets
# for available icons.
ICONS = {
0xE200: ("Line Horizontal 3", 24, "filled", None), # menu
0xE201: ("Play", 24, "filled", "flip_x"), # prev / play_backward
0xE202: ("Play", 24, "filled", None), # play / next
0xE203: ("Pause", 24, "filled", None), # pause
0xE204: ("Clock", 24, "regular", None), # clock (buffering)
0xE205: ("Rewind", 24, "filled", None), # skip_backward
0xE206: ("Fast Forward", 24, "filled", None), # skip_forward
0xE207: ("Previous", 24, "filled", None), # chapter_prev
0xE208: ("Next", 24, "filled", None), # chapter_next
0xE209: ("Chat", 24, "regular", None), # audio
0xE20A: ("Closed Caption", 24, "regular", None), # subtitle
0xE20B: ("Speaker Mute", 24, "filled", None), # mute
0xE20C: ("Speaker 0", 24, "filled", None), # volume[1]
0xE20D: ("Speaker 1", 24, "filled", None), # volume[2]
0xE20E: ("Speaker 2", 24, "filled", None), # volume[3]
0xE20F: ("Speaker 2", 24, "filled", "add_alert"),# volume[4] (>100%)
0xE210: ("Full Screen Maximize", 24, "filled", None), # fullscreen
0xE211: ("Full Screen Minimize", 24, "filled", None), # exit_fullscreen
0xE212: ("Dismiss", 24, "filled", None), # close
0xE213: ("Subtract", 24, "filled", None), # minimize
0xE214: ("Maximize", 24, "filled", None), # maximize
0xE215: ("Square Multiple", 24, "filled", None), # unmaximize
}
def icon_url(name, size, style):
snake = name.lower().replace(" ", "_")
filename = f"ic_fluent_{snake}_{size}_{style}.svg"
dir_encoded = urllib.parse.quote(name)
return f"{REPO_BASE}/{dir_encoded}/SVG/{filename}"
def download_icons(dest_dir):
paths = {}
seen: dict[str, str] = {}
for cp, (name, size, style, _transform) in ICONS.items():
url = icon_url(name, size, style)
svg_path = os.path.join(dest_dir, f"uni{cp:04X}.svg")
if url in seen:
# Reuse previously downloaded file.
import shutil
shutil.copy2(seen[url], svg_path)
paths[cp] = svg_path
print(f" U+{cp:04X} {name} (cached)")
continue
print(f" U+{cp:04X} {name} <- {url}")
try:
urllib.request.urlretrieve(url, svg_path)
seen[url] = svg_path
paths[cp] = svg_path
except urllib.error.HTTPError as e:
print(f" ERROR: {e.code} {e.reason} - check icon name/size")
return paths
def import_into_font(svg_paths):
transforms = {}
for cp, (_name, _size, _style, transform) in ICONS.items():
if transform:
transforms[cp] = transform
ff_script = f"""\
import fontforge
import psMat
import os
font = fontforge.open({SFDIR!r})
svg_paths = {svg_paths!r}
transforms = {transforms!r}
for cp, svg_path in sorted(svg_paths.items()):
if not os.path.exists(svg_path):
continue
glyph = font.createChar(cp)
glyph.clear()
glyph.importOutlines(svg_path)
bb = glyph.boundingBox() # (xmin, ymin, xmax, ymax)
if bb[0] == bb[2] or bb[1] == bb[3]:
print(f" SKIP U+{{cp:04X}} (empty)")
continue
# Center vertically within ascent (0..800)
y_off = (800 - (bb[3] + bb[1])) / 2
if y_off:
glyph.transform(psMat.translate(0, y_off))
bb = glyph.boundingBox()
transform = transforms.get(cp)
if transform == "flip_x":
cx = (bb[0] + bb[2]) / 2
glyph.transform(psMat.compose(psMat.translate(-cx, 0),
psMat.compose(psMat.scale(-1, 1),
psMat.translate(cx, 0))))
elif transform == "add_alert":
cy = (bb[1] + bb[3]) / 2
h = (bb[3] - bb[1]) * 0.75
top = cy + h / 2
bot = cy - h / 2
w = h * 0.14 # stroke width relative to height
r = w * 0.55 # dot radius
cx = bb[2] + 100 + w / 2
k = 0.5523
pen = glyph.glyphPen(replace=False)
# Stem (tapers from w at top to ~0.46*w at bottom tip)
stem_bot = bot + r * 2 + h * 0.1 # gap above dot
hw = w / 2
nhw = hw * 0.46
pen.moveTo((cx + hw, top))
pen.curveTo((cx + hw, top + hw * 0.3), (cx + hw * 0.3, top + hw),
(cx, top + hw))
pen.curveTo((cx - hw * 0.3, top + hw), (cx - hw, top + hw * 0.3),
(cx - hw, top))
pen.lineTo((cx - nhw, stem_bot))
pen.curveTo((cx - nhw, stem_bot - nhw * 0.5), (cx - nhw * 0.5, stem_bot - nhw),
(cx, stem_bot - nhw))
pen.curveTo((cx + nhw * 0.5, stem_bot - nhw), (cx + nhw, stem_bot - nhw * 0.5),
(cx + nhw, stem_bot))
pen.closePath()
# Dot (circle)
dot_cy = bot + r
pen.moveTo((cx + r, dot_cy))
pen.curveTo((cx + r, dot_cy + r * k), (cx + r * k, dot_cy + r),
(cx, dot_cy + r))
pen.curveTo((cx - r * k, dot_cy + r), (cx - r, dot_cy + r * k),
(cx - r, dot_cy))
pen.curveTo((cx - r, dot_cy - r * k), (cx - r * k, dot_cy - r),
(cx, dot_cy - r))
pen.curveTo((cx + r * k, dot_cy - r), (cx + r, dot_cy - r * k),
(cx + r, dot_cy))
pen.closePath()
pen = None
print(f" U+{{cp:04X}} imported")
font.save({SFDIR!r})
print("Saved to", {SFDIR!r})
"""
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
f.write(ff_script)
script_path = f.name
try:
subprocess.run(["fontforge", "-lang=py", "-script", script_path],check=True)
finally:
os.unlink(script_path)
def main():
print("Downloading Fluent UI System Icons...")
with tempfile.TemporaryDirectory() as tmpdir:
svg_paths = download_icons(tmpdir)
if not svg_paths:
print("No icons downloaded.")
sys.exit(1)
print(f"\nImporting {len(svg_paths)} icons into {SFDIR}...")
import_into_font(svg_paths)
print("\nDone. Run './TOOLS/gen-osd-font.sh' to rebuild the mpv font.")
if __name__ == "__main__":
main()
+9 -9
View File
@@ -52,7 +52,7 @@ mp.observe_property("vo-configured", "bool", function(_, v)
end) end)
mp.command_native_async({ mp.command_native_async({
name = "subprocess", _name = "subprocess",
args = {"sh", "-c", "echo hi && sleep 10s"}, args = {"sh", "-c", "echo hi && sleep 10s"},
capture_stdout = true capture_stdout = true
}, },
@@ -60,7 +60,7 @@ mp.observe_property("vo-configured", "bool", function(_, v)
print("done subprocess: " .. join(" ", {res, val, err})) print("done subprocess: " .. join(" ", {res, val, err}))
end) end)
local x = mp.command_native_async({name = "subprocess", args = {"sleep", "inf"}}, local x = mp.command_native_async({_name = "subprocess", args = {"sleep", "inf"}},
function(res, val, err) function(res, val, err)
print("done sleep inf subprocess: " .. join(" ", {res, val, err})) print("done sleep inf subprocess: " .. join(" ", {res, val, err}))
end) end)
@@ -70,7 +70,7 @@ mp.observe_property("vo-configured", "bool", function(_, v)
end) end)
-- (assuming this "freezes") -- (assuming this "freezes")
local y = mp.command_native_async({name = "sub-add", url = "-"}, local y = mp.command_native_async({_name = "sub-add", url = "-"},
function(res, val, err) function(res, val, err)
print("done sub-add stdin: " .. join(" ", {res, val, err})) print("done sub-add stdin: " .. join(" ", {res, val, err}))
end) end)
@@ -80,19 +80,19 @@ mp.observe_property("vo-configured", "bool", function(_, v)
end) end)
mp.command_native_async({name = "subprocess", args = {"wc", "-c"}, mp.command_native_async({_name = "subprocess", args = {"wc", "-c"},
stdin_data = "hello", capture_stdout = true}, stdin_data = "hello", capture_stdout = true},
function(_, val) function(_, val)
print("Should be '5': " .. val.stdout) print("Should be '5': " .. val.stdout)
end) end)
-- blocking stdin by default -- blocking stdin by default
mp.command_native_async({name = "subprocess", args = {"cat"}, mp.command_native_async({_name = "subprocess", args = {"cat"},
capture_stdout = true}, capture_stdout = true},
function(_, val) function(_, val)
print("Should be 0: " .. #val.stdout) print("Should be 0: " .. #val.stdout)
end) end)
-- stdin + detached -- stdin + detached
mp.command_native_async({name = "subprocess", mp.command_native_async({_name = "subprocess",
args = {"bash", "-c", "(sleep 5s ; cat)"}, args = {"bash", "-c", "(sleep 5s ; cat)"},
stdin_data = "this should appear after 5s.\n", stdin_data = "this should appear after 5s.\n",
detach = true}, detach = true},
@@ -101,11 +101,11 @@ mp.observe_property("vo-configured", "bool", function(_, v)
end) end)
-- This should get killed on script exit. -- This should get killed on script exit.
mp.command_native_async({name = "subprocess", playback_only = false, mp.command_native_async({_name = "subprocess", playback_only = false,
args = {"sleep", "inf"}}, function()end) args = {"sleep", "inf"}}, function()end)
-- Runs detached; should be killed on player exit (forces timeout) -- Runs detached; should be killed on player exit (forces timeout)
mp.command_native({_flags={"async"}, name = "subprocess", mp.command_native({_flags={"async"}, _name = "subprocess",
playback_only = false, args = {"sleep", "inf"}}) playback_only = false, args = {"sleep", "inf"}})
end) end)
@@ -114,7 +114,7 @@ local function freeze_test(playback_only)
-- This "freezes" the script, should be killed via timeout. -- This "freezes" the script, should be killed via timeout.
counter = counter and counter + 1 or 0 counter = counter and counter + 1 or 0
print("freeze! " .. counter) print("freeze! " .. counter)
local x = mp.command_native({name = "subprocess", local x = mp.command_native({_name = "subprocess",
playback_only = playback_only, playback_only = playback_only,
args = {"sleep", "inf"}}) args = {"sleep", "inf"}})
print("done, killed=" .. utils.to_string(x.killed_by_us)) print("done, killed=" .. utils.to_string(x.killed_by_us))
+1 -1
View File
@@ -5,7 +5,7 @@ local function hardsleep()
end end
local hooks = {"on_before_start_file", "on_load", "on_load_fail", local hooks = {"on_before_start_file", "on_load", "on_load_fail",
"on_preloaded", "on_unload", "on_after_end_file"} "on_preloaded", "on_loaded", "on_unload", "on_after_end_file"}
for _, name in ipairs(hooks) do for _, name in ipairs(hooks) do
mp.add_hook(name, 0, function() mp.add_hook(name, 0, function()
+4 -2
View File
@@ -90,6 +90,8 @@ elements_matroska = (
"FlagForced, 55aa, uint", "FlagForced, 55aa, uint",
"FlagHearingImpaired, 55ab, uint", "FlagHearingImpaired, 55ab, uint",
"FlagVisualImpaired, 55ac, uint", "FlagVisualImpaired, 55ac, uint",
"FlagOriginal, 55ae, uint",
"FlagCommentary, 55af, uint",
"FlagLacing, 9c, uint", "FlagLacing, 9c, uint",
"MinCache, 6de7, uint", "MinCache, 6de7, uint",
"MaxCache, 6df8, uint", "MaxCache, 6df8, uint",
@@ -289,8 +291,8 @@ class MatroskaElement:
self.subelements = subelements self.subelements = subelements
self.subids = {x[0].elid for x in subelements} self.subids = {x[0].elid for x in subelements}
elementd = {} elementd: dict[str, MatroskaElement] = {}
elementlist = [] elementlist: list[MatroskaElement] = []
def parse_elems(elements, namespace): def parse_elems(elements, namespace):
subelements = [] subelements = []
for el in elements: for el in elements:
+1 -1
View File
@@ -22,7 +22,7 @@ OS2Version: 3
OS2_WeightWidthSlopeOnly: 0 OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 0 OS2_UseTypoMetrics: 0
CreationTime: 1408646554 CreationTime: 1408646554
ModificationTime: 1735420479 ModificationTime: 1773309742
PfmFamily: 81 PfmFamily: 81
TTFWeight: 400 TTFWeight: 400
TTFWidth: 5 TTFWidth: 5
+1 -1
View File
@@ -10,7 +10,7 @@ SplineSet
0 640 l 1 0 640 l 1
0 800 l 1 0 800 l 1
880 800 l 1 880 800 l 1
880 640 l 1 880 640 l 1
880 320 m 1 880 320 m 1
0 320 l 1 0 320 l 1
0 480 l 1 0 480 l 1
+43
View File
@@ -0,0 +1,43 @@
StartChar: uniE200
Encoding: 57856 57856 36
Width: 1000
VWidth: 1100
Flags: H
LayerCount: 2
Fore
SplineSet
125 191.666992188 m 1
875 191.666992188 l 2
898.012695312 191.666992188 916.666992188 173.012695312 916.666992188 150 c 0
916.666992188 128.633789062 900.583007812 111.020507812 879.858398438 108.612304688 c 2
875 108.333007812 l 1
125 108.333007812 l 2
101.98828125 108.333007812 83.3330078125 126.987304688 83.3330078125 150 c 0
83.3330078125 171.366210938 99.41796875 188.979492188 120.140625 191.387695312 c 2
125 191.666992188 l 1
875 191.666992188 l 1
125 191.666992188 l 1
124.995117188 441.666992188 m 1
874.99609375 441.758789062 l 2
898.008789062 441.758789062 916.666992188 423.108398438 916.666992188 400.095703125 c 0
916.666992188 378.724609375 900.587890625 361.112304688 879.862304688 358.704101562 c 2
875.00390625 358.424804688 l 1
125.004882812 358.333007812 l 2
101.993164062 358.329101562 83.3330078125 376.983398438 83.3330078125 399.99609375 c 0
83.3330078125 421.362304688 99.4140625 438.974609375 120.135742188 441.387695312 c 2
124.995117188 441.666992188 l 1
874.99609375 441.758789062 l 1
124.995117188 441.666992188 l 1
125 691.666992188 m 1
875 691.666992188 l 2
898.012695312 691.666992188 916.666992188 673.01171875 916.666992188 650 c 0
916.666992188 628.631835938 900.583007812 611.020507812 879.858398438 608.61328125 c 2
875 608.333007812 l 1
125 608.333007812 l 2
101.98828125 608.333007812 83.3330078125 626.98828125 83.3330078125 650 c 0
83.3330078125 671.368164062 99.41796875 688.979492188 120.140625 691.38671875 c 2
125 691.666992188 l 1
875 691.666992188 l 1
125 691.666992188 l 1
EndSplineSet
EndChar
+17
View File
@@ -0,0 +1,17 @@
StartChar: uniE201
Encoding: 57857 57857 37
Width: 1000
VWidth: 1099
Flags: H
LayerCount: 2
Fore
SplineSet
910.899414062 680.256835938 m 2
910.899414062 751.375976562 834.811523438 796.596679688 772.341796875 762.60546875 c 2
257.274414062 482.34765625 l 2
192.01953125 446.842773438 192.01953125 353.16015625 257.274414062 317.651367188 c 2
772.341796875 37.3935546875 l 2
834.811523438 3.4052734375 910.899414062 48.626953125 910.899414062 119.743164062 c 2
910.899414062 680.256835938 l 2
EndSplineSet
EndChar
+17
View File
@@ -0,0 +1,17 @@
StartChar: uniE202
Encoding: 57858 57858 38
Width: 1000
VWidth: 1099
Flags: H
LayerCount: 2
Fore
SplineSet
208.333007812 680.256835938 m 2
208.333007812 751.375976562 284.420898438 796.596679688 346.890625 762.60546875 c 2
861.958007812 482.34765625 l 2
927.212890625 446.842773438 927.212890625 353.16015625 861.958007812 317.651367188 c 2
346.890625 37.3935546875 l 2
284.420898438 3.4052734375 208.333007812 48.626953125 208.333007812 119.743164062 c 2
208.333007812 680.256835938 l 2
EndSplineSet
EndChar
+28
View File
@@ -0,0 +1,28 @@
StartChar: uniE203
Encoding: 57859 57859 39
Width: 1000
VWidth: 1100
Flags: H
LayerCount: 2
Fore
SplineSet
239.420898438 775 m 2
385.25390625 775 l 2
425.525390625 775 458.170898438 742.354492188 458.170898438 702.083007812 c 2
458.170898438 97.9169921875 l 2
458.170898438 57.6455078125 425.525390625 25 385.25390625 25 c 2
239.420898438 25 l 2
199.150390625 25 166.50390625 57.6455078125 166.50390625 97.9169921875 c 2
166.50390625 702.083007812 l 2
166.50390625 742.354492188 199.150390625 775 239.420898438 775 c 2
614.420898438 775 m 2
760.25390625 775 l 2
800.525390625 775 833.170898438 742.354492188 833.170898438 702.083007812 c 2
833.170898438 97.9169921875 l 2
833.170898438 57.6455078125 800.525390625 25 760.25390625 25 c 2
614.420898438 25 l 2
574.150390625 25 541.50390625 57.6455078125 541.50390625 97.9169921875 c 2
541.50390625 702.083007812 l 2
541.50390625 742.354492188 574.150390625 775 614.420898438 775 c 2
EndSplineSet
EndChar
+33
View File
@@ -0,0 +1,33 @@
StartChar: uniE204
Encoding: 57860 57860 40
Width: 1000
VWidth: 1100
Flags: H
LayerCount: 2
Fore
SplineSet
145.833007812 400 m 0
145.833007812 204.400390625 304.399414062 45.8330078125 500 45.8330078125 c 0
695.599609375 45.8330078125 854.166992188 204.400390625 854.166992188 400 c 0
854.166992188 595.600585938 695.599609375 754.166992188 500 754.166992188 c 0
304.399414062 754.166992188 145.833007812 595.600585938 145.833007812 400 c 0
500 816.666992188 m 0
730.116210938 816.666992188 916.666992188 630.119140625 916.666992188 400 c 0
916.666992188 169.883789062 730.116210938 -16.6669921875 500 -16.6669921875 c 0
269.880859375 -16.6669921875 83.3330078125 169.883789062 83.3330078125 400 c 0
83.3330078125 630.119140625 269.880859375 816.666992188 500 816.666992188 c 0
499.712890625 622.98828125 m 2
500 618.75 l 1
500 400 l 1
635.416992188 400 l 2
652.666992188 400 666.666992188 386 666.666992188 368.75 c 0
666.666992188 352.9375 654.904296875 339.854492188 639.654296875 337.787109375 c 2
635.416992188 337.5 l 1
468.75 337.5 l 2
452.9375 337.5 439.854492188 349.262695312 437.787109375 364.512695312 c 2
437.5 368.75 l 1
437.5 618.75 l 2
437.5 636 451.5 650 468.75 650 c 0
484.5625 650 497.645507812 638.236328125 499.712890625 622.98828125 c 2
EndSplineSet
EndChar
+28
View File
@@ -0,0 +1,28 @@
StartChar: uniE205
Encoding: 57861 57861 41
Width: 1000
VWidth: 1100
Flags: H
LayerCount: 2
Fore
SplineSet
417.895507812 718.303710938 m 2
458.479492188 752.844726562 520.904296875 724.000976562 520.904296875 670.70703125 c 2
520.904296875 504.48046875 l 1
772.0625 718.233398438 l 2
812.645507812 752.774414062 875.071289062 723.931640625 875.071289062 670.637695312 c 2
875.071289062 129.268554688 l 2
875.071289062 92.6640625 845.62109375 67.59375 814.029296875 66.6728515625 c 2
810.428710938 66.6728515625 l 2
797.170898438 67.060546875 783.716796875 71.751953125 772.0625 81.6689453125 c 2
520.904296875 295.4140625 l 1
520.904296875 129.334960938 l 2
520.904296875 76.0439453125 458.483398438 47.2021484375 417.895507812 81.7392578125 c 2
109.155273438 344.485351562 l 2
74.943359375 373.6015625 74.943359375 426.426757812 109.154296875 455.543945312 c 2
417.895507812 718.303710938 l 2
109.154296875 455.543945312 m 1
129.408203125 431.748046875 l 1
109.154296875 455.543945312 l 1
EndSplineSet
EndChar
+25
View File
@@ -0,0 +1,25 @@
StartChar: uniE206
Encoding: 57862 57862 42
Width: 1000
VWidth: 1100
Flags: H
LayerCount: 2
Fore
SplineSet
582.104492188 718.284179688 m 2
890.845703125 455.5234375 l 2
925.053710938 426.411132812 925.053710938 373.58203125 890.841796875 344.46484375 c 2
582.099609375 81.71875 l 2
541.516601562 47.181640625 479.095703125 76.0234375 479.095703125 129.319335938 c 2
479.095703125 295.427734375 l 1
227.934570312 81.685546875 l 2
216.28125 71.76953125 202.827148438 67.0771484375 189.567382812 66.6904296875 c 2
185.96875 66.6904296875 l 2
154.375 67.6103515625 124.928710938 92.677734375 124.928710938 129.28125 c 2
124.928710938 670.653320312 l 2
124.928710938 723.947265625 187.350585938 752.790039062 227.936523438 718.25 c 2
479.095703125 504.49609375 l 1
479.095703125 670.688476562 l 2
479.095703125 723.982421875 541.516601562 752.825195312 582.104492188 718.284179688 c 2
EndSplineSet
EndChar
Loaded 100 of 364 files, more files were not shown because too many files have changed in this diff. Show more