Commit Graph

11424 Commits

Author SHA1 Message Date
Guido Cella 36b7cff582 manpage: fix watch-later-options examples
--watch-later-options-remove doesn't accept multiple options, so split
the example.

Also suggest the more correct -clr to empty the list, and remove the
workaround to not print an error with --watch-later-options=
2021-07-21 16:56:54 +00:00
Guido Cella 1d1d1fbff9 options: add watch-later-options
This allows configuring which options are saved by quit-watch-later.

Fixes #4126, #4641 and #5567.

Toggling a video or audio filter twice would treat the option as changed
because the backup value is NULL, and the current value of vf/af is a
list with one empty item, so obj_settings_list_equal had to be changed.
2021-07-21 13:19:28 +00:00
Guido Cella ccb87ad637 stats.lua: remove script-opts for the main keys (i/I)
Unlike the page switching/scrolling keys which are bound at runtime
and therefore we need to know which (configured) keys to bind, the
main keys (i/I by default) are static and can be bound via input.conf.
And indeed, the builtin bindings at etc/input.conf have them already.
2021-07-21 13:55:58 +03:00
Guido Cella 23e3b0ad98 manpage: minor fixes
- The video filter to turn the video upside-down is vflip. There is no
  filter called "flip" so using it just causes an error.
- Reword a sentence.
- Add exact and all to the values accepted by cover-art-auto. They were
  implemented in 029ff1049b but not added to the accepted arguments.
2021-07-21 13:38:11 +03:00
Avi Halachmi (:avih) 0c6ea0c0b0 DOCS/mpv.rst: add cross references to --input-test and stats 2021-07-19 22:06:50 +03:00
Avi Halachmi (:avih) 2335ee5514 stats.lua: page 4 (keys): support help-like terminal printout
While --input-test is useful, and so is page 4 of stats, until now
there was no way to simply print the list in a help-like fashion.

This commit adds such printout, invoked by the script opt
stats-bindlist=yes, which uses the existing page 4 code. This prints
the list on startup and quits immediately - like any help page.

It's awkward to invoke compared to other help pages, and it does
require the stats page to be enabled (it is by default), however
it is a script-generated output, and currently there's no other
method to print a help page generated by a script.

The printout itself is performed using lua's io.write. While reliable,
it's not the standard way for mpv to print to the terminal.

Other possible printout methods are mp.msg.info - which also prints
"[stats]" prefix on each line (ugly), or forcing term-osd and setting
an osd-message which mpv will then print at the terminal - however
that's printed to stderr, and could also be subject to timing concerns
since we quit right afterwards.

In the future we can consider changing/integrating the invocation so
that mpv itself could print a help page generated by a script, thus
solving both the awkward invocation and printout-method issues.
2021-07-19 22:06:50 +03:00
Avi Halachmi (:avih) 9fb200b641 stats.lua: add page 4: active key-bindings list
This is a scrollable page which also works nicely with the terminal
OSD. Typically there are more than 100 bound keys.

It groups the binding using fuzzy property/command/script name after
simple analysis of the command string, and then further sorts the
binding in each group according to the "complexity" of the key itself
(plain keys -> keys with modifiers, alphabetically, etc).

The alignment/grouping style is heavily inspired by @medhefgo's #8924
but otherwise it's an independent implementation.
2021-07-19 22:06:50 +03:00
Avi Halachmi (:avih) 50280197e2 stats.lua: move internal performance from page 4 to page 0
This allows adding more pages without the internal performance page
getting stuck at the middle of the list.
2021-07-19 22:06:50 +03:00
Ripose f223edb616 DOCS/options: adds documentation for secondary-sub-visibility
The --secondary-sub-visibility options was previously undocumented in
the pull request that added it. This commit adds documentation for it
and clarifies its behavior.
2021-07-12 21:07:37 +00:00
Ripose c4f982637f command: adds support for secondary subs to sub-seek and sub-step
Modifies the sub-seek and sub-step commands with a second <flags>
argument to specify whether to seek/step on the primary or secondary
subtitles. The flag is used to index into the current_track array in
cmd_sub_step_seek.
2021-07-12 21:07:37 +00:00
Ripose 34cfe9d89b command: add secondary-sub-start and secondary-sub-end properties
Adds secondary-sub-start and secondary-sub-end properties by setting
the current_track index in the m_property's priv variable which later
gets accessed in get_times. Also adds a test of the secondary subtitle
time properties in tests/subtimes.js bound to 'T'.
2021-07-12 21:07:37 +00:00
Guido Cella 383acd41a8 manpage: DEL key: clarify it refers to the osc 2021-07-12 13:16:10 +03:00
Guido Cella f049acfd43 manpage: fix typo 2021-07-08 13:22:38 +00:00
Guido Cella b3fccf0803 player: add append-play flag to loadlist
Closes #5664.
2021-07-06 15:46:45 +00:00
Dudemanguy a1c6762156 wayland: handle app id option less stupidly
Not sure what I was on when I wrote this. wayland-app-id is supposed to
default to "mpv". Just set that in the vo_sub_opts and don't do this
weird m_config_cache_write_opt thing. Also make the doc entry nicer.
2021-06-26 17:28:01 -05:00
hooke007 5f76744c61 DOCS: fix typo on seekbarkeyframes 2021-06-24 14:34:33 +00:00
rcombs 11423acf30 sub: by default, don't render timestamps after video EOF
This fixes a long-standing apparent issue where mpv would display the last
frame with no subtitles at EOF. This is caused by sub rendering switching from
video timestamps to audio timestamps when the video ends, and audio streams
often running past the timestamp of the last video frame. However, authoring
tools (most notably Aegisub) don't tend to provide easy ways to add meaningful
subtitles after the end of the video, so this is rarely actually useful.
2021-06-23 16:10:29 -04:00
Guido Cella cb56c2f888 player: change cover-art-auto behavior
This makes cover-art-auto behave more like sub-auto and audio-file-auto:

- load cover art with a language, e.g. if playing foo.mp3, foo.en.jpg
will be loaded with lang=en
- load cover art containing the media filename with fuzzy and all, e.g.
'foo (large).jpg'
- make all/2 load all images in the directory, and make fuzzy/1 the
default

These are all uncommon use cases, but synchronizing the behavior of the
external file options simplifies the code.
2021-06-23 16:23:50 +00:00
Avi Halachmi (:avih) 76b1ac57a4 osc: seekbar hover/drag: display target chapter at the title
Fixes #8925
2021-06-22 18:12:29 +03:00
Guido Cella a17d79907a manpage: add article in fuzzy explanation 2021-06-21 15:37:18 +00:00
Sagnac 96b246d928 osc: update chapter marker positions when duration changes
Commit 6abb7e3 updates the markers when the chapters change, but it
doesn't update their relative position at the bar when the duration
changes.

This means that adding chapters to a live stream would result in
corresponding chapter markers which were static while the duration
changed and thus their positions became incorrect over time until the
OSC was reinitialized.

This is fixed by observing the duration property if chapters are present
and reinitializing the OSC when the duration changes.

The live_markers user option, which determines whether the duration
property is observed when there are chapters, has been added in order to
allow disabling this behaviour as calling request_init() frequently
might have some impact on low-end systems.

The impact of request_init() on render() was measured to increase from
1-1.5 ms to 2-3 ms on a 2010 MacBook Air, while the impact was neglible
on a 2016 Surface Book (increasing only to an average of 1.4 ms from
1.3 ms for n=1500 render cycles).

The live_markers option is enabled by default.
2021-06-16 02:04:28 +03:00
Avi Halachmi (:avih) bc9d556f3a js: add mp.utils.append_file
Also, for consistency with other APIs, mp.utils.{write,append}_file
now return true on success (and still throw on any error).
2021-06-13 22:53:37 +03:00
Philip Langdale dbbf4a415d vo_gpu: vulkan: implement a VkDisplayKHR backed context
This is the Vulkan equivalent of the drm context for OpenGL, with
the big difference that it's implemented purely in terms of Vulkan
calls and doesn't actually require drm or kms.

The basic idea is to identify a display, mode, and plane on a device,
and then create a display backed surface for the swapchain. In theory,
past that point, everything is the same, and this is in fact the case
on Intel hardware. I can get a video playing on a vt.

On nvidia, naturally, things don't work that way. Instead, nvidia only
implemented the extension for scenarios where a VR application is
stealing a display from a running window system, and not for
standalone scenarios. With additional code, I've got this scenario to
work but that's a separate incremental change.

Other people have tested on AMD, and report roughly the same behaviour
as on Intel.

Note, that in this change, the VT will not be correctly restored after
qutting. The only way to restore the VT is to introduce some drm
specific code which I will illustrate in a separate change.
2021-06-11 09:54:16 -07:00
Jan Ekström 9cf5bb2979 {ci,docs,README}: update IRC references to new network 2021-06-08 16:45:22 +02:00
Chris Varenhorst 4989ccbe7a docs: fix leftover reference to the now defunct --video-sync-adrop-size option 2021-06-04 16:42:45 +00:00
Guido Cella 151b039879 manpage: mention cover-art-auto
--cover-art-auto affects rescan-external-files, and --autoload-files
affects cover art.
2021-05-28 16:10:48 +00:00
Guido Cella 029ff1049b player: load cover art with the media filename
Closes #8666.
2021-05-27 18:19:16 +00:00
Avi Halachmi (:avih) 89684976ac win32: support the property 'focused'
And also change the existing WM_KILLFOCUS handler to return 0 instead
of 'break' (which later calls DefWindowProcW), as MSDN says we should
do for WM_{KILL,SET}FOCUS.

It seems that the 'focused' property is now supported by all main VOs:
x11, macOS, wayland, Windows.

TCT/sixel/caca probably don't support it, and unknown with SDL.

Fixes #8868
2021-05-27 13:49:07 +03:00
Niklas Haas 353cccfa8c vo_gpu: replace --icc-contrast by --icc-force-contrast
Not only does this have semantics that make far more sense, it also has
a default that makes far more sense. (Equivalent to the old
`icc-contrast=inf`)

This removes the weird 1000:1 contrast default assumption which
especially broke perceptual profiles and also screws things up for
OLED/CRT/etc.

Should probably close some issues but I honestly can't be bothered to
figure out which of the thousands colorimetry-related issues are
affected.
2021-05-26 17:35:29 +02:00
Zsolt Vadasz 83b4bc622a player/command: add secondary-sub-text property 2021-05-19 15:57:01 +00:00
Your Name adcf51dccd edl: add a way to add tags
Add new header which shows up as tags/metadata (associated with
--display-tags). The way this is added means it doesn't always work,
because root->meta (see code) can be NULL for some absurd reason. But it
works for the one case I intended to use it (ytdl_hook, see next
commit), though only in default configurations.
2021-05-11 22:18:40 +02:00
Dudemanguy a88fdfde0c command: add display-width/display-height property
For some reason, this never existed before. Add VOCTRL_GET_DISPLAY_RES
and use it to obtain the current display's resolution from each
vo/windowing backend if applicable. Users can then access the current
display resolution as display-width and display-height as per the client
api. Note that macOS/cocoa was not attempted in this commit since the
author has no clue how to write swift.
2021-05-06 17:36:55 +00:00
Avi Halachmi (:avih) 8edfe70b83 DOCS/input.rst: clarify --no-input-default-keybindings docs
This commit describes more accurately what currently gets disabled
by this option - specifically also keys from mp.add_key_binding.

It's not necessarily the best behavior because libmpv clients might
want to disable mpv's own builtin keybindings while still allowing
scripts to define keys which `input.conf' can override.

In the future we might exclude mp.add_key_binding from this option,
but for now at least document this option accurately.

Fixes #8809
2021-05-04 17:26:55 +03:00
Avi Halachmi (:avih) b6aedaa726 DOCS/lua.rst: fix docs for utils.file_info
The ctime member on Windows uses FILE_BASIC_INFO.ChangeTime, which is
pretty much the same as st_ctime on POSIX.

See https://devblogs.microsoft.com/oldnewthing/20100709-00/?p=13463 :

  ... The Last­Write­Time covers writes to the file’s data stream
  (which you accomplish via the Write­File function). On the other
  hand, the Change­Time also includes changes to the file metadata,
  such as changing its file attributes ...

Fixes #8801
2021-05-03 13:25:21 +03:00
Avi Halachmi (:avih) f3b2ea9de5 command: new property: pid (process id)
Fixes #7562
2021-05-01 16:07:04 +03:00
Dudemanguy 7df9ebda6c DOCS: clarify how client/script names work
This isn't really clearly stated anywhere and could understandably lead
to some confusion.
2021-04-29 15:56:11 -05:00
Dudemanguy 029cd8a813 command: osd-dimensions: return ints and doc fixes
Some subproperties in osd-dimensions were returned as doubles despite
actually being integers. Additionally, correct a highly misleading line
in the osd-width/osd-height documentation.
2021-04-29 15:37:33 +00:00
Avi Halachmi (:avih) ef0aafbd42 DOCS: mpv.rst: minor escaping clarifications
Fixes #8767
2021-04-23 22:45:21 +03:00
Avi Halachmi (:avih) ef1d0b2cdb options: win32: ignore and deprecate --fit-border
The accurate description of this option was:
- fit-border is enabled by default. When disabled, it adds a bug where
  if the window has borders and mpv shrinks it to fit the desktop, then
  the calculation ignores the borders and adds incorrect video crop.

The option was added at commits 70f64f3c and 949247d6, in order to
solve an issue (#2935) where if mpv wanted to display a video with
size WxH, then w32_common.c incorrectly set the window to WxH, while
down-scaling the video slightly to fit (even with small sizes).

It was addressed with a new option which is enabled by default, but
does the right thing (sets the client area to WxH) only when disabled,
so that everyone who prefers their video slightly downscaled could
keep their default behavior.

(#2935 also addressed an off-by-one issue, fixed before fit-border)

While disabling the option did avoid unnecessary downscaling, it also
added a bug when disabled: the borders are no longer taken into
account when the size is too big for the desktop. Most users don't
notice and are unaffected as it's enabled by default.

Shortly later (981048e0) the core issue is fixed, and now the client
area is correctly set to WxH instead of the window (and together with
the three following commits which center the video, adds a new bug
where the window title can be outside the display - addressed next).

However, fit-border remained, now without any effect, except that it
still has the same bug when disabled and the window is too big.

Later code changes and refactoring preserved this issue with great
attention to details, and it remained in identical form until now.

Simply rip out fit-border.
2021-04-23 10:45:51 +03:00
sfan5 f1d0365a6f demux: undeprecate --cache-secs
It serves a purpose and a rework of the cache won't be coming anytime soon.
This partially reverts commit 8427292eb7.
2021-04-08 23:47:35 +03:00
un.def ef9596f78e manpage: fix a typo in the --aid option note 2021-04-05 14:31:56 +02:00
LaserEyess dd86f195a6 vo_gpu: adjust interpolation_threshold's default
When mpv attempts to play a video that is, on average, 60 FPS on a
display that is not exactly 60.00 Hz, two options try to fight each
other: `video-sync-max-video-change` and `interpolation-threshold`.
Normally, container FPS in something such as an .mp4 or a .mkv is
precise enough such that the video can be retimed exactly to the display
Hz and interpolation is not activated.

In the case of something like certain live streaming videos or other scenario
where container FPS is not known, the default option of 0.0001 for
`interpolation-threshold` is extremely low, and while
`video-sync-max-video-change` retimes the video to what it approximately
knows as the "real" FPS, this may or may not be outside of
`interpolation-threshold`'s logic at any given time, which causes
interpolation to be frequently flipped on and off giving an appearance
of stuttering or repeated frames that is oftern quite jarring and makes
a video unwatchable.

This commit changes the default of `interpolation-threshold` to 0.01,
which is the same value as `video-sync-max-video-change`, and guarantees
that if the user accepts a video being retimed to match the display,
they do not additionally have to worry about a much more
precise interpolation threshold randomly flipping on or off. No internal
logic is changed so setting `interpolation-threshold` to -1 will still
disable this logic entirely and always enable interpolation.

The documentation has been updated to reflect this change and give
context to the user for which scenarios they might want to disable
`interpolation-threshold` logic or change it to a smaller value.
2021-03-28 20:26:41 +03:00
rim 1b2e5137e0 ao_oss: add this audio output again
Changes:
- code refactored;
- mixer options removed;
- new mpv sound API used;
- add sound devices detect (mpv --audio-device=help will show all available devices);
- only OSSv4 supported now;

Tested on FreeBSD 12.2 amd64.
2021-03-15 12:42:35 +01:00
Tom Wilson d7f6eba233 player/command: add albumart argument to video-add
Enables marking of specific video sources as album art.

Co-authored-by: Jan Ekström <jeebjp@gmail.com>
2021-03-09 23:28:21 +02:00
Guido Cella 0888e53fc4 manpage: mention rotate limitations with hwdec 2021-03-02 16:14:12 +02:00
Guido Cella 8a7ef58b2d manpage: video-rotate supports arbitrary steps
The 90° step limitation must be a leftover from old behavior since any
value between 0 and 359 works now.
2021-03-02 14:00:12 +01:00
Evgeny Zinoviev f913570aad mac: support --on-all-workspaces option 2021-02-21 13:38:53 +01:00
Jan Ekström b0b37df31f filters/auto_filters: switch from scaletempo to scaletempo2
Part 1 of "look how well it performs, then start cleaning up the
old one."

Closes #8376
2021-02-15 00:13:03 +02:00
Érico Rolim ce3fe08bd4 DOCS: fix cplugins information in libmpv.rst. 2021-02-12 23:25:08 +02:00
Mia Herkt f60725263c
man: update deband-threshold default 2021-02-05 15:37:16 +01:00