Previously, this was in the rubberband filter but it gives out random
numbers without explaning where they come from. Move it to the --pitch
section instead and reword it a bit. Closes#14652.
This property is used by the built-in OSC and some third-party OSC scripts
to indicate the margin they occupy so that other scripts such as
console.lua can use this value to position UI elements.
Currently user-data/osc is used for interpolation between the osc and
other internal scripts. Reserve this sub-path and also user-data/mpv
to make sure external scripts can only use these values as directed.
New internal uses of user-data should use user-data/mpv instead.
It won't be TA allocated and would fail on header check. Also
documentation doesn't mention that ownership is transfered to mpv, so it
is unexpected.
This will cause existing clients of this API leak this memory, but I
doubt anyone really used it in this broken state.
Fixes: #14633
This makes --input-ipc-client work on Windows.
To use this feature, a parent process needs to create a connected named pipe,
wrap the server handle in a CRT fd, and then spawn mpv as a child process
with the fd as the --input-ipc-client parameter.
The process can then communicate through the client handle.
The named pipe must be created duplex with overlapped IO and inheritable
handles.
Attempting to install `git` on the `pacboy` line fails with
`error: target not found: mingw-w64-clang-x86_64-git`
so move that to another spot.
`video_mp_image_pool.c` fails to build due to libavutil right now
because of missing vulkan headers so install those with `pacboy`.
(also improved in https://github.com/mpv-player/mpv/pull/14610 )
Simplify package lists since pacboy doesn't require `:p` anymore.
Follow up to the previous commit. Stop decreasing --ab-loop-count=N on
each iteration so it is preserved across different loops. In particular
it is preserved between different files without adding it to
--reset-on-next-file. Add a property to expose the remaning A-B loop
count instead.
The current behavior of --ab-loop-count=N is even worse than --loop-file
since it also doesn't reset when defining a new A-B loop in the same
file. Defining it has no effect after --ab-loop-count has decreased to
0, and this can't be fixed by adding it to --reset-on-next-file. This
commit also resets remaining-ab-loops every time --ab-loop-a and
--ab-loop-b are set to fix this.
ARGB is in fact _not_ like web color. It's easy to skim over the
actual hexadecimal provided in the next sentence and just assume mpv
understands RGBA after reading the words "web colors"
The current documentation of sub-scale-by-window and sub-scale-with-window
doesn't sufficiently convey what these options do exactly. Specifically,
the described effects of disabling one option is only true when the other
option is not disabled. The "clarification" of sub-scale-with-window option
only adds more confusion, when the effect of that option is already told
in more detail before (it scaled with window instead of video).
Clarify this by listing the effects of all combinations of these options.
These have been deprecated for 9 years so it's fine to remove them.
Using the replacement properties like video-bitrate in stats.lua will
convert big enough bitrates to Mbps.
This follows up 96e1f1dfa5 which converted --gpu-context, and has the
same advantages as listed there.
Unlike with --gpu-context auto can be used anywhere in the list, e.g.
--gpu-api=d3d11,auto works.
I wanted to use the list of GPU contexts as the description in
get_type_desc(), but there is no talloc context to allocate it to, so I
set a print_help_list to print them. The APIs go before the contexts so
that etc/_mpv.zsh doesn't try to complete the contexts.
Mainly for debugging. It might be handy to disable presentation feedback
on wayland to make sure something isn't going wrong with the
calculations somewhere.
These were all deprecated in mpv 0.37.0 or earlier and are not
considered common enough options to warrant keeping the deprecated
mapping longer. Since demux_cue had only a single option in it, the
entire option substract is removed. This can be readded later if someone
wants to introduce a specific option to it again.
Since 995c47da9a, setting --mute=auto has
been equivalent to --mute=no. It was formally documented later in
79e20ff485. This is an old legacy relic
and the auto choice popping up during auto completion could be confusing
to users who aren't aware of the history. Remove it for good and convert
the option to a proper boolean.
Since 7fc4bac29f, playback-time and
time-pos will now always have exactly the same values. Both properties
are commonly used, so just make playback-time an alias for
time-pos and document it.
Limit list entries to 100. obj_settings_list is not designed to hold
more items, and it quickly starts taking ages to add all items. 100 is
more than enough.
Fixes 30s timeout on OSS-Fuzz and generally fixes possible DoS on mpv.
VapourSynth introduced their version 4 API in R55, 3 years ago. mpv is
still using the deprecated version 3. I think it is good to migrate
before VapourSynth completely removes it.
The most impacted area is the video format. Previously we have a fixed
table of supported formats, each represented by an integer. In v4, the
integer is replaced by pointer to the full struct of the format.
Second, the way to create video filter is changed. Previously caller
needs to supply a "initialization" callback to `createFilter()`, which
sets up video info etc. In v4, video info is prepared first, passed to
the `createVideoFilter2()` and we get back the node.
Also, previously mpv was using the `fmSerial` filter mode, which means
VapourSynth 1) can only request one frame from mpv at a time, and 2) the
order of frames requested must be sequential. I propose to change it to
the parallel request mode, which requests multiple frames at a time in
semi random order. The reasons are, for 1), the get frame function,
`infiltGetFrame()`, unlocks the mutex during output image generation,
thus can benefit from parallel requests. For 2) thanks to the frame
buffer, unordered frame requests are acceptable. Just make sure the
buffer is large enough.
Third, the way VapourSynth scripting environment works change. In v4,
the scripting API is operated through struct pointer, much like the
exist `vsapi` pointer. The "finalize" function is also no longer needed.
This adds file tags to display along with the title, including
album/artist etc. for music, and series etc. for some videos.
The list of tags to display is identical to the tags printed to
the terminal and is controlled by the --display-tags option.
To filter out overlength tags (such as long comments and lyrics) and
files with too many tags, add file_tag_max_length and file_tag_max_count
options so that tags longer than this length are not displayed, and only
the first few tags are displayed.
Also makes tags show on page 5 only.
OSC rendering used to be smooth (up to OSD rendering fps) before
48f906249e, but after that commit the
frame duration is hardcoded to 30 ms. This is too high and results in
choppy OSC rendering, which is very noticeable with the progress bar
while moving mouse over it or playing a short 60 fps video.
This makes the duration an option so that it can be decreased to make
OSC rendering smoother.
Currently the vapoursynth video filter does not accept any argument for
passing arbitrary user data. This limits what the VS script can do.
Ideally, the vapoursynth filter has an user-data parameter that contain
string value. mpv passes that value to the VS script just like
container_fps and others. Once the VS script gets the data, it can do
all sorts of data extraction and transformation.
Another benefit is that instead of mpv always have to catch up to user
needs for this filter, with this users can just pass whatever needed
themselves, thus becomes more future-proof.
Fixes#14214
Allow configuring whether to print the media-title, the filename or both
(as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist
and in the playlist selector.
Showing only titles hides information when files are badly tagged, or
when it hides the track numbers of album songs. But showing filenames is
not as useful as titles e.g. when playing URLs with media titles. This
option lets the user choose which one to show, or show both if switching
is inconvenient.
The OSC's playlist_media_title script-opt is removed because this option
is better since it works everywhere after configuring it once.
Closes#11653.
Also show the full URLs of playlist entries instead of their basenames
in osc.lua and select.lua, consistently with mp_property_playlist().
For simplicity, this just checks if entries contain :// instead of
replicating all of mp_is_url().
Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
Currently the documentation for building on Windows, specifically the
"Native Compilation with Clang (Windows SDK Build)" route, could use a
few minor improvement to make the development onboarding experience more
smoothly.
Fixes#14214
There is a subtle behavior difference for built-in/input.conf key bindings
and key bindings registered by scripts: when a key binding is canceled
(e.g. a mouse button is bound to a command, is pressed down, and then
another key is pressed which is bound to another command), the command is
not invoked if the binding is built-in/input.conf, but is invoked if it's
registered by scripts, because it's handled with a different mechanism,
which gives no way for scripts to detect this.
Fix this by using the newly available canceled flag to detect this.
If a key binding is canceled, the callback is now not invoked unless
the key binding is registered with the complex option. In this situation,
the callback is invoked with the canceled state available so that scripts
can detect and handle this situation.
General update. Removed MXE as it is not supported, doesn't support
libplacebo and in general it doesn't do anything useful which native
Meson cannot do already.
This adds the --input-builtin-dragging option, which allows the built-in
dragging behavior to be disabled. This allows scripts to implement custom
dragging behavior with left button down events and begin-vo-dragging
command, which could only be done for other mouse buttons before.
This recommends querying the value of this option when drawing UI elements.
This allows a greater level of consistency by using a single flag which
already controls the scaling behavior of the OSD to control the behavior
of all scripts.
Also fix a capitalization nearby.
The default values for --ao, --vo, --gpu-api, --gpu-context change from
time to time, but some libmpv clients rely on the existing autoprobe order
and breaks as a result when the value changes. This specifies that the
default autoprobe order should not be relied upon.
Currently there is no policy on what should be done when an immediate,
severe breakage happens for "important/often used parts", which can cause
serious concerns especially if such changes remain obscured.
This adds a provision for this kind of incompatible changes under
"extraordinary circumstances", which allows for the breaking change to happen
if there is a critical reason to do so. Such changes must be extensively
documented, and should be avoided as much as possible.
Currently incompatible changes are not clearly outlined in the related
documentations, such as interface-changes.rst. The impacts and suggested
actions to address the compatibility concerns also rarely exist.
This adds a requirement to include these information for incompatible
changes, so that such changes are clearly conveyed to the users, with
suggested actions to minimize the impacts of such changes.
This adds script messages to select playlist entries, tracks, chapters,
subtitle lines, bindings and properties using the newly introduced
mp.input.select().
This fully closes#13964.
When you select an item, due to the submit handler being called
asynchronously, the default item list is redrawn before the console
closes, which is jarring. Fix this by always closing the console as soon
as enter is pressed, as keeping it open is unlikely to be useful with a
fuzzy selector (unlike with input.get() where it can be used e.g. to
implement a Lua REPL). If desired we can later add a close_on_submit
flag defaulting to true.
Also fix a crash when pressing enter without any match.
This is unused since 4e013afd37 because the mpv logo and the "Drop files
or URLs to play here." message are shown instead of the OSC controls. It
has the adverse affect of making the OSC twice as big when playing
videos with --lavfi-complex, because that makes the video property which
osc.lua checks unavailable.
This allows scripts to make the user choose from a list of entries by
typing part of their text and/or by navigating them with keybindings,
like dmenu or fzf.
Closes#13964.
by default utilises the color space of the screen on which the window is
located. if a specific value is defined, it will instead be utilised.
depending on the chosen color space the macOS EDR (HDR) support is
activated and that OS's transformation (tone mapping) is used.
Fixes#7341
For platforms which send emulated mouse inputs for touch-unaware clients,
such as Win32 and X11, this option enables the native multitouch handling
and disables emulated mouse inputs. This enables interested scripts to
handle multitouch events while keeping compatibility with touch-unaware
scripts.
This adds --input-touch-emulate-mouse option, which controls whether to
enable legacy touch handling where touch inputs are emulated as mouse
inputs. This establishes a primary touch point (the one with the lowest
index) as the emulated mouse position, and MBTN_LEFT up/down with the
appearance of the first touch point and the disappearance of the last
touch point.
This fixes some problems with touch handling on Wayland, for example
attempting to pinch results in a double click.
This adds touch-pos property, which contains the information of all
current touch points. The property has sub properties:
touch-pos/count: the number of current touch points
touch-pos/N/x,y: the position of touch point N
touch-pos/N/id: unique identifier of the touch point
the Screen property localizedName returns a none unique dynamic name
that doesn't allow a specific selection of a Screen on every OS boot.
the name consists of the vendor name and model name (eg DELL U2723QE).
if the same model display is connected to the system several times,
macOS starts to add numbers to the localizedName (eg DELL U2723QE (1)),
that may not be associated to the same Screen on every OS boot or
connecting the display. it also changes the name of the first connected
display by adding that numeration. this makes it impossible specify the
proper screen with the screen-name option every time.
to circumvent this we remove the enumeration from the name and instead
add the serial number to the display-names property. this makes the
actual Screen unique and none dynamic. furthermore the selection of a
screen by name will check for equality for the old localizedName, simple
name without enumeration, serial number and the combined name with
serial number. this makes it possible to select the screen by either of
those names and identifiers, and keeps backwards compatibility with the
old behaviour.
Examples:
localized name (System Settings name): DELL U2723QE, DELL U2723QE (1)
simple name: DELL U2723QE
serial number: 123456789
combined name: DELL U2723QE (123456789)
Currently they refer to the OSC documentation. However,
the "mp.options functions" already documents that, is more detailed,
and does not contain false statements like "there may be no spaces around
the ``=`` or anywhere else" (the primitive parser does not care about
them, so starting a string option value with spaces is perfectly fine).
Change them to refer to "mp.options functions" and remove the redundant
section in the OSC documentation.
This allows users to set buffer duration in exclusive mode. We have
been using the default device period as the buffer size and it is
robust enough in most cases. However, on some devices there are
horrible glitches after a stream reset. Unfortunately, the issue is not
consistently reproducible, but using a smaller buffer size (e.g., the
minimum device period) seems to resolve the problem.
Fixes#13715.
This option type is not used only by filter options: they're already
used by --ao, --vo, and --gpu-context. Replace the mentions of
"filter" to "item" instead, and changes some languages to improve clarity.
Also change the documentation on "Filter options" to describe what it
really is, and fix a typo.
This gives these properties the "time" type, which allows them to be pretty-printed as HH:MM:SS easily (but also still allows raw formatting using e.g. ${=sub-start}).
This lets you press / in page 4 of the stats and type a keybinding or
part of its command to filter it by using mp.input.
This works badly without a VO because both stats.lua and console.lua use
show-text and only one can be displayed at a time, but it's still better
than not having the search available at all.
Enable ASS_FEATURE_{WHOLE_TEXT_LAYOUT, BIDI_BRACKETS} and auto base
detection by default, and add an option to disable this if needed.
This is strictly an improvement for webvtt files as they always use
auto base detection. This _fixes_ right-to-left text rendering for
webvtt files which correctly mark rtl/ltr. Webvtt files obtained from
sources which sideload the RTL information through css also see an
improvement due to the auto detection.
Generally SRT files also want this, but some are also written to
workaround VSFilter quirks.
See also: https://github.com/mpv-player/mpv/pull/12985#issuecomment-1839565138
Avoid having to configure both the OSD and the stats script opts when
you change the OSD options, in particular avoid having to convert colors
to BGR.
Also document the shadow options.
font_size, border_size and shadow offset defaults are kept because the
same values look much bigger in the stats than in the corresponding OSD
options.
osd-back-color is now respected without extra checks until you
explicitly set a shadow_color.
Showing media titles in the playlist is pointless when sources are ill
tagged and media titles contain only garbage. Being able to opt for
file names at least gives us a choice in such cases.
Turns out that adding more medatata like HDR10+ and Dolby Vision would
produce a lot of duplication and it is better to centralize it around
the track-list property.
Fixes: e720159f72
Adds support for extracting codec profile. Old properties are redirected
to new one and removed from docs. Likely will stay like that forever as
there is no reason to remove them.
As a effect of unification of properties between audio and video,
video-codec will now print codec (format) descriptive name, not decoder
long name as it were before. In practice this change fixes what docs
says. If you really need decoder name, use the `track-list/N/decoder-desc`.
Probing for hwdec can be very slow: on my setup (Nvidia GPU without
VP9 hwdec capability), this causes 2x hot cache startup time compared
to explicitly disabling VP9 in this list (500 ms -> 1 000 ms).
Also remove --vo=vdpau reference.
In many places, flags options have duplicate descriptions like
--break-player and --no-break-player. This is redundant since the
equivalence of this syntax to --break-player=<yes|no> is already
documented, and the =<yes|no> syntax is more in line with the syntax
of other option types.
This replaces all usage of --no-foobar with --foobar=no, and use
--foobar=<yes|no> when possible.
As far as I can tell PulseAudio introduced a bug in 16.0
where if a stream is (un)paused too often the reported latency
will momentarily spike by 3000% or more. Apparently in certain cases
just pausing once and waiting can also cause this.
Save the remaining users of PA the trouble of debugging the various
obscure issues that can arise from this (desync is a harmless example)
by enabling the latency hack code again.
ref: <https://github.com/mpv-player/mpv/issues/12057>
<https://github.com/mpv-player/mpv/issues/10333>
Basically a simple way to perform any command/property action from the
command line. This takes the exact same syntax as input.conf but not
including the key naturally. Potentially useful for weird properties
that don't map well to options (like ao-volume). Fixes#12353.
This enhancement makes it easier to create constant width property
expansions, useful for the `--term-status-msg`. Additionally, it changes
to `%f` printing with manual zero trimming, which is easier to control
than `%g`. With this method, we can directly specify precision, not just
significant numbers. This approach also avoids overly high precision for
values less than 1, which is not necessary for a generic floating-point
print function.
A new print helper function is added, which can be used with adjusted
precision for specific cases where a different default is needed. This
also unifies the code slightly.
Escape all messages in osc.lua, because other than the title they
weren't being escaped at all. If for example you did mpv foo.mp4
'{\fs50}bar.mp4' and script-message osc-playlist, it would just render
the second entry as bar.mp4 in big text.
The title was escaped partially, now the escaping is complete because:
- It escapes \. Backslashes at the end of the title are escaped instead
of being stripped, and \n, \N and \h are now printed verbatim. In
particular, "\\n" is no longer converted to space and is printed
verbatim instead which is more correct.
- Newlines ("\n", not the "\\n" escape sequence) are converted to spaces
instead of rendering them and messing up the text positioning within
the OSC.
- Spaces at the start are preserved.
Fixes#11209, fixes#11275.
This adds a command to escape ASS tags to remove code duplication
between sub/osd_libass.c, console.lua, osc.lua, stats.lua and any user
script that calls mp.create_osd_overlay().
A command is used instead of scripting functions so that all clients can
use this and not just use Lua and JS ones.
osd_mangle_ass() also interprets osd-sym-cc and osd-ass-cc/{0,1}, but
since they use invalid UTF-8 characters there is no risk of escape-ass
users using them by accident, like with any OSD message.
Always replacing \n with \\N in mangle_ass() even when it is not called
by escape-ass doesn't seem to cause any issue, but I made it conditional
anyway to avoid changing how all OSD messages are treated unnecessarily.
There was no way for scripts to know the current size of the terminal,
which is essintial if they want to provide a good user experience even
without a window.
The terminal is assumed to be 80x24 in size, the new options
`term_width_limit` and `term_height_limit` can be used to overwrite
that.
Lines longer then the terminal width cause problems with scrolling
pages and need to be shortened.
The algorithm used for shortening can deal with tabs and escape
sequences, has rudimentary support for UTF-8 and runs in O(n).
avih helped in the creation of the term_ellipsis() function and split()
is also from him.
Manually editing interface-changes.rst is a giant maintenance pain that
causes merge conflicts all the time. Stop doing that nonsense and
instead have changes be written to files in DOCS/interface-changes. Also
remove that one sentence in changes.rst because it's just not true.
Debanding is an inherently destructive process. It is not needed for
most high-quality sources and only produces an adverse smoothing effect
when applied to fine-detailed content, removing detail. It should only
be applied when necessary, either manually with the `b` keybind or with
an automatic profile.
Additionally, it is quite computationally heavy with no real benefit for
high-quality content.
By default, and especially in the high-quality profile, mpv should
preserve source detail and quality as much as possible. Additional
processing should be opt-in.
Fixes the issue described in https://github.com/mpv-player/mpv/issues/11862
for SDR files for non-d3d11 gpu-api. We currently don't have a smarter
way to get the real on-the-wire bpc for other APIs, so this is the best
that can be done.
Clarify that --autofit-larger sets the maximum size of the window.
The original wording was not written with runtime change in mind,
so the implication of "not changing size" is ambiguous.
As the first aligned format this required a fix to reconfig().
Adding the other component-swapped formats in this group would be trivial
but I checked the DRM database [1] and no driver exists that supports
one of those but not YUYV and this is quite fringe as-is, so I opted not to.
[1] <https://drmdb.emersion.fr/formats>
76276c9210 introduced a generic filtering
framework which replaced the separate video and audio filter chains.
Additionally, 6d36fad83c and
76e7e78ce9 made the decoder wrappers
a filter.
Add a new section to document this, and corrrect the outdated
audio/video decoder and filter info.
replaces the old focus-on-open option with a more generic focus-on
options that can be extended.
adjust the only platform that uses that option.
Fixes#8337
Some incorrect syntax is used in DOCS/man/input.rst with c678033c1d
causing failure of PDF manual generation with rst2pdf. There are single
rather than double back-ticks for insert-at and insert-at-play so this
is fixed and a couple of typos are also corrected with this commit.