Commit Graph

12004 Commits

Author SHA1 Message Date
sfan5 00942d56ba command: support passing scale to `keypress` 2023-12-17 18:36:16 +01:00
Dudemanguy ace2d6506f DOCS/options: fix documentation for replaygain-clip
f1c4d20e65 added this option, but the
documentation is actually backwards. --replaygain-clip allows clipping.
Having it disabled, the default, prevents it. Keep the behavior the
same, but change the documentation to reflect reality. Closes #13111.
2023-12-16 11:14:47 +01:00
der richter c661435648 mac: add support for drag-and-drop option 2023-12-15 16:59:52 +01:00
Guido Cella b09deda37a console.lua: implement case-insensitive completion
This is useful for completing files and more rarely for profiles. It
will also be useful to third-party scripts interacting with the console
once the API to do it is merged.
2023-12-15 15:44:48 +00:00
karelrooted 3250f6e447 options: add --secondary-sub-pos
The default value is 0 (on the top of the screen)
2023-12-13 21:18:57 +00:00
Niklas Haas b690531f30 Revert "OSC: Remove merriment"
This reverts commit af2635d8c9, and
restores feature parity with VLC.
2023-12-13 19:29:39 +01:00
Mia Herkt af2635d8c9
OSC: Remove merriment
I honestly don’t care either way but I also don’t believe this innocent
and cute hat is worth repeatedly having people show up on the issue
tracker to aggressively virtue signal and then shit-talk the project
elsewhere when their “concerns” are ignored and made fun of.
For the record, I approve of neither brand of childish nonsense.

If your workflow depends on December festivities, feel free to use an
alternative OSC implementation.

Fixes #13082 and #9548
2023-12-13 18:06:22 +01:00
Dudemanguy 443c2487d7 filter_sdh: add full width parentheses to the enclosures string
Since these are technically parentheses, we'll treat them the same way
as normal parenthesis. Fixes #11155.
2023-12-08 18:14:06 +00:00
Dudemanguy ce958b7742 filter_sdh: add --sub-filter-sdh-enclosures option
This filter is a bit complicated, but one of the essential parts of it
is removing text enclosed by particular set of characters (e.g. text
inbetween []). This was previously hardcoded to only take into account
parenthesis and brackets, but people may want to filter more things so
make this customizable. The option only takes "left hand characters" so
the right pair is mapped internally if applicable. If not, then we just
use the same character. Fixes #8268 since the unicode character in
question can just be passed to this option.
2023-12-08 18:14:06 +00:00
Graham Booker 4754bd54c7 player/command: add ability to scale overlay 2023-12-08 13:37:26 +01:00
Guido Cella f886eb5678 console.lua: cycle through completions 2023-12-06 19:06:58 +00:00
Christoph Heinrich c16f868dd7 console: automatically determine the font_hw_ratio
A simplified version of the text width estimation code from uosc.

An osd_overlay is created with compute_bounds=true for measuring the
width of the lower case alphabet at what's estimated to be the largest
font size possible without clipping.

The lower case alphabet was chosen to get decent results for proportional
fonts, even if they aren't officially supported.
2023-12-06 19:06:41 +00:00
nanahi 21bd301372 DOCS/interface-changes: document renaming of MP_KEY_BACK
The navigation key is renamed to avoid conflict with MP_KEY_FORWARD.
2023-12-06 11:07:37 +01:00
Kacper Michajłow 06e627048f image_writer: default to lossless AVIF screenshots
Also change the example to crf=23. crf=32 is pretty bad quality, don't
give users bad usage ideas.
2023-12-04 20:34:17 +01:00
Kacper Michajłow 4949cab734 image_writer: use common format selection for AVIF screenshots
--screenshot-avif-pixfmt no longer defaults to yuv420p.
2023-12-04 20:34:17 +01:00
sfan5 1b035402a6 DOCS/options: clarify --spirv-compiler 2023-11-27 18:24:55 +01:00
Guido Cella 0c4812aa72 options: add --osd-bar-border-size
Closes #1484. The default size is smaller than the previous
--osd-border-size default value of 3 with the default --osd-bar-h.
2023-11-27 15:02:28 +00:00
Guido Cella 65b5543332 DOCS/mpv: quotes in mpv.conf don't escape backslash
I don't know why I thought they did in 7798881360, but single quotes
disable escape sequences only in input.conf commands.
2023-11-27 11:20:51 +01:00
Ripose dea512ea38 options: add secondary-sub-delay
Add --secondary-sub-delay option and decouple --sub-delay from secondary
subtitles. This produces desirable behavior in most cases as secondary
and primary subtitles tracks tend to be timed independently of one
another.

This feature is implemented by turning the sub_delay field in
mp_subtitle_opts into an array of 2 floats. From here the track index is
either passed around or derived when sub_delay is needed. There are some
cases in dec_sub.c where it is possible for dec_sub.order (equivalent to
track index) to be -1. In these cases, sub_delay is inferred as 0.
2023-11-26 23:22:05 +01:00
der richter 6898d57d98 DOCS/options: remove the mention of cocoa and its removed backend
the cocoa backend was removed and all functionality is either available
on all macOS backends or explicitly only with cocoa-cb. the manual
should properly reflect that change.

also remove the last mention of the old cocoa backend.
2023-11-25 19:31:26 +01:00
Dudemanguy 86b498ecc0 player: remove shared-script-properties property
This property was never encouraged. The manual even stated that "You
should avoid using it, unless you absolutely have to." Since we now have
user-data which is superior in every single way and replaces this,
delete this property. The manual also has threatened people for years
with the line "It's a makeshift solution which could go away any time
(for example, when a better solution becomes available)." We were nice
and deprecated it in 1d00aee8e1 for a
while to give script authors some time to update. Let's remove it for
good now.
2023-11-22 16:29:43 +00:00
Kacper Michajłow 67deebc5b5 vaapi: add support for vaapi-win32
Only vaapi-copy variant as nothing can map D3D12 resources currently.

And even if we would add resource sharing to D3D11 it would invoke copy
at some point, so there is no point really. Maybe in the future when
libplacebo get smarter about resource sharing on Windows, but practical
advantages are really small. I've tested it with Vulkan <-> D3D11
sharing and GPU <-> GPU copy is still invoked. Better than CPU memcpy,
something for the future.
2023-11-22 11:43:20 +01:00
sfan5 818ce7c51a
Release 0.37.0 2023-11-21 19:47:46 +01:00
Niklas Haas 8faa0abae8 DOCS/options: admonish users for touching --3dlut-size
The "auto" logic is vastly better than setting a specific size. This
option amounts to "allow users to shoot themselves in the foot" flag,
given that the vast majority of ICC profiles in the wild are fine on
17x17x17 or even smaller 3DLUTs.

Setting stupidly high --3dlut-size is the main source of ICC-related
slow startup issues, and there is absolutely no conceivably benefit to
going above the defaults except for pixel peeping and chasing tiny PSNR
increments.
2023-11-20 17:32:40 +01:00
Niklas Haas 47eae92c46 DOCS/options: reword cache options
D3D11 is actually the main platform that suffers from slow shader
compilation, typical Vulkan/GL drivers are either very fast to begin
with, or already internally cache.
2023-11-20 17:32:40 +01:00
nanahi feae35e15d DOCS: properly document --force-window-position for sdl vo
The behavior is also the case for SDL vo, so document it.
2023-11-18 20:58:31 +00:00
nanahi 4ab4a88889 command: export storage aspect ratio (sar) properties
Display aspect ratio (aspect) and pixel aspect ratio (par) are already
exported, but storage aspect ratio (sar) isn't. This value is needed to
display the storage aspect ratio for non-square pixel sources in stats.lua.

This exports two new properties: video-params/sar and video-params/sar-name.
Docmentation is updated accordingly.
2023-11-14 15:00:23 +00:00
Kacper Michajłow ad02db8cee DOCS/options: update watch-later-options docs 2023-11-12 21:25:22 +00:00
Kacper Michajłow e669493e6e options: add more properties to default watch-later-options
Adds:
--secondary-sub-visibility
--video-aspect-method
--video-unscaled
--video-pan-x
--video-pan-y
--video-rotate
--video-crop
--video-zoom
--video-scale-x
--video-scale-y
--video-align-x
--video-align-y

Those properties are related to playback state and are likely expected
to be restored when resuming playback.
2023-11-12 21:25:22 +00:00
Kacper Michajłow cb30c497c2 options: remove not relevant props from default watch-later-options
Removes:
--border
--fullscreen
--ontop
--osd-level
--pause

Those options are not really content related. I don't see much gain to
save them per each watch later entry.
2023-11-12 21:25:22 +00:00
Guido Cella 2ba75a0ffc DOCS/options: osd-shadow is ignored with osd-back-color
The back color overrides the shadow, not the border.
2023-11-12 17:16:13 +00:00
der richter fc4db187d0 cocoa: remove OpenGL cocoa backend
the OpenGL cocoa backend was deprecated in 0.29, it has lot of bugs, is
completely unmaintained and can't properly playback anything anymore on
the newest macOS. it is time to remove it.
2023-11-10 14:54:37 +01:00
der richter a54cc02341 mac: change display name retrieval to localizedName NSScreen property
the old displayName property via the IODisplay API is not working
anymore on ARM based macs and was broken in at least one other case.

instead we use the new localizedName property introduced in 10.15 of the
NSScreen. we don't need any backwards compatibility since 10.15 is the
oldest version we support now.

configs and scripts that use the options and properties fs-screen-name,
screen-name or display-names need to be adjusted since the names could
differ from the previous implementation via the IODisplay API.

Fixes #9697
2023-11-10 14:30:32 +01:00
Dudemanguy f67478f8b2 DOSC/input: clarify a couple of commands where no-osd has no effect
This should be the intuitive expectation, but it's worth noting the
deviation.
2023-11-09 21:32:35 +00:00
Dudemanguy 468b9bede7 DOCS/option: discourage the use of video-latency-hacks a bit more
Who knows why this exists but maybe it's possibly useful in some obscure
case. Probably worth mentioning that it could break other options.
2023-11-08 00:11:34 +00:00
Niklas Haas 293fe9d74a vo_gpu_next: add --target-gamut option
Fixes: https://github.com/mpv-player/mpv/issues/12777
2023-11-08 00:55:39 +01:00
Mohammad AlSaleh d470766000 sub: add --sub-stretch-durations option
Stretch a subtitle duration so it ends when the next one starts.
 Should help with subtitles which erroneously have zero durations.

 I found such a subrip substitles stream in the wild.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2023-11-07 20:46:40 +00:00
Christoph Heinrich bd4bf6e383 DOCS/mpv: consistent formatting of keybindings 2023-11-07 00:43:38 +00:00
Christoph Heinrich d3355679b3 DOCS/console: correct capitalization of keybindings 2023-11-07 00:43:38 +00:00
Dudemanguy f4c5fa12cb wayland: improve wl_output guessing before mpv window is mapped
There's some geometry-related things that mpv has to calculate before
the window is actually mapped onto the screen in wayland. But there's no
way to know which output the window will end up on before it happens, so
it's possible to calculate it using the wrong values. mpv corrects
itself later when the surface event happens, but making the initial
guess work better can help in certain cases.

find_output is the only thing that needs to be changed here. Its main
purpose is to grab the right output based on user settings when we're
trying to full screen and giving a fallback in case we don't have
wl->current_output yet. The x11 code already does something similar, so
we're basically just copying it. Allow user settings like --screen and
--screen-name to influence the initial wl_output guess. Those options
won't actually place the window on that specific screen since we can't
do that in wayland, but if the user knows where the window will end up
beforehand it makes sense to listen to the arguments they pass. If
something goes wrong, then we just fallback to 0 like before.
2023-11-06 23:13:31 +00:00
Guido Cella 7d004bf15c DOCS/input: stop documenting vf del
Because b56e63e2a9 removed it.
2023-11-06 16:33:57 +00:00
Kacper Michajłow 38da5b89c2 player/command: remove hdr-metadata property
It is now included in video-out-params and was never released in stable
version, so we can safely remove it.
2023-11-05 18:57:36 +01:00
Kacper Michajłow 1174afcccc csputils: add pl_hdr_metadata to mp_colorspace and deprecate sig_peak
Note this commit does not change all uses of sig-peak, this is for
future refactoring.
2023-11-05 18:57:36 +01:00
Kacper Michajłow 174df99ffa ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
Guido Cella 0147467e3a DOCS/man/console: update type examples 2023-11-02 16:03:38 +00:00
NRK 3789f1a387 demux: make hysteresis-secs respect cache-secs
currently hysteresis-secs only works when the demuxer-max-bytes fills
up. but it's possible for the cache-secs/demuxer-readahead-secs to be
reached first.

in those cases, hysteresis-secs doesn't work and keeps buffering
non-stop. but the goal of this option was to save power by avoiding
non-stop buffering so go ahead and make it respect cache-secs as well.

additionally remove some redundant repetition from the docs.
2023-10-30 17:16:38 +00:00
Dudemanguy b56e63e2a9 m_option: drop support for -del for list options
5f74ed5828 deprecated this many years ago.
The utility is questionable at best given that -remove exists and is
more natural to use. Free up some code and drop it.
2023-10-30 16:47:44 +00:00
Dudemanguy 991e2a599c options: make --screenshot-directory/--watch-later-directory aliases
By popular demand I guess.
2023-10-30 16:46:32 +00:00
Christoph Heinrich 045f4a7315 ytdl_hook: add thumbnail option
Opening speed could be improved with the "async" prefix, but then the
tracks would be out of order.
2023-10-30 16:46:17 +00:00
Guido Cella 040622f6b7 various: remove trailing whitespace 2023-10-30 16:45:47 +00:00
llyyr 78f1cedd0c DOCS/options: clarify `no-config` is a command line flag
This option does nothing when put inside config files.
2023-10-27 11:19:32 +02:00
Dudemanguy b9c42755a7 javascript: use --js-memory-report option instead of MPV_LEAK_REPORT
The MPV_LEAK_REPORT environment variable was previously read in order to
determine whether or not to enable memory reporting for javascript
scripts. This is kind of weird and deviates from the norm of exposing an
option to the user. So let's just add --js-memory-report and disable it
by default instead.
2023-10-26 16:49:56 +00:00
Dudemanguy 2783d5a51a options: rename --play-dir to --play-direction
--play-dir sounds like it has something to do with directories so change
it. The play_dir variable is used a bunch everywhere internally so
whatever just leave it alone instead of renaming that.
2023-10-25 16:16:37 +00:00
Dudemanguy 36de0d784f options: rename --watch-later-directory to --watch-later-dir
Same logic as the previous commit.
2023-10-25 16:16:37 +00:00
Dudemanguy 1370ecfc1b options: rename --screenshot-directory to --screenshot-dir
Less characters is better? Other options use -dir for directory so
consistency I guess.
2023-10-25 16:16:37 +00:00
Dudemanguy b626f3ba83 options: rename --sub-ass-force-style to --sub-ass-style-overrides
This option has exactly the same semantics are other mpv options that
override a particular thing with something from the user. So instead of
the "force-style" name, use "-overrides" which is more consistent.
The plural form is used since it's a list option.
2023-10-25 16:16:37 +00:00
Dudemanguy 9924102c66 options: rename --override-display-fps to --display-fps-override
Other similar options are in the form of --foo-override not
--override-foo. The display-fps one was backwards so flip it around the
other way for consistency reasons.
2023-10-25 16:16:37 +00:00
Dudemanguy 7aed492ccc options: rename --fps to --container-fps-override
This better reflects what it actually does. As a bonus, script writers
won't be misled into thinking that fps displays the actual video or
display fps.
2023-10-25 16:16:37 +00:00
Kacper Michajłow 869faadc68 options: disable --allow-delayed-peak-detect by default
Peak detection greatly increases HDR experience. Performance hit of
non-delayed detection is not that significant and is in line with
current default settings.
2023-10-25 11:55:56 +02:00
Dudemanguy 7768c3d035 DOCS/contribute: increase hard column limit to 100
I'm guilty of violating this, but surely I can't be the only one. 85 is
pretty small and there's plenty of lines in the codebase that go well
over that. Surely nobody programs on tiny screens anymore and the kernel
raised the limit to 100 a few years ago so let's just copy that.
2023-10-22 14:31:36 +00:00
Dudemanguy 1382a854c9 stats.lua: disable tonemapping plot by default
Nobody except a chosen few (I'm not one of them) even knows what it
means. Multiple people thought it was actually some kind of rendering
bug. Just disable it by default. Closes #12671.
2023-10-22 13:34:56 +02:00
Dudemanguy 9ea9279cf4 DOCS/contribute: stop pretending that C11 isn't allowed
Doesn't really make much of a different in practice aside from us
dropping ancient legacy fallbacks but still.
2023-10-21 14:05:38 +00:00
NRK 2fa695c3f9 osdep: drop atomic fallback
even msvc (which mpv apparently doesn't support) supports C11 atomics
now. no need to carry around fallback with subtle semantic differences.
2023-10-20 21:31:09 +02:00
Dudemanguy 39247bd0b6 stream_cdda: deprecate --cdda-toc-bias and always check for offsets
I started going through the blame but once I got to mplayer commits from
20 years ago, I stopped bothering. This obscure option has always been
disabled by default, but there's zero reason, as far as I know, to not
just enable it today. Some CDs (particularly very old ones) have the
first sector shifted a bit and not starting exactly at 0. This makes the
logic that tries to get all the chapters completely fail and thus you
can't skip through tracks. However if you just enable this obscure
option, it just works. For anything that starts exactly at 0, the
calculated offset is just 0 anyway so it's a no-op and works exactly the
same. So basically, there's literally no reason to not just always try
to correct for the offset of the first sector by default.

Fixes #8777.
2023-10-19 12:10:53 -05:00
Guido Cella 4a46e4ee02 DOCS/options: remove obsolete notice
This may have been true 10 years ago but now reset-on-next-file can
definitely reset options that weren't explicitly set.
2023-10-17 15:01:19 +00:00
Guido Cella 98eab5b678 DOCS/mpv: fix typos in List Options 2023-10-17 15:00:56 +00:00
Guido Cella 16d9d3b273 DOCS/interface-changes: remove redundant change
directory-mode's default was changed again to auto afterwards.
2023-10-17 11:03:25 +02:00
Christoph Heinrich f5d4f2aea4 af_scaletempo2: better defaults
Why a bigger search-interval is required:

scaletempo2 doesn't do a good job when the signal contains frequencies
less then 1/search_interval. With a search interval of 30ms that means
anything below 33.333Hz sounds bad.

Depending on the genre it's very for music to contain frequencies down
to 30Hz, and sometimes even a little bit below that. Therefore a higher
default value is needed to handle such cases.

Based on that an argument can be made for a value of 50, as that should
work down to 20Hz, or something even higher because movies sometimes
have some infrasonic content.

However the downside of big search intervals is increased CPU usage and
intelligibility at higher speeds, as it effectively leads to parts of
the audio being skipped.

A value of 40 can handle frequencies down to 25Hz, enough for all music
except very rare edge cases, while still providing decent
intelligibility.

Why a smaller window-size is required:

Large values reduce intelligibility at high speeds and therefore small
values are preferred.

However when values get too small it starts to sound weird
(similar to librubberband).

In my testing a value of 10 already works well, but adding a small
safety margin seems like a good idea, especially since it made no
noticeable difference to intelligibility, which is why 12 was chosen.
2023-10-15 13:39:59 +00:00
der richter 78d43740f5 vo_gpu/vo_gpu_next: add vulkan support for macOS
add support for vulkan through metal and a translation layer like
MoltenVK. also add the possibility to use different render timing modes
for testing.

i still consider this experimental atm.
2023-10-14 18:39:56 +02:00
Kacper Michajłow 72536cce62 f_decoder_wrapper: change video-codec to show description or name
Not both of them. Formating it as `<name> (<desc>)` produced arguably
silly string like `hevc (HEVC (High Efficiency Video Coding))`. Unpack
this to show only description if available or name otherwise. Produces
way nicer results in stats.lua and similar places where this name is
printed.
2023-10-14 12:30:46 +02:00
Mike Will 5ac37500c5 defaults.lua: add a disabled parameter to timer constructors
Added to the functions `mp.add_timeout` and `mp.add_periodic_timer`.

If the `disabled` argument is set to `true` or a truthy value, the
timer will wait to be manually started with a call to its `resume()`
method.
2023-10-11 21:04:13 +00:00
Guido Cella 644cf01067 DOCS/options: vdpau requires GLX
Only vpdau-copy works with EGL. 2d1d815cc7 already added this to
manpage, and 1c8d2246bf removed it again, but that seems to be a mistake
because I can only get vdpau to work with GLX, and another user also
reported that only vdpau-copy was working for him with the default EGL.
2023-10-11 10:07:56 +02:00
Dudemanguy fcebee9080 libmpv: add mpv_time_ns()
9606c3fca9 added mp_time_ns(). Since we
apparently expose the mp_time_us() to clients already, there's no reason
to not also expose the new nanosecond one.
2023-10-10 19:10:55 +00:00
Guido Cella 2016e902e1 DOCS/lua: update read_options example
This still shows the old way of calling read_options even though it was
deprecated 8 years in ago 327b091909.
2023-10-10 18:38:15 +00:00
Guido Cella cf762c1482 console.lua: exit with with Ctrl+[
This binding commonly closes similar input buffers like vim's
Command-line mode and dmenu.
2023-10-10 18:18:07 +00:00
Guido Cella 81dea9031d command: add playlist-next-playlist and playlist-prev-playlist
playlist-prev-playlist goes to the beginning of the previous playlist
because this seems more useful and symmetrical to
playlist-next-playlist. It does not go to the beginning when the current
playlist-path starts with the previous playlist-path, e.g. with mpv
--loop-playlist foo/, which expands to foo/{1..9}.zip, the current
playlist path foo/1.zip beings with the playlist-path foo/ of {2..9}.zip
and thus playlist-prev-playlist goes to 9.zip rather than to 2.zip.

Closes #12495.
2023-10-09 15:09:35 +00:00
Guido Cella 76de65f116 DOCS/input: document the full sub-property 2023-10-07 22:46:16 +00:00
Christoph Heinrich ed8a919812 console: show completion suggestions as table
Completion suggestions are now nicely formatted into a table.
Maximum width of the table is estimated based on OSD size and
font size.
This requires a new scaling factor option `font_hw_ratio`.
A factor of 2.15 works great for me,
but the default is 2.0 to avoid problems with other fonts.
The space between columns is automatically adjusted to be
between 2 and 8 spaces.
It tries to use as few rows as possible.
2023-10-07 22:45:50 +00:00
Dudemanguy da4f11803f demux: change the default of metadata-codepage to auto
There's really no reason not to do this especially since sub-codepage
already defaults to auto. Also change logging in charset_conv since
telling us that the data is UTF-8 if the passed codepage value is "auto"
or "utf-8" is really not useful information (that's the expectation).
2023-10-07 02:41:27 +00:00
Dudemanguy 50b23a8c44 demux_cue: deprecate --demuxer-cue-codepage for --metadata-codepage
What are cue sheets not metadata or something? No reason this needs to
be a separate option so just deprecate it. This does mean that the
default value changes from "auto" to "utf-8" for this obscure fringe
case. I really hope people don't use non-UTF-8 cuesheets, but the next
commit will change the default of --metadata-codepage to "auto" so
there's no actual change in behavior to users.
2023-10-07 02:41:27 +00:00
Dudemanguy a96dd2f5e7 charset_conv: remove ancient warning about deprecated syntax
wm4 removed this in 4adfde5dd1 and left a
warning. Nobody needs to know that enca:pl used to work.
2023-10-07 02:41:27 +00:00
Christoph Heinrich ef4a510128 af_scaletempo: overlap is a factor not a percentage 2023-10-07 00:30:29 +00:00
Guido Cella 7798881360 DOCS/mpv: update mpv.conf's documentation 2023-10-06 18:28:55 +00:00
Ashyni d32f1aac3f af/vf-command: add ability to target a specific lavfi filter
fixes: #11180
2023-10-05 11:41:09 +02:00
Guido Cella ec80981c79 external_files: remove duplicate from cover art whitelist
I made a mistake in 0070a5820e here because there were 2 separate groups
of "front" filenames.
2023-10-04 15:31:38 +00:00
sfan5 df758880e2 path: don't override "cache" and "state" paths with configdir
This reverts commit 576e86bfa1 (functionally).

Right now, the --config-dir option silently causes all watch_later and cache
files to be written in the --config-dir as well. This is pretty uninitutive
and also not desirable in most cases so get rid of this.
libmpv users will have to set the corresponding options or env vars if they
want to keep the old behaviour.
2023-10-02 18:48:10 +02:00
Guido Cella 0070a5820e external_files: base cover-art-whitelist on cover-art-auto-exts
Combine the cover art whitelist with the extensions in
--cover-art-auto-exts instead of hardcoding them. This is shorter,
checks for more extensions, saves us from updating the whitelist
everytime we add a new image extension, and since the whitelist had
gotten so big and the priority is calculated as
MP_ARRAY_SIZE(cover_files) - n, files like cover.jpg were taking
priority over cover art loaded by --cover-art-auto=exact.
2023-10-01 19:32:45 +00:00
Dudemanguy c4c70d8efe DOCS/interface-changes: also mention --window-affinity
Added in 2c738ca54b. I guess we seem to
always mention any added option these days so might as well.
2023-10-01 12:52:35 -05:00
Kacper Michajłow d64201ce29 DOCS/interface-changes: mention --backdrop-type
Added in f19ada7b58
2023-10-01 17:05:34 +00:00
Christoph Heinrich e9690727a0 DOCS/lua: remove superfluous parameter
This seems to have been a leftover from copying the entry below it.
2023-09-30 15:17:10 +00:00
Dudemanguy 1d00aee8e1 command: deprecate shared-script-properties
user-data is simply better.
2023-09-27 14:04:59 +00:00
Guido Cella 3a2ebd616b DOCS/options: update lavfi-complex examples
Show how to stack 3 or more videos, and remove the life filter example
because it should be used with av://lavfi:life.
2023-09-27 14:04:07 +00:00
llyyr 2033a3c93e af_scaletempo2: raise max playback rate to 8.0
4.0 was too low and copied from Chromium defaults when the filter was
initially written, there's no good reason for it to be so low, so
double it.
2023-09-27 14:03:30 +00:00
llyyr a238afdbc5 DOCS/options: add example for custom pitch correction filter 2023-09-27 14:03:30 +00:00
Guido Cella a4a5fd890f DOCS/mpv: update the wheel bindings
Update the docs to the new bindings set by 981a9372ff.
2023-09-27 14:02:39 +00:00
DeadSix f19ada7b58 win32: add option to change backdrop style 2023-09-27 14:02:08 +00:00
Niklas Haas b4260bef73 DOCS/options: update libplacebo-opts documentation URL 2023-09-26 13:03:48 +02:00
llyyr 90e0828b99 input.conf: make `u` toggle between force and yes
There was a discrepancy in what the keybind was advertised to do in the
manual, and what the comment in input.conf described it to be doing. It
makes very little sense to add a keybind that changes the default and
doesn't allow you to get back to the default. This keybind is much more
useful if it toggles between yes/force instead of no/force.
2023-09-25 20:41:27 +00:00
Guido Cella bc99731526 DOCS/input: update aegisub URL 2023-09-25 20:41:13 +00:00
Niklas Haas 44cf6288c7 vo_gpu: remove --scaler-lut-size
Pointless bloat option, hard-coded as 256 now in libplacebo and no
reason not to also hard-code in mpv.

See-Also: haasn/libplacebo@64d7c5aab0
2023-09-25 12:45:17 +02:00
Niklas Haas 57fad2d5f9 vo_gpu: remove --scale-cutoff etc
Pointless bloat option, hard-coded as 1e-3 now in libplacebo and no
reason not to also hard-code in mpv.

See-Also: haasn/libplacebo@64d7c5aab0
2023-09-25 12:45:17 +02:00
llyyr 4dc97ea688 DOCS/af: update audio filters section 2023-09-24 21:41:59 +00:00
Dudemanguy 652a1dd907 DOCS/man: remove outdated note about gnome and idle-inhibit
They support it now.
2023-09-24 01:59:07 +00:00
Dudemanguy 6ea9ec9931 stream_cdda: move cdrom-device to cdda_params
There is zero reason for this to be an MPOpt. Because of how the
OPT_SUBSTRACT works, the option gets renamed to cdda-device instead, but
probably not a big deal since the old alias is still in place.
2023-09-22 14:20:38 +00:00
Dudemanguy f09ebc871c DOCS/options: remove some stray tabs
Accidentally added in 2c738ca54b on a
couple of lines. This is what I get for only looking at git webui diff.
2023-09-21 22:47:08 -05:00
Kacper Michajłow 804eb80e78 win32: add --window-corners
Allows to set preference for window corners rounding for DWM.
2023-09-21 23:13:19 +00:00
Kacper Michajłow ee24dd0419 win32: add an option to control window title bar state
Fixes: #11432
2023-09-21 23:13:19 +00:00
DeadSix 2c738ca54b win32: add an option to change window affinity 2023-09-21 22:14:28 +00:00
llyyr d48f71339e vo_gpu: allow deband-iterations to be 0
THis allows adding grain without debanding. libplacebo already supported
this, so no changes are required there.
2023-09-21 19:22:03 +02:00
Dudemanguy be89e07229 drm: remove selecting the card number with --drm-connector
f560437594 deprecated this since the
--drm-device path option was added as a replacement. Drop the card
number selection logic.
2023-09-21 16:06:29 +00:00
Dudemanguy 177fe48d79 options: remove --vf-defaults and --af-defaults
These were deprecated a long time ago and apparently didn't even work
with lavfi filters. Go ahead and remove them and additionally clean up
some code related to them. m_config_from_obj_desc_and_args becomes much
simpler now and a couple of arguments can be completely removed.
2023-09-21 16:06:29 +00:00
Dudemanguy fb46666395 options: remove deprecated --record-file option
No wonder wm4 wanted to get rid of this. This option requires touching a
bunch of crap in the core player code. --stream-record works perfectly
fine and is a lot nicer so there's no need for this to exist anymore.
2023-09-21 16:06:29 +00:00
Dudemanguy 36ea5d7b5c options: remove a few options marked with .deprecation_message
A bit different from the OPT_REPLACED/OPT_REMOVED ones in that the
options still possibly do something but they have a deprecation
message. Most of these are old and have no real usage. The only
potentially controversial ones are the removal of --oaffset and
--ovoffset which were deprecated years ago and seemingly have no real
replacement. There's a cryptic message about --audio-delay but who
knows. The less encoding mode code we have, the better so just chuck
it.
2023-09-21 16:06:29 +00:00
Dudemanguy 4b2276b730 command: stop restarting playback when writing to playlist-pos
e9e93b4dbe added a warning about writing
the same value to the playlist-pos property that in the future it would
stop restarting playback. Instead, you should use the
playlist-play-index command for that. Well go ahead and drop the old
deprecated behavior now and do what wm4 wanted this to do: just ignore
if the same value is written again.
2023-09-21 16:06:29 +00:00
Dudemanguy 29b481da54 command: remove some old deprecated properities
drop-frame-count and vo-drop-frame-count are ancient and have no reason
to exist anymore. The other change is that support for writing to
display-fps has been removed, and the property is strictly read-only
now. 3a2dc8b22e is what deprecated it with
a warning to users, so we can remove it without much trouble.
2023-09-21 16:06:29 +00:00
Dudemanguy 969c19c9cb options: remove ancient option fallbacks/deprecation
We've got an ungodly amount of OPT_REPLACED and OPT_REMOVED sitting
around in the code. This is harmless, but the vast majority of these are
ancient. 26f4f18c06 is the last commit
that touched the majority of these and of course that only changed how
options were declared so all of this stuff was deprecated even before
that. No use in keeping these, so just delete them all. As an aside,
there was actually a cocoa_opts but it had only a single option which
was replaced by something else and empty otherwise. So that entire thing
was just simply removed. OPT_REPLACED/OPT_REMOVED declarations that were
added in 0.35 or later were kept as is.
2023-09-21 16:06:29 +00:00
Dudemanguy 96a6c1ae91 builtin.conf: remove deprecated opengl-hq profile
Deprecated in 65979986a9. 6 years is more
than enough time.
2023-09-21 16:06:29 +00:00
Guido Cella 6b09525157 demux_playlist: add --directory-mode=auto
This is a more useful default with --shuffle.
2023-09-21 14:57:11 +00:00
Kacper Michajłow 20e584f60b options: make video-crop validation more strict 2023-09-20 19:08:19 +00:00
Niklas Haas 2fd5b9b4dd vo_gpu: match libplacebo debanding defaults
The defaults were awful and horribly regressed many files while also not
fixing banding on files that actually needed it, sometimes even
*increasing* banding due to the low threshold.

Fixes: 12ffce0f22
See-Also: haasn/libplacebo@e1e43376d1
2023-09-20 20:26:07 +02:00
Niklas Haas e7bd330ed0 vo_gpu: match libplacebo peak detection defaults
This probably makes `vo_gpu` tone mapping worse, or something, but who
cares. The status quo for a while now has been to use `vo_gpu_next` if
you care about HDR rendering at all.

See-Also: haasn/libplacebo@ec60dd156b
See-Also: haasn/libplacebo@0903cbd05d
2023-09-20 20:26:07 +02:00
Kacper Michajłow fe868988a1 DOCS: update notes about new profiles 2023-09-20 18:42:06 +02:00
Niklas Haas c172a650c4 vo_gpu: default to dscale=hermite
This new filter is slightly sharper, and significantly faster, than
mitchell. It also tends to preserve detail better. All in all, there is
no reason not to use it by default, especially from a performance PoV.
(In vo_gpu_next, hermite is implemented efficiently using hardware
accelerated bilinear interpolation)

See-Also: 75b3947b2c
2023-09-20 17:07:38 +02:00
Niklas Haas 87baed0b0f DOCS/options: document hermite scaler
Since I want to make it more prominent.
2023-09-20 17:07:38 +02:00
Niklas Haas 0cb4aa4ff7 DOCS/options: remove potentially offensive language
It can hurt people's feelings to refer to scalers as "high quality" and
"low quality", when it is so subjective.

I decided to preserve the lanczos sections at least because it's mostly
talking about the difference between EWA Lanczos and Lanczos, which is
less controversial than the difference between, say, Lanczos and
Catmull.
2023-09-20 17:07:38 +02:00
Niklas Haas c934391e07 DOCS/options: remove spline36 section
What a pointless section. We don't use it by default anymore so might as
well just remove it.
2023-09-20 17:07:38 +02:00
Alex Mitzsch 1ffe7aacca
DOCS/options: change wording to be less inflammatory
Change wording from "Disable idiotic nonsense" to just say "Disable
functions like."
2023-09-20 09:19:38 -04:00
Dudemanguy 94a985d887 DOCS/vo: remove some dated deprecation warnings about --vo=rpi
Very amusingly, the manual previously said "The rpi VO will be removed
in mpv 0.23.0." Obviously, this didn't happen. It looks like wm4 changed
his mind on this with 51fd8f6fe1, but
never updated the docs. What was the problem? Who knows but allegedly
there are people that use --vo=rpi (it's supposed to work at least).
Actually context_rpi is probably broken since wm4 changed fullscreen
handling in 59cdfe50b2 and no one ever
bothered to fix it after that commit. In fact, that's the last commit
that touched that particular file. Someone did actually fix vo_rpi after
that so that one probably works at least. Anyways, I wouldn't mind just
deleting all rpi stuff, but there's probably some people out there that
use it so whatever. Remove the outdated deprecated language in the
documentation and just accept that we support this unfortunately.
2023-09-19 21:29:47 -05:00
Kacper Michajłow eab3842d8b cplugin: allow loading mpv_* symbols dynamically
Defining MPV_CPLUGIN_DYNAMIC_SYM during plugin compilation will replace mpv_*
functions with function pointers. Those pointer will be initialized when
loading the plugin.

It is recommended to use this symbol table when targeting Windows. The loader
does not have notion of global symbols. Loading cplugin into mpv process will
not allow this plugin to call any of the symbols that may be available in
other modules. Instead cplugin has to link explicitly to specific PE binary,
libmpv-2.dll/mpv.exe or any other binary that may have linked mpv statically.
This limits portability of cplugin as it would need to be compiled separately
for each of target PE binary that includes mpv's symbols. Which in practice
is unrealictis, as we want one cplugin to be loaded without those restrictions.

Instead of linking to any PE binary, we create function pointer for all mpv's
exported symbols. For convinience names of entrypoints are redefined to those
pointer so no changes are required in cplugin source code, except defining
MPV_CPLUGIN_DYNAMIC_SYM. Those function pointer are exported to make them
available for mpv to init with correct values during runtime, before calling
`mpv_open_cplugin`.

Note that those pointer are decorated with `selectany` attribute, so no need
to worry about multiple definitions, linker will keep only single instance.

This fixes cplugin usability on Windows. Without any API changes, only
recompilation with -DMPV_CPLUGIN_DYNAMIC_SYM is needed.
2023-09-20 02:16:45 +00:00
Kacper Michajłow 703f158880 builtin.conf: modernize internal profiles
The goal is to provide simple to understand quality/performance level
profiles for the users.

Instead of default and gpu-hq profile. There main profiles were added:
    - fast: can run on any hardware
    - default: balanced profile between quality and performance
    - high-quality: out of the box high quality experience. Intended
      mostly for dGPU.

Summary of three profiles, including default one:

[fast]
scale=bilinear
cscale=bilinear (implicit)
dscale=bilinear
dither=no
correct-downscaling=no
linear-downscaling=no
sigmoid-upscaling=no
hdr-compute-peak=no

[default] (implicit mpv defaults)
scale=lanczos
cscale=lanczos
dscale=mitchell
dither-depth=auto
correct-downscaling=yes
linear-downscaling=yes
sigmoid-upscaling=yes
hdr-compute-peak=yes

[high-quality] (inherits default options)
scale=ewa_lanczossharp
cscale=ewa_lanczossharp (implicit)
hdr-peak-percentile=99.995
hdr-contrast-recovery=0.30
allow-delayed-peak-detect=no
deband=yes
scaler-lut-size=8
2023-09-19 22:26:56 +02:00
Kacper Michajłow 7e692ee490 vo: change tscale to oversample by default
Keep it sharp, let users opt-in more blurry result.
2023-09-19 22:26:56 +02:00
Kacper Michajłow 4bedcd36f6 vo: make cscale follow scale by default 2023-09-19 22:26:56 +02:00
Kacper Michajłow 8121d41245 vo: enable correct-downscaling, linear-downscaling, sigmoid-upscaling 2023-09-19 22:26:56 +02:00
Dudemanguy 7a76cf4d65 demux: prepend some cache options with demuxer
--cache-dir is an awful name that leads to confusion (see #12418).
Change the name to --demuxer-cache-dir and --demuxer-cache-unlink-files
instead.
2023-09-18 17:13:15 +00:00
llyyr 1c09ee44c3 filter_kernels: remove bcspline filter
After fixing the B and C params for bcspline, it ended up being the same
thing as bicubic. There's no reason to have two names for the same
filter, so remove bcspline and keep bicubic to match libplacebo.
2023-09-18 17:44:18 +02:00
Dudemanguy c6cef1bad3 DOCS/vo: remove outdated reference to --vo-vaapi-deinit-mode
This option was removed in db2268d5b1, but
the manual was never updated to reflect that.
2023-09-17 15:24:55 -05:00
Kacper Michajłow c40b064e38 demux: add crop to mp_codec_params 2023-09-17 16:48:42 +00:00
llyyr 181eddc80e osc: add scrolling to audio/sub buttons
Consistent with other osc buttons now
2023-09-17 00:03:45 +02:00
Niklas Haas bc35180933 vo_gpu: remove --scale-wblur etc
No need for this since it's entirely redundant with just changing the
filter radius directly. In fact, that's the whole *point* of the filter
radius - it does not modify the filter, it modifies the scaling of the
window.

Of course, this does not work for non-resizable kernels. But, really,
who cares?
2023-09-16 14:33:45 +02:00
Niklas Haas a24aa6b8f7 filter_kernels: add ewa_lanczos4sharpest
Mainly for vo_gpu_next.
2023-09-16 14:33:45 +02:00
Niklas Haas 2ec79f8bb7 filter_kernels: use true jinc radius
For all filters. For consistency between vo_gpu and vo_gpu_next. Also
makes ewa_lanczossharp less special.
2023-09-16 14:33:45 +02:00
Niklas Haas 40de03fdba vo_gpu: vo_gpu_next: support --icc-3dlut-size=auto
And make it the default. In libplacebo, this uses internal heuristics to
pick a good size based on the actual ICC characteristics. This is
significantly less wasteful than always generating a 64x64x64 3DLUT (the
old status quo).

In vo_gpu, for simplicity, just default to 65x65x65. Note that this
provides slightly better accuracy than the old default of 64x64x64 for
technical reasons, and matches what libplacebo defaults to for typical
display profiles.
2023-09-15 10:58:37 +02:00
dokur0chan e15619e70d DOCS/options: add catmull_rom as an example for --scale
Adds catmull_rom as an example for --scale in the user manual, alongside
a brief description of the filter.

catmull_rom was only exposed to users as an available filter through
--scale=help. However, catmull_rom is very often aliased as "Bicubic" in
other applications such as GIMP and VapourSynth, and is a relatively
popular resizing filter. The documentation lacked any description of
catmull_rom, outside of a brief mention of it in the --tscale section.
2023-09-11 13:30:37 +02:00
Kacper Michajłow f5690e3c97 Revert "sub: add auto option to --sub-fix-timing"
This reverts commit b47a58516a.
2023-09-11 01:58:07 +00:00
Kacper Michajłow 6f83529f21 vd_lavc: by default enable cropping by decoder
While this resolves limitations of lavc decoder crop, it also introduces
artifacts with some of the source files or hwdec.

Depending on chroma sampler it is possible to sample outside the decoder
crop area, pulling dirty pixels into the image. Some decoders left them
zeroed, not black. To fix that we would need specifc solution during
mapping of avframes.

As most of the files require the crop only in bottom/right area, the
AVCodecContext::apply_cropping works ok for those.

For all other cases that require more fancy cropping like 1440x1080+240+0
user can manually set `--vd-apply-cropping=no`.

Limitations of the lavc crop are explained here:
https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a4745c7455c317272c4e139d6f369936c

Fixes: 826ce82cad
2023-09-10 18:33:50 +02:00
Guido Cella be92223157 DOCS/lua.rst: fix typo 2023-09-09 09:09:52 -04:00
Dudemanguy fe875083b3 player: redo --subs-fallback-forced
In the never ending quest of trying to satisfy every possible user
request for subtitle autoselection, I ended up redoing how
--subs-fallback-forced works. The old behavior had it as strictly a
fallback-type option when there were no lang matches, but now we can
make it an active part of compare_track and it works along with slang to
select the desired track. Since it's a three state option, the no option
still works to avoid selecting any forced subtitle tracks. The meaning
of always slightly changes to mean "only select forced subtitle tracks"
and yes remains essentially the same (no special priority given besides
the audio matching subtitle language case).
2023-09-09 02:48:53 +00:00
Kacper Michajłow 826ce82cad vd_lavc: disable cropping by decoder
Cropping by decoder has limitations with regards to aligment and hwdec.
It doesn't work to offset top left corner with hwdec and even with
software decoding it don't crop fully when resulting data would not be
aligned.

VO cropping is way more robust.
2023-09-08 02:27:08 +00:00
Kacper Michajłow 37d0deadd4 video: allow overriding container crop if it is present
Setting `--video-crop=0x0+0+0` applies full frame crop, ignoring the
container one. Setting --video-crop=0 disables manual crop and restores
container one if it is available.
2023-09-08 02:27:08 +00:00
Kacper Michajłow fef4481bfe m_option: make m_rect_apply center based
This makes it easier to apply crops without need to manually calc the
offset. I wanted for it to be top-left corner based, but maybe it was
not that good idea in retrospect.

Also rename scrw/scrh, since they don't refer to screen. It was copied
form m_geometry apply.
2023-09-08 02:27:08 +00:00
Dudemanguy b47a58516a sub: add auto option to --sub-fix-timing
Third try is the charm? I stupidly missed that this option already
existed in my previous commits. Instead, add an auto value to it and
enable it by default for sd_lavc but not sd_ass. On my limited samples,
it seems to fix the gaps issue that can occur but without regressing
some duration timings for sub_lavc subtitles. Well hopefully anyway.
Fixes #12327.
2023-09-07 09:27:31 -05:00
Philip Langdale 02b49458a3 vo: vulkan: allow picking devices by UUID
We currently only allow specifying the Vulkan device to use by name. We
did this to avoid confusion around devices being enumerated in an
unpredictable order. However, there is a valid edge case where a system
may contain multiple devices of the same type - which means they will
have the same name, and so you can't control which one is used.

This change implements picking devices by UUID so that if names don't
work, you have some option available. As Vulkan 1.1 is a hard
requirement for libplacebo, we can just use UUIDs without conditional
checks.

Fixes #10898
2023-09-04 15:22:20 -07:00
Oliver Freyermuth f3df6f53ba stream/dvbin: recommend to use specific channels.conf file names
The old mplayer / zap style format is not fully standardized across
channel scanners, so autodetection may fail if the file name
does not indicate the delivery system.
2023-09-03 13:08:58 +02:00
Oliver Freyermuth d88e3d105a stream/dvbin: add support for delivery system ISDB-T
This is similar to DVB-T, but requires slightly different treatment
as there is no T/T2 differentiation.
Use a new channels.conf.isdbt file as channels config file.
2023-09-03 13:08:58 +02:00
llyyr f52056b76d Revert "aspect: change --video-pan-x/y to be relative to the destination rect"
There are way too many preexisting scripts that rely on this behavior
for video panning, like for example scripts that allow you to use mpv as
an image viewer. If this behavior is desired then it may be better to
add a new option for panning relative to the destination instead.

The restriction of video-pan-x/y being clamped to {-3, 3} also results
in the video being impossible to pan if it was zoomed in beyond a
certain degree.

This reverts commit 7d6f9e3739.
2023-09-02 16:18:31 +00:00
NRK 022dbfc977 osc: add scrolling to the seekbar
the osc currently allows for changing volume via scrolling when on top
of the volume icon. this does the same thing for the seekbar by allowing
seeking via scroll.
2023-09-02 18:14:02 +02:00
Niklas Haas b4c98cb04c vo_gpu: remove --tone-mapping-mode
`--vo=gpu-next` no longer uses this option, being replaced entirely by a
luminance-based approach internally. And even for `--vo=gpu`, the values
other than 'hybrid' are universally inferior in quality.

In the interest of gradually reducing the amount of option bloat here,
remove this mostly-pointless option.
2023-09-01 21:02:19 +02:00
Kacper Michajłow 3726834aaf man/input: remove trailing spaces 2023-08-31 17:37:42 +00:00
Kacper Michajłow c9c9822289 player/command: add video-params/crop-[w,h,x,y] 2023-08-31 17:37:42 +00:00
Kacper Michajłow f3f1a79fe3 vo: add --video-crop
Just cropping by VO that works with hwdec.

Fixes: #12222
2023-08-31 17:37:42 +00:00
Kacper Michajłow 3ab5401b38 player/command: remove video-aspect property
4 years is enough of deprecation period.
2023-08-31 17:37:42 +00:00
Guido Cella edd7189a72 demux_playlist: default to --directory-mode=lazy
64959c450d solved the problems with resuming playback, so default to
--directory-mode=lazy because it's faster, especially on slow drives,
and results in smaller playlists.
2023-08-30 15:46:57 +00:00
Niklas Haas 7f9b1b32a5 stats.lua: enable --tone-mapping-visualize while stats shown
Except in oneshot mode. Controllable via new option.
2023-08-30 17:10:13 +02:00
Kacper Michajłow 3cf71fd7c7 command: add hdr-metadata property 2023-08-29 20:58:44 +02:00
Dudemanguy df613cef4c loadfile: fix --no-subs-with-matching-audio with --slang
If --slang was set to some language and it matched the subtitle track,
then --no-subs-with-matching-audio would do nothing. Fix the logic by
doing the --no-subs-with-matching-audio step at the end to ensure that
it always "wins" over whatever --slang or --subs-fallback has set.
Clarify the docs a bit to make it clearer that this is the intended
behavior. Fixes fbe8f99194.
2023-08-29 12:34:27 -05:00
Dudemanguy a062f115a1 command: remove sub-forced-only-cur property
Since we no longer have the auto choice, this is always exactly equal to
the value of the option (sub-forced-events-only). Remove the property
and alias it.
2023-08-29 16:39:00 +00:00
Dudemanguy 9b9475e218 player: rename --sub-forced-only to --sub-forced-events-only
The old name is pretty bad and users mistakenly think it has something
to do with selecting forced subtitles (that would be
--subs-fallback-forced). Instead of giving it such a generic name, make
it clearer that this has to do specifically with forced sub events
which is only relevant for a small minority of subtitles.
2023-08-29 16:39:00 +00:00
Dudemanguy 4009e99b9c player: remove auto choice from sub-forced-only
First of all, this never worked. Or if it ever did, it was in some
select few scenarios. c9474dc9ed is what
originally added support for the auto choice. However, that commit
worked by propagating a value to a fake option used internally. This
shouldn't have ever worked because the underlying m_config_cache was
never updated so the value shouldn't have been preserved when accessed
in sd_lavc. And indeed with some testing, the value there is always 0
unsurprisingly.

This was later rewritten in ba7cc07106
along with a lot of other sub changes, but with that, it was still
mostly broken. The reason is because one of the key parts of having to
hit this logic (prefer_forced) required `--no-subs-with-matching-audio`
to be set. If the audio language matches the subtitle language (the
requirement also excludes forced subs), the option makes no subtitle
selection in the first place so pick->forced_only_def is not set to true
and nothing even happens. Another way around this would be to attempt to
change your OS language (like with the LANG environment variable) so
that the subtitle track gets selected but then audio_matches mistakenly
becomes false because it compares the OS language to the audio language
which then make preferred_forced 0, so nothing happens. I don't think
there's a scenario where pick->forced_only_def is actually set to true
(thus meaning `auto` is useless), but maybe someone could contrive
something very strange. Regardless, it's definitely not something even
remotely common.

fbe8f99194 changed track selection again
but didn't consider this particular case. The net result is that DVD/PGS
subs become equivalent to --sub-forced-only being yes, so this a change
in behavior and probably not a good one. Note that I wasn't able to
actually observe any difference in a PGS sample. It still displayed
subtitles fine but that sample probably didn't have the right flags to
hit the sub-forced-only logic.

Anyways, the auto feature is extremely questionable at best and in my
view, not actually worth it. It is meant to be used with
`--no-subs-with-matching-audio` to display forced pictures in subtitle
tracks that are not marked as forced, but that contradicts that
particular option's purpose and description in the manual (secretly
selecting a track under certain conditions even though it says not to).

Instead of trying to shove all this logic into select_default_track
which is already insanely complicated as it is, recognize that this is a
trivial lua script. If you absolutely want to turn --sub-forced-only on
under these certain conditions (DVD/PGS subtitles, matching audio and
subtitle languages, etc.), just look at the current-tracks property and
do your thing. The very, very niche behavior that this option tried to
accomplish basically never worked, no user even knows what this option
does, and well it's just not worth supporting in core mpv code. Drop
all this code for sanity's sake and change --sub-forced-only back to a
bool.
2023-08-29 16:39:00 +00:00
Dudemanguy 165f9e061f player: add always to --subs-fallback-forced
In general, forced tracks should only be shown if they match the
language of the audio. However some people do want them no matter what,
so add an always option to this so such tracks are always selected.
2023-08-28 18:43:46 +00:00
Dudemanguy 58ec0630f5 player: add --subs-match-os-language option
This is the replacement for the previous auto option for slang. It
behaves similar however it never overrides slang if that is set and will
instead try to pick the subtitle that matches the user's language if
appropriately flagged by the file.
2023-08-28 18:43:46 +00:00
Dudemanguy 53d032374d player: remove special auto option from alang/slang/vlang
This proved to be too problematic. Depending on the value of
--subs-with-matching-audio, you could either end up with cases where
--slang wasn't respected and users didn't get subtitles or alternatively
cases where subtitles were given and the user didn't ask for them.
Fundamentally, the OS language functionality doesn't really map well to
slang (and for alang/vlang it makes zero sense; not that anyone actually
used it). Instead of trying to shove it in an option where it doesn't
belong, we should split this off into something else. So for now, just
remove the special handling of "auto" and flip slang back to NULL.
2023-08-28 18:43:46 +00:00
llyyr 8bf3fe7e2a f_lavfi: don't reject dynamic lavfi ins/outs
Ideally, users should be using lavfi-complex instead of lavfi-bridge
for such a use case, however currently lavfi-complex doesn't support
hwdec. So we can allow filters with dynamic inputs to work with
lavfi-bridge, at the cost of them only being able to take in
only one input. This should probably be reverted when/if lavfi-complex
has hwdec, but for now this allows us to use libplacebo
as a video filter with hwdec in mpv again.
2023-08-28 00:29:43 +02:00
llyyr f9918b5390 command: add `sub-ass-extradata` property 2023-08-27 16:14:18 +00:00
Dudemanguy 32be72623b player: make all autoload extensions configurable
--audio-file-auto, --cover-art-auto, and --sub-auto all work by using an
internally hardcoded list that determine what file extensions get
recognized. This is fine and people periodically update it, but we can
actually expose this as a stringlist option instead. This way users can
add or remove any file extension for any type. For the most part, this
is pretty pretty easy and involves making sub_exts, etc. the defaults
for the new options (--audio-file-auto-exts, --cover-art-auto-exts, and
--sub-auto-exts). There's actually one slight complication however. The
input code uses mp_might_be_subtitle_file which guesses if the file drag
and dropped file is a subtitle. The input ctx has no access to mpctx so
we have to be clever here.

For this, the trick is to recognize that we can leverage the
m_option_change_callback. We add a new flag, UPDATE_SUB_EXTS, which
fires when the player starts up. Then in the callback, we can set the
value of sub_exts in external_files to opts->sub_auto_exts. Whenever the
option updates, the callback is fired again and sub_exts updates. That
way mp_might_be_subtitle_file can just operate off of this global
variable instead of trying to mess with the core mpv state directly.

Fixes #12000.
2023-08-26 00:33:00 +00:00
James Cuzella 3916871101 DOCS/mpv: document ZOOMIN & ZOOMOUT multimedia keys
Document default key mappings for ZoomIn & ZoomOut:

    ZOOMIN    add video-zoom   0.1
    ZOOMOUT   add video-zoom  -0.1
2023-08-23 15:37:02 +02:00
Dudemanguy 3422e5e1e8 DOCS/options: clarify the video-pan-x/y example
1fa6669bc0 misinterpreted the example and
changed the pixel value from 128 to 168 (thinking that it meant pixels
after scaling), but likely the original calculation was correct because
the line specifically says "of the source video". This is just confusing
not really useful information so instead change the example to a more
common resolution (1920x1080) and remove any references to the source
video resolution. Also mention video-pan-y while we're at it.
2023-08-20 19:02:31 -05:00
Kacper Michajłow 7d6f9e3739 aspect: change --video-pan-x/y to be relative to the destination rect
It makes it more usable to virtually move dst rect instead of scaled
src.

The issue with the latter is that it is affected by video-zoom
paramters. For example if we do `--video-pan-x=-0.5` in normal case it
will move video -50%, but if we apply video-zoom/scale the video will
float towards the middle in unintuitive way. Extreme case is when one do
--video-zoom-x=0.01, now it is impossible to move video unless you
specify huge video-pan-x value, but it is limited to [-3, 3]. So you
cannot do anything.

With this changes regardless of video scale/zoom, video-pan will keep
center of scaled video in one place.
2023-08-20 23:15:48 +00:00
Kacper Michajłow 1fa6669bc0 DOCS/options: fix typo in video-pan-x example
Width of the video would fill fully display at this resolution, so
moving it 168px to the left, would hide also 168px.
2023-08-20 23:15:48 +00:00
Niklas Haas a8192eda6c vo_gpu_next: add --libplacebo-opts
To help test not-yet-exposed options, and for debugging purposes.
2023-08-19 14:12:24 +02:00
Niklas Haas 36972aec53 vo_gpu: allow --hdr-peak-decay-rate=0.0
This completely disables all smoothing. Despite what the manual claims,
a decay rate of 1.0 does *not*.

It's worth pointing out that this depends on the following commit to
work properly in --vo=gpu-next, but I don't think working around such a
minor detail is worth the trouble, considering people building nightly
mpv are probably also building nightly libplacebo it should just work
(tm).

See-Also: 1c464baaf4
See-Also: 83af2d4ebd
2023-08-18 15:00:25 +02:00
Dudemanguy 4a6abff812 x11: add --x11-wid-title option
This deliberately wasn't being done when mpv was embedded
(fbccddb48b). There are some applications
that would benefit from mpv setting a title since they don't do so
themselves (such as tabbed), but at the same time some others would
probably rather not have this behavior (like smplayer). Add an option
that allows an embedded mpv to set the title if the user wishes.
Fixes #11528.
2023-08-13 19:58:20 +00:00
Dudemanguy e8a77e5279 player: add playlist-path properties
A bit of a long standing pain with scripting is that when opening a file
that gets interpreted as a playlist (like an m3u), the original path of
the file gets thrown away later. Workarounds basically consist of
getting the filename before mpv expands the path, but that's not really
reliable. Instead of throwing it away, save the original playlist path
by copying to the playlist entries when applicable (demuxer playlist and
the playlist option). Then expose these as properties: playlist-path for
the currently playing entry and playlist/N/playlist-path for each
specific entry. Closes #8508, #7605.
2023-08-13 19:58:20 +00:00
Dudemanguy a177fb6188 vf_vapoursynth: save display resolution as a variable
mpv has a generic method for getting the display resolution, so we can
save it in vf_vapoursynth without too much trouble. Unfortunately, the
resolution won't actually be available in many cases (like my own)
because the windowing backend doesn't actually know it yet. It looks
like at least windows always returns the default monitor (maybe we
should do something similar for x11 and wayland), so there's at least
some value. Of course, this still has a bunch of pitfalls like not being
able to cope with multi monitor setups at all but so does display_fps.
As an aside, the vapoursynth API this uses apparently requires R26 (an
ancient version anyway), so bump the build to compensate for this.
Fixes #11510
2023-08-13 19:58:20 +00:00
Dudemanguy c62b45ec2a player: add --term-remaining-playtime option
The OSC reports the speed-adjusted remaining time, but the terminal does
not. This is a weird mismatch and the OSC's default behavior makes
sense, so let's just do some division and add an option to disable it.
Also named "remaining-playtime" after the OSC option. Fixes #10445.
2023-08-13 19:58:20 +00:00
Dudemanguy 6ea08be59a player: make sub-pos a float value
mpv makes this option an integer, but the underlying ass API actually
accepts doubles. From some testing, there is no meaningful precision
difference between float or double (it seems to go in roughly 0.05
steps), so just make it a float. sd_lavc also can handle non-integer
values here. Closes #11583.
2023-08-13 19:58:20 +00:00
Kacper Michajłow 2a7639f452 player/command: add video-params/aspect-name
With pretty printed aspect ratio and related format.
2023-08-13 15:04:33 +00:00
fireattack 3954660f03 ytdl_hook: improve Windows exe search with suffix 2023-08-13 14:40:36 +00:00
Dave dfbdf75165 osc: support speed-independent time-remaiing display
The new OSC config option "remaining_playtime" controls whether the
time-remaining display considers speed (yes - default) or ignores it.
2023-08-11 14:30:42 +03:00
sfan5 bc52159cb9 ao_audiotrack: enable pcm-float by default
Since recent commits this should work 100% as well as s16.
2023-08-08 20:15:20 +02:00
Alexander Georgiadis 6729285502 DOCS/options: fix typo in hdr-peak-percentile 2023-08-05 16:46:28 +02:00
Niklas Haas 65a95a721e builtin.conf: add --hdr-peak-percentile=99.995 to gpu-hq
This is higher quality but comes with a slight performance hit,
especially for weaker iGPUs, so I don't want to enable it out of the box
even when --hdr-compute-peak=auto.
2023-08-04 16:58:44 +02:00
Niklas Haas 45e95311b8 vo_gpu_next: add --hdr-peak-percentile 2023-08-04 16:58:44 +02:00
Dudemanguy a2dd78fbc0 options: restore old default sub selection behavior
1669c4698d notably flipped the default of
--subs-with-matching-audio from yes to no as part of a series of changes
that gave more control over sub selection behavior. While the increased
amount of options is definitely nice, changing the default to no results
in very unintuitive behavior. For example, setting alang=en and slang=en
in your config will not show any subtitles since the audio stream is
English as well so --subs-with-matching-audio being no causes the subs
to not be be selected. This is very weird for users who reasonably
expect slang being set to actually result in showing subs and this is
what mpv did for the past decade.

The other case is when a subtitle does not have a language tag but is
flagged as default. Because --subs-fallback (a new option), defaults to
no, these subtitles also will not be loaded. This is also strange for
users since mpv previously loaded these and they would need to change
the value of this option. It's also inconsistent because audio tracks
that are tagged as default are also loaded by default.

The new behavior seems to have mostly just confused users, and it also
regresses their configs for unclear reasons. Let's just set the options
to be back in line with the old behavior with is what most users expect.
--subs-with-matching-audio goes back to being yes and the new option
--subs-fallback should be default. Fixes #11854.
2023-07-29 22:22:37 +02:00
Kacper Michajłow 5fc305fa17 path-win: move state directory to %LOCALAPPDATA%
%LOCALAPPDATA% is where the local application state belongs.
2023-07-29 14:27:59 +00:00
Kacper Michajłow aa05c06873 path-win: add subdirectory for cache
To not polute %LOCALAPPDATA%/mpv as it may be used for other things too.
2023-07-29 14:27:59 +00:00
LaserEyess f2cce5f38f waf: remove waf as a build system
Remove waf entirely in favor of meson as the only supported build
system. Waf was officially deprecated in 0.36.0, and has not been
preferred over meson since 0.35.0.
2023-07-23 19:55:51 +00:00
sfan5 f4210f8490
Release 0.36.0 2023-07-23 19:10:36 +02:00
Dudemanguy e8126e54e5 DOCS/vo: clarify dmabuf-wayland a bit
Make it clearer that you should be using --hwdec with this VO. Also make
some comments about the things that are required for this to work
correctly (i.e. working drivers/GPU and the right compositor).
2023-07-23 04:55:26 +00:00
Dudemanguy 45b006b958 DOCS: clarify screenshot window and screenshot-sw 2023-07-21 20:23:11 +02:00
sfan5 a960b75604 image_writer: move tag_csp check into image_writer_flexible_csp()
This ensures the sRGB fallback to happen in all situations involving
the image writer code, notably --screenshot-sw.

fixes: cbbe2e5221
2023-07-19 13:01:08 +02:00