Commit Graph

12004 Commits

Author SHA1 Message Date
David Vaughan 9e162d2604 player: add loadfile insert-next commands
This commit adds two new commands (`insert-next` and `insert-next-play`)
which mirror the existing commands, `append` and `append-play` in
functionality, with the difference that they insert directly after the
current playlist entry, rather than at the end of the playlist.

This change gives MPV a piece of functionality already found in (for
example) Spotify's media player: "play next". Additionally, using the
new `insert-next` command, users can trivially write a script to play a
new piece of media immediately without otherwise clearing or altering
the remainder of the playlist.
2024-02-26 02:03:21 +00:00
Dudemanguy b71af009dc DOCS/man: remove outdated softvol entry
69ae23fdd1 removed this option completely.
2024-02-25 19:09:35 -06:00
Leonardo Boss 58ed620c06 player: add ao-volume option, to set the system volume at startup
closes #12353
2024-02-25 23:57:35 +00:00
Dudemanguy 74b4c3c531 player: set hidpi-window-scale to no by default
This has defaulted to yes for a very long time, but evidentally it
annoys a lot of people (including myself). My argument is that this
makes no sense. mpv is for videos; not text. A 1920x1080 video should
open as 1920x1080 regardless of whatever the DPI settings of the OS is.
This can get very silly when you consider watching a 4k video which will
get this additional scale factor which is virtually never desirable.
Whether or not the OS and/or WM prevents it from getting larger than the
screen depends on a lot of things.

Previously some windowing backends required that this option be set to
yes in order to report a dpi scale value other than 1, but this should
be fixed with the previous commits. The only difference is whether or
not to scale the window by the additional factor.

Fixes #13465.
2024-02-24 20:31:08 +00:00
Dudemanguy 3b23b2c22a DOCS/options: clarify hidpi-window-scale 2024-02-24 20:31:08 +00:00
der richter d6fdc0ae74 DOCS: make mentions of macOS consistent
change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc
consistent. use the official naming macOS.
2024-02-21 20:46:53 +01:00
nanahi 24afc00b8c DOCS/man: document Ctrl+WHEEL_UP/WHEEL_DOWN keybinds
Also remove the existing redundant wordings.
2024-02-21 18:55:43 +00:00
llyyr 362959ace3 DOCS/mpv: update ancient profiles config example
Hopefully actually useful now. Also updates big-cache to not be smaller
than the current default.
2024-02-20 23:11:39 +01:00
der richter 0e441525cf vo: make libmpv last in the auto-probing order for cocoa-cb only
this partially reverts commit 7b5a258. back then the only properly
working vo on macOS was cocoa-cb (libmpv). it would always use the
deprecated opengl cocoa backend or no vo at all. because of that libmpv
was moved to the top of the auto-probing order, so the preferred vo
was used on macOS only.

we now have a working vulkan gpu/gpu-next backend on macOS which should
be the new default vo. though disabling the auto-probing again for
libmpv would probably cause the undesired behaviour on macOS that
cocoa-cb would never be auto selected again. especially if not build
with vulkan support or without vulkan driver on macOS, this would lead
to no video output at all. so instead of completely reverting the
mentioned commit, we instead move libmpv to the bottom of the
auto-probing order but only auto select it when mpv was built with
cocoa-cb support. this restores the previous behaviour on all other
platforms besides macOS, but also lets us auto select cocoa-cb if
supported.
2024-02-20 20:42:02 +01:00
nanahi 98005003da DOCS/man: add description of display-names property for wayland
On wayland, depending on the wl_output protocol version used,
the display-names property can have different values. Mention
this in the documentation, like for other platforms.
2024-02-16 23:06:13 +00:00
nanahi e19061605f DOCS: document --input-preprocess-wheel option
Document the use cases for enabling or disabling the wheel preprocessing.
Also note that this option has no effect on any filtering already done
by the OS/driver.
2024-02-15 16:44:32 +00:00
gaesa d8f4749c34 DOCS/lua: clarify `repeatable` and `complex` for `add_key_binding`
The current documentation lacks clarity regarding the interaction
between the `repeatable` and `complex` options. Through an analysis
of the source code (`player/lua/defaults.lua` and
`player/js/defaults.js`), it was observed that the `repeatable` option
is only meaningful when the `complex` option is not enabled.
Additionally, the `complex` option in the existing documentation is
confusing, actually `fn` can be called on key repeat when `complex` is
`true` and `repeatable` is not `true`.

To address these issues, the documentation for the `repeatable` option
was updated to specify that it only applies when the `complex` option is
not set to `true`. Furthermore, the description of the `complex` and
`event` were revised to acknowledge the occurrence of key repeat events.
2024-02-15 16:43:46 +00:00
Dudemanguy 195aa7fd96 DOCS/options: mention that sub-clear-on-seek can now break things
This is technically due to the previous commits that made subtitle
rendering more efficient by eliminating redraws, but working around this
particular edge case is useless. The sub-clear-on-seek option was
originally introduced in d5940fabcd and
specifically is a workaround for completely broken mkv files. There is
no reason to use it otherwise. Because that option disables all
duplicate checking and the previous commits rework subtitle rendering in
the still image case to be dependent on keeping track of packets, the
end result is that you will get the same line rendered multiple times.
However the important case of broken mkv files with duplicate ReadOrder
fields still work just fine with --no-video. So instead of bothering
trying to make this option "work", just clarify that stuff can break
since, again, there's no reason to use it other than as a workaround for
broken files.
2024-02-15 16:43:11 +00:00
Mohammad AlSaleh 023d02c950 DOCS/man: more words about --teletext-page
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-02-13 10:44:41 +01:00
Mohammad AlSaleh a1bda5b34d sub: allow setting lavc txt_page special values via teletext_page
* Range of accepted values for teletext_page now include 0 and -1.
 * 0 means "subtitle" and -1 means "*".
 * Make 0 the default.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-02-13 10:44:41 +01:00
Dudemanguy 003fb15cbb player/command: add deinterlace-active property 2024-02-07 14:50:09 +00:00
Dudemanguy 8dbbc2ad82 player: add an auto option to deinterlace
Deinterlacing required that the user set it on/off themselves, but we
actually have handy flags for detecting if a frame is interlaced. So
it's pretty simple to make an auto option using that. Unfortunately,
life is not quite that simple and there are known cases of false
positives from the ffmpeg flags so we can't make auto the default value.
However, it still may have some utility for some people, and the
detection could potentially be improved upon later. Closes #10358.
2024-02-07 14:50:09 +00:00
Dudemanguy 343a5fd345 player: remove all rpi-specific code
vo_rpi and its related code has pretty much historically been a
disaster in mpv. The build regularly gets broken and since nobody uses
it, it takes months for anyone to notice. There was also that time where
fullscreen was broken for about a year and a half. Also building in waf
was entirely broken for about a couple of years or so due to mysterious
reasons no one ever figured out (meson magically fixed it).

Anyways, once again the build is broken due to rpi being forgotten about
again, but instead of pretending to support this crap. Just drop it all.
Nowadays, mmal hwdec is a relic since these devices are better off using
the v4l2m2m ffmpeg fork instead which actually uses KMS properly. RPI 1
and 2 probably can't do this and will remain broken but oh well blame
Broadcom for being special snowflakes and not using standard APIs (my
rockpro worked out of the box; just saying). RPI 2 is nearly 10 years
old anyways, so I think you can afford a new SBC by now. If we were
nicer, there would be a deprecation period, but this is broken in the
last major release anyway so too late.

Closes #13402.
2024-02-05 17:41:06 +00:00
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
Ikko Eltociear Ashimine dd48a53b65 various: fix capitalization of 'GitHub' 2023-12-27 22:11:58 +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
JohhanSam 68eaaf0da3 DOCS/interface-changes: add --secondary-sub-ass-override
Option added in b563b2ae
2023-12-24 13:09:13 +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
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