Commit Graph

654 Commits

Author SHA1 Message Date
Kacper Michajłow 81cf697e28 stats.lua: fix missing newline when print_perfdata_passes is enabled 2023-10-14 12:30:46 +02:00
Kacper Michajłow 73db283296 stats.lua: sort filter parameters to ensure consistent output 2023-10-14 12:30:46 +02:00
Kacper Michajłow 52fc378494 stats.lua: don't print custom pixel format, when hwdec
There is already other place to indicate hw decoding. "cuda" or "d3d11"
is not a pixel format.
2023-10-14 12:30:46 +02:00
Kacper Michajłow e5446399e1 stats.lua: remove leading zeros from pass timings
Makes it more readable in my opinion.
2023-10-14 12:30:46 +02:00
Kacper Michajłow 31ba5cd6df stats.lua: add frame info 2023-10-14 12:30:46 +02:00
Kacper Michajłow 6ff165f4a4 stats.lua: simplify fps display
- rename prefix to `Framerate:`
- if both estimated and specified values are the same display fps once
- skip the suffix if both the estimated and specified values agrees
2023-10-14 12:30:46 +02:00
Kacper Michajłow c4b8ddeee3 stats.lua: adjust spacing between values a little 2023-10-14 12:30:46 +02:00
Kacper Michajłow 499a9d90ab stats.lua: show HDR meta if not equal to 203
SDR white (203) is indeed not interesting, but anything else, even if
lower is.
2023-10-14 12:30:46 +02:00
Kacper Michajłow f2f33ac1e8 stats.lua: separate video parameters from video out
Source video parameters are interesting, but we mix them with video
output/target parameters. Which will differ. Add "Display" showing
true output params from VO, including HDR passthrough info and
everything. This makes much more consistent output and alows to quickly
diagnose how is source video translated to target display.
2023-10-14 12:30:46 +02:00
Guido Cella 9c9ba3cf30 console.lua: print the log and input line to the terminal 2023-10-11 21:09:40 +00:00
Guido Cella 8134f18c28 ytdl_hook.lua: set metadata with single tracks
Use EDL for single tracks with metadata to set the uploader, channel url
and description metadata with --ytdl-format=best. Currently, these are
only set with the other ytdl formats with video and audio in different
streams.

The uploader tag is commonly available in sites other than Youtube too,
so it may be simpler to always use EDL with single tracks.
2023-10-11 21:05:33 +00: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 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
Christoph Heinrich e475e1abc0 console: support utf8 for table formatting 2023-10-07 22:45:50 +00:00
Christoph Heinrich d2c92f7653 console: cull lines outside of visible area
Lines that would be outside of the visible area are now culled.
The log messages were already culled, however with the introduction
of suggestions, they also needed a small update.
2023-10-07 22:45:50 +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
Christoph Heinrich 659353b7d6 console: show suggestions for completion
Tab completion now shows a list of all potential completions
between the log messages and prompt.
The text is colored to differentiate it from regular text.
The color matches the theme and is similar to the mpv logo.
2023-10-07 22:45:50 +00:00
Christoph Heinrich 898a4cd8a8 console: refactor text styles for log levels
The text styles are now in a table.
The color definitions of the theme where the colors were taken from
are now included in a comment for future reference.
The colors have been converted to BGR as is required by ASS.
2023-10-07 22:45:50 +00:00
Christoph Heinrich 9c22d6b438 osc: move the idle logo behind other overlays
The default `z` of an overlay is 0, which is used by e.g. console.lua.
Having the idle logo at a `z` of 1000 means that it ends up above the
console (and anything that don't set a value higher then 1000).
It doesn't make sense for the idle logo to overshadow other things, so
put it at -1000 instead to prevent that.
2023-09-27 23:05:53 +00:00
Dudemanguy c0c595b588 osc: remove shared-script-properties usage
0b4860248b added user-data which is
completely superior and makes this property obsolete. We've already had
one mpv release with the osc using user-data so drop this.
2023-09-27 14:04:59 +00:00
Guido Cella 649409140c console.lua: complete properties after cycle-values 2023-09-27 14:03:44 +00:00
Mike Will 9cd2a9fc48 osc.lua: fix calculation for slider's min-max average
Average of two numbers is given by the sum of the two numbers
divided by two. It's gone unnoticed because `s_min` is
basically always zero.
2023-09-25 16:07:34 +00:00
llyyr 181eddc80e osc: add scrolling to audio/sub buttons
Consistent with other osc buttons now
2023-09-17 00:03:45 +02:00
Kacper Michajłow ff7da2f5c0 stats.lua: don't display full frame crop
It is valid to have 0x0+w+h crop, but no need to print that.
2023-09-08 02:27:08 +00:00
NRK 022dbfc977 osc: add scrolling to the seekbar
the osc currently allows for changing volume via scrolling when on top
of the volume icon. this does the same thing for the seekbar by allowing
seeking via scroll.
2023-09-02 18:14:02 +02:00
llyyr 998c3a163c osc: remove toggle for forced only subpictures
DVD/PGS are definitely not common, and ones that make use of the forced
subpictures flag even less so. For this button to be useful, the
subtitle track would need to be DVD or PGS, the track would need to make
use of the forced flag, the user would have to know what forced
subpictures are, and the user would need to have the preference of only
viewing forced subpictures on a subtitle. The function of this button is
too niche to be on the osc, if this behavior is desired the user can
simply bind a key in their input.conf. Moreover, this button only adds
confusion because there's no intuitive way to show what it does, and
there's no explanation for it anywhere in the manuals. osc real-estate
is quite limited as it is, so let's not waste any space on buttons with
highly questionable utility at best and confusing or bad UX at worst.
2023-08-31 17:38:08 +00:00
Kacper Michajłow c865ce9455 stats.lua: display --video-crop values when used 2023-08-31 17:37:42 +00:00
Niklas Haas 7f9b1b32a5 stats.lua: enable --tone-mapping-visualize while stats shown
Except in oneshot mode. Controllable via new option.
2023-08-30 17:10:13 +02:00
Kacper Michajłow 15ada7c41c stats.lua: display hdr metadata and peak detection 2023-08-29 20:58:44 +02:00
Dudemanguy 92fe8f1a4e osc: replace sub-forced-only with sub-forced-events-only 2023-08-29 16:39:00 +00:00
Kacper Michajłow 2a969a833f stats.lua: add hints about scrolling 2023-08-28 21:14:26 +02:00
Kacper Michajłow ce64b5687b stats.lua: refactor video params display
- Move window scale to scaled resolution line
- add deinterlacing display
- rename "Gamma" to "Transfer"
- reorder to colormatrix/primaries/transfer as commonly used by
  ffmpeg/ffprobe
2023-08-28 21:14:26 +02:00
Kacper Michajłow 42f8c71aa0 stats.lua: remove dummy new lines from headers 2023-08-28 21:14:26 +02:00
Kacper Michajłow 52bf44d2e0 stats.lua: display actual output video size after anamorphic correction
This makes much more sens than frame size that is the same as native
one.
2023-08-28 21:14:26 +02:00
llyyr a19aefac37 osc: fix margin for forced-only subs toggle in bar layout
This ensures the spacing between forced-only sub toggle button and the
volume button matches the spacing between the volume and the fullscreen
button on bottombar/topbar layouts
2023-08-27 16:28:24 +00:00
llyyr d0bc907806 osc: only add sub forced-only toggle to layout for DVD/PGS subs
Fixes: 945d7c1eda

Previously, we would have a button with empty string added to the layout
for non DVD/PGS subtitles. This would cause there to be an invisible
button present that would take up space and could still be clicked
despite being invisible when the current subtitle track was not DVD/PGS.
The idea was that the button would be invisible for regular subtitle
tracks, and be visible as "[ ]"/"[F]" for DVD/PGS subtitle tracks.

This commit modifies the bar and box layouts to only add this button if
the current subtitle track is DVD/PGS. This results in there no longer
being an invisible button, and also prevents it from taking up space.
The button is added to layout as before when the current subtitle track
is DVD/PGS, matching the same logic as before.
2023-08-27 16:28:24 +00:00
Kacper Michajłow cc3c2ad8fb stats.lua: display output resolution if it differs to native one
Useful when filters are applied that alters the video resolution, like
crop. Also display aspect ratio per each resolution.
2023-08-18 16:39:35 +02:00
Kacper Michajłow 540a5eb5ab stats.lua: hide window scale in fullscreen
It display window (not fullscreen) scale, which is quite confusing as it
doesn't match any other currently displayed values.
2023-08-18 16:39:35 +02:00
Kacper Michajłow e85d70f84f stats.lua: use video-params/aspect-name 2023-08-13 15:04:33 +00:00
fireattack 3954660f03 ytdl_hook: improve Windows exe search with suffix 2023-08-13 14:40:36 +00:00
Dave dfbdf75165 osc: support speed-independent time-remaiing display
The new OSC config option "remaining_playtime" controls whether the
time-remaining display considers speed (yes - default) or ignores it.
2023-08-11 14:30:42 +03:00
Dudemanguy 0bed2a2263 build: remove outdated generated directory
This only existed as essentially a workaround for meson's behavior and
to maintain compatibility with the waf build. Since waf put everything
in a generated subdirectory, we had to put make a subdirectory called
"generated" in the source for meson so stuff could go to the right
place. Well now we don't need to do that anymore. Move the meson.build
files around so they go in the appropriate place in the subdirectory of
the source tree and change the paths of the headers accordingly. A
couple of important things to note.

1. mpv.com now gets made in build/player/mpv.com (necessary because of
   a meson limitation)
2. The macos icon generation path is shortened to
   TOOLS/osxbundle/icon.icns.inc.
2023-07-31 19:00:06 +00:00
llyyr 4198e6f35f osc: don't add margins to osc-deadzonesize
Currently, the osc will add a margin of (osc_height / 2) to the
deadzonesize for the window controls, the topbar and the bottombar,
i.e. when osc-deadzonesize=1, the osc will show up even if the cursor
is only hovering (osc_height / 2) pixels above or below it. This is not
what this option is supposed to do according to the manual, instead
osc-deadzonesize=1 should result in the osc only appearing when it is
directly hovered. The user can simply set osc-deadzonesize=0.9 or so if
such a margin is desired, instead make the option work as advertised by
removing this margin.

It should be noted that osc-layout=box does not share this behavior,
and it already works as advertised in the manual.
2023-07-21 20:24:18 +02:00
Christoph Heinrich cf0373e15b console: sort the output from the `help` command
Closes #11927
2023-07-14 13:06:01 +00:00
m154k1 cbb1af64d5 stats.lua: set sans-serif as default font
sans is deprecated and unsupported on some platforms.
2023-07-10 16:58:54 +02:00
rcombs 945d7c1eda osc: add toggle for forced-only subs 2023-06-25 11:01:58 +02:00
Christoph Heinrich 83acd93c6a lua: read_options: find script-opts prefix at index 1 exactly
Finding the prefix in the key is not enough, the key has to actually
start with the prefix. Otherwise a key like `uosc-font_scale` will not
only match the `uosc-` prefix, but also the `osc-` prefix, resulting
in a logged warning about `-font_scale` being an unknown key.
2023-06-01 15:11:55 +03:00
Guido Cella c5211dbf4a console.lua: add a script-opt for the border size
Because I find the console log easier to read with a thicker border.
2023-04-26 16:30:01 +00:00
Arnold Stanovský c50f536bd1 ytdl_hook: fix clip start and end 2023-04-12 02:14:09 +00:00
Dudemanguy 7ae7fc0112 auto_profiles: try to distinguish invalid properties better
6e4a76db08 attemped to reject invalid
properties and print an error for users so they actually know that
something is going wrong. This worked by simply checking if the property
not found error is returned, but it is actually perfectly possible for a
property to not be found (different than being unavailable just to be
clear here) at first and then show up later. An example would be
user-data which can be created at any time. It's also possible with
subproperties of things like track-list where a new track could be added
later.

In light of this, let's soften the error checking logic here with a
simple trick. mpv already keeps track of all toplevel properties and it
can be easily retrieved with the "property-list" property, so just cache
that. When we get a property not found error, instead of rejecting it,
try to match it something in the property-list first. If we have a
match, then consider the property valid and allow the script to behavior
normally. If not, we reject it. This approach means property names that
are obviously wrong like "fake-property-here" will reliably get rejected
and something like "user-data/test" works as usual. The downside is that
errors in the subproperty level are not caught, so something like
"track-list/0/fake-property" would still be considered valid and the
user gets no warning that this won't work. We'll just accept the
compromise and hope this isn't too common.

Fixes #11550.
2023-04-07 01:48:55 +00:00