1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-10 03:31:32 +00:00
Commit Graph

6304 Commits

Author SHA1 Message Date
Guido Cella
f0c3d466f9 DOCS/man/osc: fix custom button example formatting
The examples for each button were rendered in the same line.
2025-03-31 12:02:03 +02:00
Tom Grimwood-Taylor
a407e13f83 misc/language: add a forced flag to the track add commands 2025-03-31 11:47:52 +02:00
Lynne
9964104a6e vd_lavc: enable FFv1 hwaccel by default
FFmpeg recently got a hardware accelerated decoder for FFv1.
The decoder has been tested on all major vendors and operating systems.
Intel support is currently disabled as all of their drivers have issues
with buffer device addresses.
Since its a software-defined implementation, internal issues can be fixed
and the overall implementation optimized further.

With that, I think it should be safe to enable it by default.
2025-03-26 18:40:58 +01:00
한승민
d9dc84c0fc vo_kitty: add auto-multiplexer-passthrough option
Terminal multiplexers like (screen, tmux, ...) do not support the kitty
image protocol (as of yet), to go around this DCS escape sequences are
used (`\ePtmux;...\e\` for tmux, `\eP...\e\` for screen). This option
allows passing thorugh the kitty image escape sequences.

`\033\\` suffixes from `KITTY_ESC_IMG_SHM` and `KITTY_ESC_DELETE_ALL`
have been removed. This makes it easier to wrap the escape sequences in
a DCS control sequence since there will be no `\033` in them to escape
(as multiplexers require escaping the escapes within the DCS data
string). `DCS_GUARD_WRITE` and `DCS_GUARD_APPEND` macros have been added
to wrap escape sequences in DCS control sequence based on the
availability of the `priv->dcs_prefix` property.
2025-03-26 18:25:49 +01:00
Guido Cella
e88864aef3 commands.lua: add remember_input script-opt
Allow clearing the input line on close. Fixes #16104.
2025-03-26 14:56:48 +01:00
nanahi
e70d67f7ca DOCS/man/options: remove bogus messages about the client API
The messages referred to "no" prefixes like --no-audio not working with
the client API. The language was removed in
b1ee92ad4a.

Remove the messages which are bogus and incorrect now.
2025-03-26 01:29:52 +01:00
Kacper Michajłow
8e4493b4a2 Revert "input.conf: bind MBTN_MID to align-to-cursor"
It can be too easy to change the video position without a single way to
undo the change. Also, this is mostly useful for images. Binding can be
brought back in a better way with an image profile or another method
that is more resistant to accidental clicks.

This reverts commit e98d3b62ec.
2025-03-23 22:49:00 +01:00
verygoodlee
ae3420fe66 DOCS/man/input: correct the mode flag of apply-profile command
The default mode actually named `apply` instead of `default`,
it's a mistake that has existed for a long time.
2025-03-12 10:50:32 +01:00
llyyr
4b1315a67f DOCS/man/input: remove stray newline
this breaks the html conversion
2025-03-09 10:56:15 +01:00
Guido Cella
e28c6ceea3 console.lua: default to --osd-font without completions
Currently --osd-font is the default for select, and a monospace font is
the default for free-form text mode. We can also default to the
proportional --osd-font for mp.input.get clients that don't specify
completions and thus don't need alignment, which is most clients.

In builtin scripts, this is the case for filtering stats key bindings.
2025-03-08 19:09:23 +00:00
Guido Cella
0b3cc3a167 commands.lua: split this script out of console.lua
It was suggested by CogentRedTester in
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858727729 and
https://github.com/mpv-player/mpv/pull/10282#issuecomment-1858809580 and
by avih that making running commands an mp.input client is a better
architecture.

A practical advantage is that completions are calculated in a different
thread, which prevents hanging when completing slow/network filesystems.

script-binding console/enable becomes script-binding commands/open,
though the console one is kept as an alias. I took the opportunity to
rename this because open makes more sense for a graphical modal, and it
is the word used in mp.input and user-data.

script-message-to console type becomes script-message-to commands type,
though the console one is kept as an alias. It is also changed to
automatically close on submit without having to append '; keypress ESC'
as you don't need to keep the console open after running prefilled
commands.

Also convert to double quotes like other scripts and rename some
inconsistent functions.
2025-03-08 19:09:23 +00:00
Guido Cella
ce6a52d40a console.lua: add history_path field to mp.input.get
This allows saving the history to all mp.input.get clients.

Needed to split running commands out of console.lua.
2025-03-08 19:09:23 +00:00
Guido Cella
05438fc081 console.lua: add autoselect_completion field to mp.input.get
This selects the first completion when pressing Enter when one wasn't
already manually selected.

Needed to split running commands out of console.lua.
2025-03-08 19:09:23 +00:00
Guido Cella
3c175f0114 console.lua: let the complete callback return a character to append
Let the complete callback return the character to append to the selected
completion.

I didn't want to document this because it's specifically meant for
properties and unlikely to be needed by other scripts, but silently
interpreting the 3rd return value can screw you over if you do something
like

return candidates, code:find('[%w_]*$')

I was doing this in my lua-repl script, and find() returns the end
position as the 2rd argument, this becomes the 3rd return value and gets
appended to completions. So you have to do

return candidates, code:find('[%w_]*$'), nil

Needed to split running commands out of console.lua.
2025-03-08 19:09:23 +00:00
Guido Cella
c7e62ee28c DOCS/man/lua: update complete docs referencing autocompletion 2025-03-08 19:09:23 +00:00
Kacper Michajłow
ecc31ecab3 player/command: add attached-picture flags to track add command 2025-03-08 00:21:06 +01:00
Kacper Michajłow
7b9290f620 player/command: add visual-impaired flags to track add command 2025-03-08 00:21:06 +01:00
Kacper Michajłow
3147eca943 player/command: convert flags to OPT_FLAGS for track add commands 2025-03-08 00:21:06 +01:00
Kacper Michajłow
45c6077756 stream_mpv: restrict only to network links 2025-03-07 14:19:15 +01:00
Kacper Michajłow
93ea3df0a9 player: add mpv:// protocol
This is useful to run mpv from URL handler. Can be used to start mpv
from you web browser or anything that would trigger url handler for
given protocol. Only safe protocols are allowed.

Current solutions to run mpv in such context are to spawn IPC proxy and
run mpv when requested, but this is in most cases not necessary.

Currently the protocol is added in mpv.desktop. Windows related
registration will follow in future changes.
2025-03-07 00:15:23 +01:00
fkroener
dd062dea61 DOCS/man/vo: xx-color-management-v4 -> color-management-v1 2025-03-05 12:27:22 +01:00
Kacper Michajłow
1582705f27 demux_mkv: add demuxer-mkv-crop-compat option
I don't expect the Matroska specification to be adjusted for this to
work soon, so in the meantime, follow the spec as written and add an
option to support most files in the wild.

I would prefer this to never be an option, but it looks like it's
unavoidable.

Recently, FFmpeg added cropping support for Matroska, so we don’t want
to be the odd one out by doing it differently...

See for more details:
https://github.com/ietf-wg-cellar/matroska-specification/pull/947
https://gitlab.com/mbunkus/mkvtoolnix/-/issues/2389
https://github.com/mpv-player/mpv/pull/13446

Fixes: #15800
2025-03-04 19:33:27 +01:00
nanahi
630a036f64 DOCS/man/input: add details for chapter property documentation
The documentation does not mention that using add/cycle to change
the property is subject to --chapter-seek-threshold option,
and the fact that a chapter number of -1 indicates a playback
position before the start of the first chapter.
2025-03-02 07:14:16 +01:00
nanahi
c18d544dae DOCS/man/input: add note for add command repeatability
The change in 007c728ad2 also
applied to the add command.
2025-03-02 07:14:16 +01:00
Guido Cella
996c098725 console.lua: add a keep_open flag to mp.input
With input.select this allows building nested submenus without the
flicker of console quickly closing and reopening, and also doing
multiple selections, to e.g. cycle through different values of a
property, or increase a property multiple times.

With input.get this is used to change the default behavior to closing by
default on submit. It was argued by avih that this is more useful, and
indeed Github code search shows that everybody is calling
input.terminate() unconditionally on submit, so the impact of the change
should be low, and restoring the old behavior is as easy as passing
keep_open = true, which is just ignored in older mpv versions.
2025-02-24 16:26:58 +01:00
nanahi
7dd5154971 clipboard: remove --clipboard-enable
Clipboard can be now disabled with --clipboard-backends-clr so
--clipboard-enable is redundant.
2025-02-24 16:23:41 +01:00
nanahi
8368d55282 clipboard: add --clipboard-backends option
This allows specifying a priority list of clipboard backends
to use. This is mostly useful on Linux where multiple clipboard
backends exist.
2025-02-24 16:23:41 +01:00
Guido Cella
9551de6385 console.lua: replace repl references
These are leftovers from the original repl.lua name. Also remove some
redundant comments.
2025-02-24 16:12:53 +01:00
Guido Cella
d8a79a1ca8 osc.lua: allow wheel bindings for custom buttons 2025-02-24 16:01:05 +01:00
Guido Cella
72bb227bf1 console.lua: highlight matching parts of selectable items
fzy returns which characters matched the search for every item, so use
this to highlight them.

This defaults to a light blue color that is readable with both black and
white (selected) backgrounds.

The returned positions are just bytes, so we can't put ASS tags or
escape sequences around each byte because that would break displaying
multibyte UTF-8 characters. Only put them around sequences of matched
positions, and only when the sequences start and end at actual character
positions.
2025-02-24 15:56:20 +01:00
Guido Cella
978b219889 options: default to --prefetch-playlist=yes
--prefetch-playlist improves performance by starting to read the next
file in the last second or playback or while viewing an image. This is
obviously noticeable with playlists of direct media URLs, but can also
make a difference on local slow hardware, mainly large (in bytes) images
on HDDs. You can easily see the difference with 10+ MB images.

Since e7a253614c and 24db17d10f fixed niche issues, and it's known not
to cause other issues by users using since 2017 who haven't reported
issues, enable it by default to improve performance.

The only flaw is that it doesn't support ytdl-hook URLs, so in Youtube
playlist, it does a web request with ffmpeg that is doomed to fail since
the last second of playback, though this doesn't cause practical
disadvantages.
2025-02-24 15:54:33 +01:00
Guido Cella
ba47f8f42a DOCS/options: ease --prefetch-playlist warning
There is no known issue with --prefetch-playlist and file-local-options.
It works just fine with them, and people have been using it since 2017
and haven't reported related issues. So ease the warnings to not scare
users away from using a useful option.

Also when --prefetch-playlist was implemented it also prefetched the
stream cache until 559a400ac3 removed it - see #6753. So if such issues
ever existed, they were fixed by not making it prefill the stream cache.
Now it doesn't do much, it only opens a connection to the next file, and
the cache of the next video starts empty.
2025-02-24 15:54:33 +01:00
Guido Cella
e98d3b62ec input.conf: bind MBTN_MID to align-to-cursor 2025-02-24 15:53:34 +01:00
Guido Cella
f1f6184025 input.conf: bind Ctrl+left click to drag-to-pan
An alternative is to bind to right click only for images, but since we
will likely bind right click to the context menu once it works on
platforms other than Windows, bind to ctrl+left click to not have to
change it later.
2025-02-24 15:53:34 +01:00
Guido Cella
8da6e8ad55 input.conf: bind Ctrl+wheel to cursor-centric-zoom
Probably not worth adding to etc/restore-old-bindings.conf since it's an
extension of add video-zoom.
2025-02-24 15:53:34 +01:00
Guido Cella
aa5d37bc8e positioning.lua: add this script
This script provides script bindings to pan videos and images, making
mpv a better image viewer out of the box.

Fixes #3038, fixes #15020.
2025-02-24 15:53:34 +01:00
Guido Cella
64531af454 console.lua: allow persisting the command history 2025-02-24 15:53:22 +01:00
Kacper Michajłow
f1e1a0be85 include: move public headers to own directory
This ensures a clear separation between public and private headers. It
also makes it clear in Meson and prevents the accidental use of private
headers.
2025-02-23 01:40:12 +01:00
Kacper Michajłow
d759e26fd0 libmpv: use correct header directory name
libmpv headers are installed to `mpv/`, so why are we pretending it is
`libmpv`?

Fixes documentation, libmpv meson dependency, tests.
2025-02-23 01:40:12 +01:00
Dudemanguy
b90c1bb21b DOCS/man/mpv: remove bogus --cdrom-device mention
Missed in 131973806d
2025-02-21 17:23:45 +00:00
Yozora80
131973806d Revert "stream_{bluray,cdda,dvdnav}: deprecate setting device after schema"
This reverts part of PR #15899 (commit dd6e3a0ece).

"Why is this even useful?": It's very useful for multi-disc playlists. Compare:
`mpv bd:///DISC{1..4}`
`mpv -\{ bd:// --bluray-device=DISC1 -\} -\{ bd:// --bluray-device=DISC2 -\} -\{ bd:// --bluray-device=DISC3 -\} -\{ bd:// --bluray-device=DISC4 -\}`
2025-02-21 15:26:23 +00:00
Guido Cella
e32beaa0db input.conf: bind Shift+{HOME,END} to go to the first and last file 2025-02-20 15:54:11 +00:00
Guido Cella
036528d44d input.conf: bind HOME to seek to the beginning 2025-02-20 15:54:11 +00:00
Dudemanguy
25a0c8307d player: add an optional mute flag when framestepping
Need to shuffle some stuff around but it's pretty simple. Mute the
audio stream before the frame step and then unmute it when we're done.
It's exactly the same as the default play mode otherwise.
2025-02-20 15:50:03 +00:00
Dudemanguy
723da77def DOCS/man/mpv: explain how to select and navigate through cdda
It's not exactly obvious and worth mentioning.
2025-02-20 15:49:45 +00:00
Dudemanguy
dd6e3a0ece stream_{bluray,cdda,dvdnav}: deprecate setting device after schema
This is allowed but it's pretty weird. You'd end up typing something
like dvd:////dev/sr0 or cdda:///dev/sr0 (notice the differing amount of
/). Why is this even useful? Just use the matching --cdda-device option.
There's no need to have two ways to do the same thing here.
2025-02-20 15:49:45 +00:00
der richter
9618aa3b21 DOCS/man/options: remove outdated wid embedding docs for cocoa
the old deprecated cocoa backend that supported wid embedding was
removed with fc4db18.
2025-02-20 15:48:44 +00:00
nanahi
f9271fbffe DOCS/man/options: fix missing space in hwdec doc
Fixes: d7159e4662
2025-02-19 17:26:39 +00:00
Guido Cella
6df54fa7b1 DOCS/man/options: document that --save-position-on-quit affects loadfile 2025-02-19 18:19:23 +01:00
nanahi
13f94700d9 f_decoder_wrapper: add --video-aspect-method=ignore
This adds --video-aspect-method=ignore to replace --video-aspect-override=0.
--video-aspect-override=0 and --video-aspect-override=-1 will no longer be
handled specially. For compatibility, 0 is mapped to always use ignore
and -1 is always mapped to always use container.

"no" is now the replacement for --video-aspect-override=-1, which is
internally remapped to -2 to avoid using a deprecated value.
2025-02-18 23:05:02 +00:00