Commit Graph

11694 Commits

Author SHA1 Message Date
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
Niklas Haas dbbcd9ec9c builtin.conf: add --hdr-contrast-recovery to gpu-hq
The first change to the gpu-hq profile in aeons.
2023-07-18 15:22:18 +02:00
Niklas Haas 02595011eb vo_gpu_next: add --hdr-contrast-recovery/smoothness
New upstream feature. Disabled by default.
2023-07-18 15:22:18 +02:00
Kacper Michajłow 347fbd6fa3 vo_gpu_next: add --target-contrast option
For better control over target display levels.
2023-07-17 18:50:34 +02:00
sfan5 8a6cabce35 DOCS/release-policy.md: add additional advice 2023-07-17 11:55:45 +02:00
m154k1 b077cf72df player: set default cache dir on macOS
Use ~/Library/Caches/io.mpv for caches instead of ~~home.
2023-07-15 23:56:57 +00:00
Dudemanguy 031e172cef DOCS/mpv: clarify the location of cache/state files 2023-07-15 15:10:41 +00:00
Philip Langdale 93f95f61e9 DOCS/interface-changes: document change in ctrl+h behaviour
We now use `auto-safe` when turning on hardware decoding instead of
`auto`.
2023-07-15 18:58:28 +08:00
Philip Langdale e64ef6089f vd_lavc: map `hwdec=yes` to `hwdec=auto-safe`
To remain consistent with our belief that `auto-safe` should be the
recommended mode when turning on hw decoding, let's remap `yes` from
`auto` to `auto-safe`.
2023-07-14 20:41:24 -07:00
Philip Langdale 9f7f9c1614 input: update ctrl+h to toggle `auto-safe` rather than `auto`
It has been odd that ctrl+h toggles `auto` for hwdecs even though we
always recommend people start with `auto-safe`, and `auto` will attempt
various hwdecs that can fail so badly we can't fall back to software
decoding.

With the change to more exhaustively attempt to use hwdecs, it is now
easier to get into situations where these fragile hwdecs will get
attempted in basic scenarios, like pressing ctrl+h.

So it is high time to default to `auto-safe`.
2023-07-14 20:41:24 -07:00
Dudemanguy c958990833 vo_dmabuf_wayland: add osd support
This adds osd support via shm buffers using a similar approach that the
normal buffers do, but it differs in a few key areas. One thing to note
is that sway and weston actually handle this extremely differently which
required all the abstractions here. In particular, weston does not cope
well with destroying the wl_buffer from shm outside of the release
handler at all (i.e. it segfaults). The workaround here is to simply
attach a NULL to the osd surface and do a surface commit before we
destroy the buffers. This is reasonable enough and seems to work well
although it's pretty weird. Sway is more straightforward although it
actually releases the osd buffer when the window goes out of sight.
Also, I found that it doesn't always release every buffer before you
close it unlike weston seems to do which is part of the reason all this
bookkeeping is required. I don't know if there's any other compositor
out there that can possibly handle vo_dmabuf_wayland right now, but
suffering through these two is good enough for now I think.
2023-07-12 19:19:54 +00:00