Commit Graph

11682 Commits

Author SHA1 Message Date
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
m154k1 cbb1af64d5 stats.lua: set sans-serif as default font
sans is deprecated and unsupported on some platforms.
2023-07-10 16:58:54 +02:00
Christoph Heinrich f266eadf1e demux_playlist: add option to control recursive directory loading
Directories were always loaded recursively, which can be slow
(e.g. one of the subdirectories is a mounting point to a slow device)
and can unexpectedly expand into a massive playlist.

Due to the problems described in 503dada42f,
this defaults to recursive loading.

ref. https://github.com/mpv-player/mpv/issues/9652
2023-07-06 18:17:45 +00:00
Dudemanguy ee69d99bd4 various: correctly ignore cache files with --no-config
--no-config should prevent loading user files of any type: configs,
cache, etc. For cache files, this case wasn't properly handled and it
was assumed they would always get something. vo_gpu's shader cache
actually already handles this, so it was left untouched. In theory,
demuxer cache should never have this issue because saving it to disk is
disabled by default (and likely that will never change), but go ahead
and change it for consistency's sake. Fixes some segfaults with
--no-config and various combinations of settings (particularly
--vo=gpu-next).
2023-07-06 13:08:23 +00:00
Dudemanguy 48e0ee9979 vo_gpu/vo_gpu_next: enable gpu shader and icc cache by default
4502522a7a changed the way mpv handled and
saved cached files. In particular, it made a separate boolean option for
actually enabling cache and left the *-dir options as purely just a path
(i.e. having a dir set didn't mean you save cache). This technically
regressed people's configs, so let's just turn the cache on by default.
Linux users already expect random stuff in ~/.cache and well everyone
else can just live with some files possibly appearing in their config
directory.
2023-07-04 22:14:43 +00:00
Dudemanguy dbc0fcea1b player: add --input-cursor-passthrough option
Add an option for allowing pointer events to pass through the mpv
window. This could be useful in cases where a user wants to display
transparent images/video with mpv and interact with applications beneath
the window. This commit implements this functionality for x11 and
wayland. Note that whether or not this actually works likely depends on
your window manager and/or compositor. E.g. sway ignores pointer events
but the entire window becomes draggable when you float it (nothing under
the mpv window receives events). Weston behaves as expected however so
that is a compositor bug. Excuse the couple of completely unrelated
style fixes (both were originally done by me).
2023-07-04 19:16:43 +00:00
Dudemanguy f76c441ba2 win32: add support for drag-and-drop option 2023-07-01 02:06:02 +00:00
Dudemanguy 6625a94608 options: add no to drag-and-drop
Suggested by @sfan5. Naturally, "no" disables all drag and drop
behavior.
2023-07-01 02:06:02 +00:00
cloud11665 de7f4fb1ee video/image_writer: add avif screenshot support
Notes:
- converts the (image) write() api to filenames, because using avio
with FILE* is a pain.
- adds more debug logs for screenshots.

build: rename av1 dependency to avif_muxer
wscript: unify lavf dependency with meson
2023-07-01 02:05:23 +00:00
Philip Langdale 9ff8c9e780 vd_lavc: let the user provide a priority list of hwdecs to consider
Today, the only way to make mpv consider multiple hwdecs and pick the
first one that works is to use one of the `auto` modes. But the list
that is considered in those cases is hard-coded. If the user wants to
provide their own list, they are out of luck.

And I think that there is now a significant reason to support this -
the new Vulkan hwdec is definitely not ready to be in the auto list,
but if you want to use it by default, it will not work with many codecs
that are normally hardware decodable (only h.264, hevc and av1 if you
are very lucky). Everything else will fall back to software decoding.

Instead, what you really want to say is: use Vulkan for whatever it
supports, and fall back to my old hwdec for everything else.

One side-effect of this implementation is that you can freely mix
hwdec names and special values like `auto` and `no`. The behaviour will
be correct, so I didn't try and prohibit any combinations. However,
some combinations will be silly - eg: sticking any further values after
`no` will result in them being ignored. On the other hand, a
combination like `vulkan,auto` could be very useful as that will use
Vulkan if possible, and if not, run the normal auto routine.

Fixes #11797
2023-06-29 11:58:51 -07:00
rcombs 5c4852d173 command: add sub-forced-only-cur prop 2023-06-25 11:01:58 +02:00
rcombs ba7cc07106 sub: rewrite auto-forced-only support
- No longer has a fake "option" used only internally (which didn't always get propagated properly)
- Always overrideable during playback
2023-06-25 11:01:58 +02:00
rcombs 991a2f79ce player: add more precise sub fallback options 2023-06-25 11:01:58 +02:00