Commit Graph

11378 Commits

Author SHA1 Message Date
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
garoto f6a92659fd manpage: fix PDF build
Not clear what exactly makes it fail with this change, but making
the note paragraph added in d5ab5482a9 a note structure seems to fix it.
2021-01-23 18:24:21 +02:00
Chris Varenhorst 51852aad52 docs: Fix an old style parameter reference
`--vf format:stereo-in=help` no longer works.  It now must be `--vf=format:stereo-in=help`
2021-01-20 01:15:36 +02:00
Leo Izen d5ab5482a9 manpage: document off-by-one loop-file behavior
loop-file counts the number of zero-seeks, not playthroughs,
which makes its counter off by one compared to loop-playlist.
2021-01-07 09:15:29 -05:00
Leo Izen 1251f7bbf9 manpage: rename OS X references to macOS
Apple has decided that Mac OS X is now named macOS for the time
being. For consistency, it makes sense to use the same name for the
operating system in all places where it occurs. This commit renames
OS X to macOS in the documentation in places where it was otherwise
still using the old name.
2021-01-03 12:05:30 -05:00
Avi Halachmi (:avih) 4f129a3eca input.conf syntax: support custom quotes !XstringX!
Where X is any ASCII char chosen by the user. An argument is only
interpreted as custom-quoted if it starts with '!' and the line doesn't
end right after it. Custom quotes don't interpret backslash-escape.

This change only affects command arguments which mpv parses (not array
commands), and not tokens before the arguments (where applicable - key
name, input section, command prefixes, command name).
2020-12-31 12:54:33 +02:00
Avi Halachmi (:avih) bb439efe0d input.rst: fix typo commands -> arguments 2020-12-31 12:54:33 +02:00
Emmanuel Gil Peyrot 5f2b60a645 vd_lavc: add VP8 to the default allowed hwdec codec list
It is supported at least on Intel, from gen8 to gen11, and still gives a
pretty welcome reduction of CPU usage on my gen9.
2020-12-30 17:30:01 +02:00
der richter af26402948 mac: use visible frame rectangle for window geometry calculation
currently we use the whole screen rectangle to calculate the window
geometry. this doesn't take the menu bar or the Dock into account.

by default use the visible screen rectangle instead. this is also a
change in behaviour, since the window can't be placed outside of this
rectangle anymore. also add an option to change to the old behaviour,
because it can still be useful in certain cases, like placing the window
directly underneath the menu bar when used a desktop background.

Fixes #8272
2020-12-19 21:37:55 +02:00
Guido Cella 7ca14d646c console: use wl-paste on Wayland 2020-12-14 22:43:34 +00:00
Guido Cella 6aa7dbdb84 manpage: document background transparency
--alpha=yes doesn't affect only transparent videos and images, but also
the background. I spent time researching how to implement transparent
backgrounds and had no idea that they already worked at least on
Wayland.

Background transparency will work on X11 when
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is
merged. It doesn't work on Windows. No idea about macOS. Either way,
this paragraph already says that it only works on certain environments
twice.

References #6590
2020-12-08 17:27:25 +00:00
Guido Cella d4bf179e78 manpage: clarify that you can prefetch m3u8 urls
With the current wording, I thought that playlist-prefetch doesn't
prefetch the next url within a playlist of m3u8 urls, but it makes a big
difference, and I would have enabled it earlier if it wasn't for this
paragraph.

This makes it clear that you can prefetch any file, but that it won't
prefill the cache with the video data. This is true for any video,
there's nothing unique about HLS streams in the behavior of this option.
2020-12-08 17:27:14 +00:00
Dudemanguy 08848e76d9 player: add --screen-name and --fs-screen-name
Simple groundwork for adding a couple of user options that allow
selecting the screen with a string name. The next two commits implements
these options for xorg and wayland.
2020-12-06 17:36:43 +00:00
Guido Cella d479dfd67d manpage: clarify profile-cond requires underscores
While this says that _ is replaced with -, it doesn't say that you HAVE
to use _. This isn't obvious and I didn't understand why my profile
conditions with - weren't working at first. Seeing as the person who
reproted #8324 ran into this as well, this may be worth clarifying.
2020-12-06 17:31:28 +00:00
Avi Halachmi (:avih) 62fb374349 vo_sixel: change default dither to "auto"
For two reasons:
1. It was counter intuitive that there's an "auto" value (which is
   actually a libsixel value and not an mpv one), but it's not the
   default value - our default was Atkinson.
2. "auto" provides better dithering than Atkinson with libsixel, which
   is especially noticeable with smooth gradients - where Atkinson has
   visible banding.

In libsixel 1.8.2 the "auto" value maps to Atkinson if the output
palette has up to 16 colors, or to Floyd-Steinberg otherwise (e.g.
using fixed palette with 256 colors chooses Floyd-Steinberg).
2020-11-27 00:25:32 +02:00
Avi Halachmi (:avih) 59c32a04b0 vo_sixel: fix the image corruption with mlterm
The issue was that we only uploaded the palette to the terminal when it
changed (once on init with fixed palette, every frame with dynamic
palette with trheshold=-1, only on scene change with threshold >= 0).

Now we upload it on every frame, and it seems to fix the mlterm image
corruption both with fixed palette and also with dynamic palette with
threshold (i.e. at frames which did not upload a palette).

It's not entirely clear why it's required with mlterm.

It would seem that the palette which libsixel uses with fixed palette
matches the built in default palette in xterm, but not in mlterm.
With dynamic palette we can guess that mlterm resets the palette after a
sixel image, but that's not confirmed.

Uploading the palette on every frame doesn't seem to slow down xterm
when using fixed palette - not clear yet why uploading a different
palette (when using fixedpalette=no) slows it down while same palette
on every frame doesn't.

In mlterm there's no slowdown either way - and now also no corruption.
2020-11-27 00:25:32 +02:00
Avi Halachmi (:avih) 1bb2665e3d vo_sixel: support --vo-sixel-exit-clear[=yes]
By default we still clear the screen, but now it's possible to leave the
last sixel image on screen.

Allows mpv to be used as img2sixel of sorts, but with our auto-fit and
various mpv scaling/filters etc.
2020-11-27 00:25:32 +02:00
rcombs 4dcaf70b96 Revert "options: disable vsfilter blur compat by default"
This reverts commit 3d17e19c2c.

The effect of turning off this setting is that mpv doesn't tell libass what
the video stream's resolution is. This happens to result in some files having
their transforms scaled in ways that give higher performance (as described
in #7435) because libass happened to guess a video resolution that resulted
in transforms yielding smaller bitmaps, but it's just as easy for the opposite
to happen depending on the resolutions and effects involved.

The option's name is also somewhat misleading: setting the storage size affects
blur, but it also affects stroke (which is far more important for the vast
majority of scripts) and 3D transforms (which look very screwy when done wrong).
2020-11-22 17:37:43 +02:00
Shreesh Adiga 6ad3e2bfbd vo_sixel: Add aspect ratio based output centering
Resize the image based on the dimensions reported by
vo_get_src_dst_rects to correctly handle aspect ratio
that might be set/ignored.

Added pad-x and pad-y options for padding.
These options will be used to remove the extra padding.
Some terminals report the padding of 2px in the ioctl
dimensions which can't be used for displaying sixel
output. These options can be used for fine tuning
the output video resolution.

Now all the terminal size detection and calculation logic
is done in a single function at resize. Also top and left
values are computed from the dst_rect parameters to simplify
the logic for the aspect ratio based centering.

Additionally vo-sixel-rows and vo-sixel-cols options
have been added to enable the user to override the values
in case of failures with get_terminal_size2.

This commit also adds ability to handle video zoom correctly.
Whenever video-zoom is triggered, the src and dst rects
will be updated. Scaling seems to work well now.
2020-11-22 13:34:25 +02:00
Emanuele Torre 38275338ee doc: split BNF definitions of <command> and <argument> in separate lines
Having them in the same line made it hard to read them in the man page
since they are formatted in the same way and they look as though they
are only one definition.
2020-11-22 01:23:42 +02:00
Leo Izen 9b5672ebed manpage: document improved --playlist security
Recent versions of mpv have applied security checks to --playlist
that previously only existed if playlist files were played as an
input directly. This commit documents this change and how to work
around it, in the event that playlist files are trusted.
2020-11-18 17:30:07 -05:00
Avi Halachmi (:avih) 3710c154d4 docs/input.rst: document the mouse-pos property 2020-11-16 20:29:58 +02:00
wm4 26fc70dbfd path: do not use old_home for win32 exe dir
Apparently mpv supports loading config files from the same directory as
the mpv.exe. This is a fallback of some sort. It used the old_home
mechanism.

I want to add a warning if old_home exists, but that would always show
the warning on win32. Obviously we don't want that.

Add a separate exe_dir entry to deal with that.

Untested, but probably works.

Mistakenly reverted as part of the default configuration directory
location switch-back in aa18a8e1cd.

Separation of the mpv executable directory from old_path is a
good change now that we warn about the old_config directory also
existing.

Fixes #8232
Fixes #8244
Fixes #8262
2020-11-16 00:44:40 +02:00
Avi Halachmi (:avih) 932c1ada0f js: report scripts CPU/memory usage statistics
This can be viewed at page 4 of the internal stats display (i or I).

CPU time report is the same as at lua.c, but untested - doesn't seem
to work on windows - also not for lua.

TL;DR: Set env MPV_LEAK_REPORT=1 to enable js memory reporting stats.
       This also almost doubles the memory usage by js scripts.

For memory reporting, we don't have enough info by default, because
even when using a custom allocator, mujs doesn't report the old size
(on free or realloc) because it doesn't track this value, and as
a result we can't track the overall size.

Our option are either to track the size of each allocation on our own,
or use talloc which tracks this value.

However, using talloc for mujs allocations adds a considerable
overhead, and almost doubles(!) the overall memory used, because each
individual allocation includes a considerable talloc header, and mujs
does many small allocations.

So our solution is that by default we behave like previously - not
using a custom allocator with mujs, and stats does not display memory
usage for js scripts.

However, if the env var MPV_LEAK_REPORT is set to 1, then we use
a custom allocator with talloc and track/report memory usage.

We can't switch allocator at runtime, so an mpv instance either tracks
or doesn't track js scripts memory usage, according to the env var.
(we could use a property and apply it whenever a new script starts,
so that it could change for newly launched scripts, but we don't).
2020-11-15 20:36:04 +02:00
Guido Cella 34f2143e8f manpage: properties fixes
- Explain which properties are writeable.
- Mark edition-list/N/id as writable.
- Remove (R) from some read-only properties since none of the others
have it.
- Add osd-dimension/ to its subproperties.
- options/<name> isn't read-only.
- focused works on macOS because of 82eda2e. Though it shouldn't be
possible to observe it without raising VO_EVENT_FOCUS.
2020-11-11 18:20:33 +00:00
Guido Cella 0ed4d66290 manpage: document the property-change event 2020-11-11 18:20:33 +00:00
Guido Cella fb819f069f manpage: document video-frame-info sub-properties
The picture type is explained in /usr/include/libavutil/avutil.h
Other subproperties in /usr/include/libavutil/frame.h
And there is a more detailed explanation for repeat_pict in
/usr/include/libavcodec/avcodec.h
2020-11-11 18:20:33 +00:00
Guido Cella 39ca957874 manpage: remove redundant "Return(s) "
...from the property descriptions that include it, and reformat the
paragraphs.
And say "Returns" in idle-active.
2020-11-11 18:20:33 +00:00
Guido Cella 5da326a8bb manpage: document demuxer-cache-state better 2020-11-11 18:20:33 +00:00
Guido Cella 81dfaa4962 manpage: be consistent with booleans
When possible, refer to booleans with "Whether..." since it can refer to
both yes (using input.conf and mp.get_property) and true (using the JSON
IPC or mp.get_property_native/bool), else explicitly say yes/true.
Say "true" for subprocess and osd-overlay named arguments since you
can't use them in input.conf and you will typically use them with the
boolean true in the named arguments, like the subprocess example in the
manpage does (though the string "yes" also works).
Subproperties that can't be accessed with the / syntax like
demuxer-cache-state's bof-cached and eof-cached always return true,
never yes.
2020-11-11 18:20:33 +00:00
Dudemanguy 790647314c DOCS: correct interface-changes.rst
delete-watch-later-config was introduced in mpv 0.33.0 not mpv 0.31.0.
2020-11-07 18:55:03 -06:00
Shreesh Adiga 19913921eb video/out/vo_sixel.c: Implement sixel as a output device
Based on the implementation of ffmpeg's sixel backend output written
by Hayaki Saito
https://github.com/saitoha/FFmpeg-SIXEL/blob/sixel/libavdevice/sixel.c

Sixel is a protocol to display graphics in a terminal. This commit
adds support to play videos on a sixel enabled terminal using libsixel.
With --vo=sixel, the output will be in sixel format.

The input frame will be scaled to the user specified resolution
(--vo-sixel-width and --vo-sixel-height) using swscaler and then
encoded using libsixel and output to the terminal. This method
requires high cpu and there are high frame drops for 720p and
higher resolution videos and might require using lesser colors and
have drop in quality.  Docs have all the supported options listed
to fine tune the output quality.

TODO: A few parameters of libsixel such as the sixel_encode_policy
and the SIXEL_XTERM16 variables are hardcoded, might want to
expose them as command line options. Also the initialization
resolution is not automatic and if the user doesn't specify the
dimensions, it picks 320x240 as the default resolution which is not
optimal. So need to automatically pick the best fit resolution for
the current open terminal window size.
2020-11-07 18:51:49 +02:00
Leo Izen dfa5ae2ad6 manpage: document av1 addition to --hwdec-codecs default setting
Document the change to add AV1 to the list of default hwdec
codecs, in commit 172146e9f7.
2020-11-05 23:05:54 +02:00
soredake b4d9980870 input.conf: add default keybindings for sub-scale 2020-10-27 17:13:56 +00:00
Guido Cella e49404cba9 console: let type set the cursor position
This allows keybindings such as:

a script-message-to console type "seek :0 absolute" 6
% script-message-to console type "seek  absolute-percent" 6

The cursor position 0 isn't allowed because it has the weird effect of
filling the console with the text twice, leaving the cursor in the
middle.
Negative positions would put the cursor n characters before the end, and
positions greater than the text's length at the end. They seem to work
at first, but the console breaks when you move the cursor, so they
aren't allowed.
It seems that float values don't cause issues, but I'm using the
argument's floor anyway to be safe. Using >= 1 instead of > 0 ignores
values like 0.5.
2020-10-27 17:10:50 +00:00
Ricardo Constantino 93f84b514a
ytdl_hook: support alternative youtube-dl path
Allows using a youtube-dl not in PATH or a compatible fork of
youtube-dl.
2020-10-27 15:42:39 +00:00
Vladimir Panteleev a92466c289 command: add delete-watch-later-config
This introduces the delete-watch-later-config command, to complement
write-watch-later-config. This is an alternative to #8141.

The general problem that this change is attempting to help solve has
been described in #336, #3169 and #6574. Though persistent playback
position of a single file is generally a solved problem, this is not
the case for playlists, as described in #8138.

The motivation is facilitating intermittent playback of very large
playlists, consisting of hundreds of entries each many hours
long. Though the current "watch later" mechanism works well - provided
that the files each occur only once in that playlist, and are played
only via that playlist - the biggest issue is that the position is
lost completely should mpv exit uncleanly (e.g. due to a power
failure).  Existing workarounds (in the form of Lua scripts which call
write-watch-later-config periodically) fail in the playlist case, due
to the mechanism used by mpv to determine where within a playlist to
resume playback from.

The missing puzzle piece needed to allow scripts to implement a
complete solution to this problem is simply a way to clean up the
watch-later configuration that the script asked mpv to write using
write-watch-later-config. With that in place, scripts can then
register an end-file event listener, check the stop playback reason,
and in the "eof" and "stop" case, invoke delete-watch-later-config to
delete any saved positions written by write-watch-later-config. The
script can then proceed to immediately write a new one when the next
file is loaded, which altogether allows mpv to resume from the correct
playlist and file position upon next startup.

Because events are delivered and executed asynchronously,
delete-watch-later-config takes an optional filename argument, to
allow scripts to clear watch-later configuration for files after mpv
had already moved on from playing them and proceeded to another file.

A Lua script which makes use of this change can be found here:
https://gist.github.com/CyberShadow/2f71a97fb85ed42146f6d9f522bc34ef
(A modification of the one written by @Hakkin, in that this one takes
advantage of the new command, and also saves the state immediately
when a new file is loaded.)
2020-10-22 19:53:35 +00:00
sfan5 3d9d041a11 command: expose underlying pixfmt for hwdec 2020-10-16 17:48:05 +02:00
Philip Langdale 9a1942ac95 manpage: Document behaviour of *nix configuration directories
The original documentation here is unclear, so let's describe the
behaviour we actually have. Inspired by wm4's updated docs but
obviously not identical because we're not changing any of the
behaviours.
2020-10-16 00:47:18 +03:00
Philip Langdale 949e06c86c Revert "path: switch back to using non-XDG config dir by default"
This reverts commit 269f0e743e.
2020-10-16 00:47:18 +03:00
Philip Langdale aa18a8e1cd Revert "path: do not use old_home for win32 exe dir"
This reverts commit c3694f0acb.
2020-10-16 00:47:18 +03:00
Philip Langdale 8a2449e3d5 Revert "manpage: reference standard for configuration file location"
This reverts commit 67b4a96e45.
2020-10-16 00:47:18 +03:00
Tim Gates 2cfeee68d4 docs: fix simple typo, unminimze -> unminimize
There is a small typo in DOCS/man/options.rst.

Closes #8165
2020-10-14 19:45:52 +00:00
Chris Varenhorst 4797594347 DOCS: fix typo on sub-filter-regex-enable 2020-10-12 03:00:29 -04:00
wm4 67b4a96e45 manpage: reference standard for configuration file location 2020-10-09 19:06:27 +02:00
Dudemanguy 5dc16a4a18 Revert "wayland: add wayland-display-socket option"
Pointless feature that can be done with environment variables. It was
also implemented incorrectly and broke autoprobing.

This reverts commit 015b676875.
2020-10-07 08:41:47 -05:00
Dudemanguy 015b676875 wayland: add wayland-display-socket option
As per the client API, a client can connect to any arbitrary wayland
socket. mpv has always just passed NULL which connected to the
compositor currently in use, but one could just as easily pass the name
of a different socket (i.e. the value of WAYLAND_DISPLAY). Here, we just
expose this argument as a user configurable option. If the user passes a
socket name that does not exist, then print a warning and fall back to
NULL.
2020-10-06 17:45:59 +00:00