Commit Graph

5882 Commits

Author SHA1 Message Date
Guido Cella 4ab521f080 command: add load-input-conf
This can be used to auto reload the input configuration file, e.g. in
vim:

autocmd BufWritePost ~/.config/mpv/input.conf silent !echo load-input-conf %:p | socat - /tmp/mpvsocket

Partially fixes #6362.

Additionally this can be used as a replacement for deprecated input
sections if they are ever actually removed. For example, if you want to
define different bindings for images, you can load-input-conf an
input.conf for images, and load the original again when switching to a
video. Though currently you would have to redefine builtin bindings that
were overwritten with image ones in the default input.conf.
2024-02-04 15:12:02 +00:00
Guido Cella e2284fba18 command: add load-config-file
Unlike set include mpv.conf, this works after playback has started. It
can be used to auto reload the configuration, e.g. in vim:
autocmd BufWritePost ~/.config/mpv/mpv.conf silent !echo load-config-file %:p | socat - /tmp/mpvsocket

Partially fixes #6362.
2024-02-04 15:12:02 +00:00
Guido Cella fe0c181b1c DOCS/mpv: document how mf:// URLs are formed 2024-02-02 11:39:47 +01:00
nanahi aaaadc9d6b x11_common: support --title-bar
Some X11 window managers support controlling the title bar independently
from other window decorations with _MOTIF_WM_HINTS. This allows hiding
the title bar while keeping other decorations like the resizing borders.

Let mpv respect the --title-bar option on X11 so --no-title-bar can hide
the title bar only like on win32.
2024-02-02 11:39:30 +01:00
Kacper Michajłow 69891c4070 vo_gpu_next: save cache to separate files
Save the cache to separate files to avoid loading/saving a huge combined
libplacebo.cache. This approach allows the saving of only new cache
objects and avoids resaving the entire cache, especially even if only a
tiny change was made.

This commit improves the cold start time of mpv and avoids saving data
when it's not necessary.

Number of changes were made:
- each cached object is saved in its own file
- cache files are prefixed with the name of cached object
- cache directory is cleaned on each uninit
    - the least recently used cache files are removed if cumulative cache
      size is above limit
    - files used in the recent 24 hours are not removed to allow changes
      to mpv.conf without worrying about the cache being removed during
      experimentation
- shader cache size limit is set to 128 MiB
- icc cache size limit is set to 1.5 GiB
- cache objects are loaded/saved as needed

This commit eliminates the runtime performance penalty associated with
the size cache. While we continue to maintain the cache limit to prevent
retaining stale objects, mpv now only loads a small subset of files that
are currently required for playback, instead of loading all files.
2024-01-31 15:38:21 +00:00
Dudemanguy 6ae5ff26b0 osc: add osc-windowcontrols_title option
This allows the title shown with the windowcontrols to be controlled
separately from the normal osc title. Fixes #13295.
2024-01-22 14:41:36 +00:00
Dudemanguy 45f822593f f_auto_filters: change fallback deinterlace to bwdif
I don't actually deinterlace ever but allegedly this is better than
yadif, and there's no real reason to not have this be the fallback
deinterlace when we're not using hw frames. Also change various mentions
of yadif to bwdif. Ref #12835.
2024-01-21 17:55:54 +00:00
Mohammad AlSaleh 02a20b4ebe sub: add `--sub-lavc-o` option
We have `--vd-lavc-o` and `--ad-lavc-o`, but no equivalent option for
 subtitles.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-01-21 17:55:11 +00:00
Dudemanguy a39f9b6181 player: remove --term-remaining-playtime option
This wasn't useful and didn't even really do what it said anyway.
Closes #12167.
2024-01-20 23:24:48 +00:00
nanahi a0ba10b62e command: export current-gpu-context property
This exports `current-gpu-context` property, which is the string
description of the current active GPU context. This allows scripts to
uniquely identify the platform and backend used for --vo=gpu
and --vo=gpu-next.
2024-01-20 17:12:07 +00:00
llyyr 5cc0495718 DOCS/*: remove mentions of Libav 2024-01-20 16:10:20 +00:00
Guido Cella de0849404b scripting: don't observe properties with type nil
mp.observe_property('foo', nil, ...) calls the handler at least 2 times
on each playlist change even when the property doesn't change. This is
dangerous because if you haven't read observe_property's documentation
in a long time this is easy to forget, and you can end up using it for
handlers that are computationally expensive or that cause unintended
side effects.

Therefore, this commit discourages its use more explicitly in the
documentation, and replaces its usages in scripts.

For console.lua, observing focused with type nil leads to calling
mp.osd_message('') when changing file while playing in the terminal with
the console disabled. I don't notice issues from this, but it's safer to
avoid it.

For playlist and track-list this doesn't really matter since they
trigger multiple changes on each new file anyway, but changing it can
avoid encouraging people to imitate the code.

One usage of none in stats.lua is kept because according to b9084dfd47
it is a hack to replicate the deprecated tick event.
2024-01-20 16:09:34 +00:00
nanahi 3881dc37c5 DOCS: reorder --volume-max documentation to where --volume is 2024-01-20 16:08:33 +00:00
nanahi 27724cab8d DOCS: add documentation for --volume-gain options 2024-01-20 16:08:33 +00:00
Guido Cella dfecc9f083 console.lua: style log lines in the terminal
When running the console in the terminal, style log lines with the same
escape sequences as msg.c.

mp.input can also specify terminal escape sequences, e.g. a script to
select a playlist entry can invert the color of the selection.

Also add a missing newline to help's error message.
2024-01-14 23:26:07 +01:00
Guido Cella 43ac656b02 DOCS/mpv: the playback position is not remembered after poweroff
This doesn't actually work on either Windows or Linux with --terminal.
With --no-terminal or --no-input-terminal the SIGTERM handler is never
registered, so it definitely can't work.

Just remove the note about signals because it would be complicated to
explain that they don't terminate abruptly only with --terminal and only
if that signal has a handler, and it wouldn't be of interest to most
users.
2024-01-13 10:45:35 +01:00
Dudemanguy 2ad96079e9 player: add forced choice to subs-with-matching-audio
fe875083b3 confused things a bit and made
--no-subs-with-matching-audio actually mean what it says: no subtitles
if the languages match. However, the option actually meant no non-forced
subtitles not no subtitles at all. This isn't really intuitive so
instead of changing the behavior back to the old way (we already have a
release since then), add a third option "forced" which is equivalent to
the old meaning of --no-subs-with-matching audio. Fixes #13151.
2024-01-13 03:26:06 +00:00
Guido Cella 871f7a152a scripting: add mp.input
This lets scripts get textual input from the user using console.lua.
2024-01-13 02:53:08 +00:00
nanahi 41259db952 vo_gpu_next: respect d3d11 swapchain output format preference
Currently, libplacebo always tries to reconfigure the d3d11 swapchain
to a 10-bit output format because disable_10bit_sdr isn't set to true,
even when an 8-bit format is explicitly requested via
--d3d11-output-format.

Fix this by passing the requested output format preference to libplacebo.
Document that this option may be ignored.
2024-01-06 23:46:12 +01:00
Dudemanguy d8c2e33a5d DOCS/options: note that --geometry doesn't fully work on wayland
Positioning windows won't work on wayland so note it here to hopefully
avoid confusing users.
2024-01-04 14:47:06 -06:00
Guido Cella 7521b65d92 DOCS/ao: change wrong note on which driver is preferred
--ao=pipewire has been preferred on Linux for a long time, and this note
even makes it sound like alsa is preferred on any system. Just say that
the print order is the order in which the drivers are tried so this note
won't have to be updated again in the future, like --gpu-context's
documentation does.
2024-01-01 22:41:38 +01:00
nanahi abc2a7484d DOCS/man: remove "Linux desktop issues" section
This section has no reason to exist anymore because:

- No "desktop issues" sections exist for other platforms, and all other
Linux-specific issues are represented as notes for options. This section
only addressed one specific issue.

- This section was shortened significantly with commit
2c46ae8ea3, so there is no need for
this to be a separate section anymore.

- This section was shortened again with commit
d5e681e95d, when the original rationale
behind this section became outdated because GNOME has implemented the
idle inhibit protocol.

The historical info is moved to the documentation of --stop-screensaver.
2023-12-29 19:29:35 +00:00
nanahi 3bf8564a4f DOCS/man: use the correct directive type for "Warning" admonitions
Some places in the manpage uses `.. admonition:: Warning` instead of
the specific directive type  `.. warning::` for warning admonitions.
This causes the "Warning" text appearing in black color instead of red.
Correct them here.
2023-12-28 21:54:09 +01:00
nanahi 26df531b14 win32: add support for --input-cursor-passthrough option
This completes the support for all supported desktop platforms.
2023-12-28 15:45:24 +00:00
nanahi cdbc1ceb70 DOCS/options: fix documentation for --force-window window size
The value has been wrong since ca2b05c0fb,
and recent commit 8b4a995a9d still didn't
fix it.
2023-12-28 13:12:38 +01:00
der richter 4d7763e6a6 mac: add support for --input-cursor-passthrough option 2023-12-25 13:59:48 +01:00
Guido Cella dde2776655 DOCS/options: fix --image-display-duration's documentation
- --image-display-duration does not hide the OSC.
- Saying "Setting --image-display-duration" makes no sense because it is
  not a boolean and it cannot be unset.
2023-12-25 09:46:34 +01:00
der richter 0d47e48437 mac: add support for --auto-window-resize option
Fixes #9325
2023-12-23 01:15:53 +01:00
Dudemanguy 069143252a osc: allow disabling special mouse wheel behavior
When hovering certain elements over the OSC, using the mouse wheel can
result in special commands (such as seeking, changing audio tracks,
etc.) Not everyone neccessarily wants this feature, so add an option to
make it possible to disable all of it. Maybe more fine-tuned control
would be more ideal, but probably not worth it. Fixes #13096.
2023-12-21 09:13:11 +01:00
dyphire b563b2aed0 options: add --secondary-sub-ass-override
Default: strip. preserve the old behavior
2023-12-18 14:58:34 +00:00
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
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