Commit Graph

74 Commits

Author SHA1 Message Date
Julian f0719727cc stats: always print perfdata total
There's no point in disabling it anyway
2017-10-09 20:40:32 +02:00
Julian 1231b1ae68 stats: make add_header() append at current position 2017-10-09 20:40:32 +02:00
Julian 96ef2aa48b stats: print perfdata total by default
There is enough space now
2017-10-09 20:40:32 +02:00
Julian 56029b6b59 stats: mark dummy as such 2017-10-09 20:40:32 +02:00
Julian 9470ccd8ae stats: correctly re-eval ASS tag usage
Fixes #42
2017-10-09 20:40:32 +02:00
Julian b93efd0a52 stats: make page keybinding repeatable
There's no reason it's not.
2017-10-09 20:40:32 +02:00
Julian 6c7aae769a stats: remove table in table
Almost cosmetic change.
This tables-in-table was done back when we actually processed strings
but that's long ago now and no longer needed nor useful.
2017-10-09 20:40:32 +02:00
Julian 783046f5ff stats: resilience against accidential timer removal
Previously I could trigger a bug with intense button mashing, however,
was unable to reproduce it and therefore debug it.
This change now seems to be resilient against button mashing, let's hope
it really is.
2017-10-09 20:40:32 +02:00
Julian 21603dd5af stats: allow keybindings for specific page
A keybinding in input.conf like:
   e script-binding stats/display-page-2
can be used to directly show the respective page (2, in this case)
2017-10-09 20:40:32 +02:00
Julian 98ddbf8c34 stats: support for multiple "pages" of stats
Please note that the latest version of this script needs a very recent
version of mpv (from yesterday, to be precise, see the readme).
For older versions, please go to "releases".

HOW IT WORKS:
While the stats are visible (i.e. text is printed to the OSD) a
subsequent click on a numeric key (1, 2, ...) will display the
corresponding "page".
This works no matter if the stats are toggled or just shown as a single
invocation. In case of a single invocation, the newly displayed page
will be shown for the full duration again.
The selected page will be remembered (not persistantly though).

So far, only 3 pages are available.
1: the default page, stats as they used to be
2: extensive VO performance stats (to be redesigned/changed soon)
3: dummy

In the future, many more pages are possible.

Implementation is likely to change again (functionality will stay
the same). A new timer had to be introduced to remove the forced
keybindings in the oneshot case. The toggle case can remove them without
a timer. Ensuring that each mode won't remove timers of the other mode
didn't really turn out neat.
Therefore, I intend to change this again, maybe by merging the
oneshot case into the toggle case.
2017-10-09 20:40:32 +02:00
Julian c04ff9dce0 stats: remove check for lua timer function
We now require a modern mpv version.
`property_aliases` is kept for future use.
2017-10-09 20:40:32 +02:00
Niklas Haas 1691b978cf stats: rescale graphs to make the average align with the center, if possible
For vsync measurements this is not currently done because they don't
track their average
2017-10-09 20:40:32 +02:00
Niklas Haas 22a8b99f7a stats: add support for `vo-passes`, which replaces `vo-performance`
Due to the large amount of per-pass data, the function takes a parameter
indicating whether or not to print a simplified view instead.

The overall intent is to print the simplified view for now, but supposed
printing the full view on a dedicated "tab" (or extra view type), and as
such, `o.print_perfdata_passes` will go away again. I've only introduced
it for now so users can play around with this functionality if they want
to, until Argon- gets around to implementing stats "tabs".
2017-10-09 20:40:32 +02:00
Niklas Haas 6d10d5a29f stats: update HDR peak for upstream changes
This no longer reports cd/m² but now reports a relative peak as a
multiple of the SDR reference brightness.
2017-10-09 20:40:32 +02:00
Julian fa80ac13b6 stats: add support for deprecated properties
Previously, we used a property and when it was unavailable we assumed it
doesn't exist before assuming it really is just unavailable. This lead
to unnecessarily falling back to deprecated properties which made mpv
print deprecation warnings.
Now we can really check if a property is not known to mpv.
The alternative would've been to check the error part of mp.get_property
and perform string comparisons on the returned error message.

Not sure if supporting old mpv versions is actually worth it though.

Fixes #37 #36
2017-10-09 20:40:32 +02:00
Julian 6f9a7d1fdb stats: comment to remind me about deprecated properties 2017-10-09 20:40:32 +02:00
Ricardo Constantino 7429eace57 stats: add new versions of decoder and VO dropped frame counts 2017-10-09 20:40:32 +02:00
Julian bd0d0befc0 stats: put vsync ratio and jitter on the same line
Free some vertical space. Hope this doesn't hurt visibility.
2017-10-09 20:40:32 +02:00
Julian 8bc6c91f4a stats: declare function as local
Apparently forgot this one
2017-10-09 20:40:32 +02:00
Julian c02d89fcd1 stats: use container-fps together with fps (as fallback)
This was already done for the actual stats a few months ago.
Now it is also used by the perfdata coloring code.
2017-10-09 20:40:32 +02:00
Julian c4ea382894 stats: rename option timing_total to print_perfdata_total
Should make its purpose more clear. Also add a comment to further
explain its use.
2017-10-09 20:40:31 +02:00
Julian 5a9ccfdcb8 stats: add vsync-ratio and vsync-jitter
Both come with graphs enabled by default.
They can be disabled using the options plot_vsync_ratio and
plot_vsync_jitter (see the readme regarding customization).

In case both graphs are deactivated the ratio and jitter properties will
be printed on the same line to save some space.

One more user-visible/noticeable change: the maximum used to scale the
values for each graph is no longer calculated each time the stats are
shown but instead when collecting the data. This means the maximum
can actually be higher than all values currently present in a graph's
data buffer. This makes it easier to judge a graph's values, especially
since as we have no axis labels.
To prevent high values staying max forever graph data buffers are
cleared when toggling (can be disabled). It was never useful to
keep old data and simply append newer data (with a time skip) anyway.
2017-10-09 20:40:31 +02:00
Julian 78cbe40fa5 stats: add some documentation for generate_graph() 2017-10-09 20:40:31 +02:00
Julian b58b812384 stats: access less variables outside function's state 2017-10-09 20:40:31 +02:00
Ricardo Constantino (:RiCON) fa0b1f071a stats: add new container-fps that deprecates fps 2017-10-09 20:40:31 +02:00
Ricardo Constantino (:RiCON) 49d64997ef stats: remove hwdec-active property 2017-10-09 20:40:31 +02:00
Julian 97c1cd6658 stats: fix bug introduced in earlier commit
Commit 76387aba26574d0d96af688cf11d10bd165171f7 broke the script in case
of timing_total=true.
2017-10-09 20:40:31 +02:00
Julian 3f4fd36aa8 stats: fix comment typo 2017-10-09 20:40:31 +02:00
Julian 6c7385c539 stats: disable coloring peak performance data
The peak value is probably not very well suited to draw many conclusions
from it.
2017-10-09 20:40:31 +02:00
Julian 0242165b3c stats: change coloring of performance data
Previously it used display-fps to determine coloration even when
display-sync was not even used.
2017-10-09 20:40:31 +02:00
Julian 9d8495a960 stats: save ASS sequences locally
Instead of querying them constantly.
Also add a tiny bit of documentation to some variables.
2017-10-09 20:40:31 +02:00
Julian 9b439e9453 stats: only print graphs when ASS tags are good 2017-10-09 20:40:31 +02:00
Julian 4ee669e4db stats: clearify a few descriptions/labels 2017-10-09 20:40:31 +02:00
Julian 7dcebb016c stats: don't show video/audio-speed-correction when 0
This used to be the case, I'm not sure when it changed.
The current way of 'hiding' it in case of 0 is not exactly
good and relies on the OSD representation. It could be done
better by querying the video-sync-active property but that would
require querying yet one more thing...
2017-10-09 20:40:31 +02:00
Niklas Haas aace3e4cde stats: add HDR signal peak information
Added to mpv in commit a14f9249. Simply shown after the gamma curve if
available, since it's semantically attached to it.

Also regroup some of the colorimetry options to make this fit (and for
them to make more sense)
2017-10-09 20:40:31 +02:00
Julian 90ecf52a45 stats: add sum of timing values
Display an additional line with the sum of all three timing values.
Disabled by default.

I didn't see the necessity to also create a graph for this line
2017-10-09 20:40:31 +02:00
Julian 3663a411d3 stats: put colormatrix, primaries and gamma together
Saves a bit of space.
2017-10-09 20:40:31 +02:00
Julian 8bbbab9523 stats: change highlighting of performance data
Add a yellow highlight to the existing red highlight.
Red is still used once the available time is exhausted, yellow is
supposed to be a warning when the headroom is getting small.
The threshold is configurable.
2017-10-09 20:40:31 +02:00
Julian 485c3549d7 stats: declare functions as local
Because why not.
Simply reorder functions instead of forward declaring stuff.
2017-10-09 20:40:31 +02:00
Julian 5e0d36c515 stats: align graphs
Graphs are now aligned. This required a change in the layout of
performance data. Reason is a wrong (but intended) calculation
of vector drawing sizes in libass to maintain compatibility.
This essentially prevents text following the graph.
To achieve alignment only monospaced text can precede the graph.
This led to the layout changing slightly when graphs are shown.
2017-10-09 20:40:31 +02:00
Julian 946d45a421 stats: change the way the output is built
Instead of creating new strings with the content of the previous
one followed by some new content we now write all content into
tables that are concatenated in the end.
This is unlikely to improve performance but at least it will
cut down on all these temporary, growing strings polluting memory.
2017-10-09 20:40:31 +02:00
Julian a256d61ef4 stats: rewrite parts of performance data
Major changes:
  - graphs are only drawn when in toggled mode
  - performance data is retrieved every ith frame (default: 5)
  - highlighting of performance data (numbers): add a highlight
    when the summed numbers (last/avg/peak) exceed 1/display-fps
2017-10-09 20:40:31 +02:00
Julian de38bd0f81 stats: add performance data
Display various performance data about frames and their
display/rendering. Additionally plot graphs for this data.

This is experimental and pretty much just a test at this point and by
far not final.
2017-10-09 20:40:31 +02:00
Julian 2de778f699 stats: update stats when file changes
Only in toggled mode and actually only when the video output is
reconfigured. This should cover the relevant cases.

Fixes #22
2017-10-09 20:40:31 +02:00
Julian fcacf82865 stats: small spelling correction 2017-10-09 20:40:31 +02:00
Julian f8bafd4734 stats: use redraw_delay for timer period
Previously the delay was slightly shortened but a user explicitly
setting a specific delay most likely expects the stats to refresh
in exactly the frequency he desired.
2017-10-09 20:40:31 +02:00
Ricardo Constantino (:RiCON) 8db09be51a stats: always print title if different from filename 2017-10-09 20:40:31 +02:00
Julian c387b1db6f stats: make a warning more visible
Print it to console and especially OSD upon each invocation
2017-10-09 20:40:31 +02:00
Julian a87af63365 stats: rename some functions
More useful names
2017-10-09 20:40:31 +02:00
Julian 2f5ee99509 stats: add toggling of stats
You can now either show the stats once or toggle their display. Both are
using different key bindings which are additionally configurable now.

Please bear in mind that "toggling" means "redraw every x seconds for x
seconds". Therefore, this approach is prone to problems especially when
something else is printing text to the OSD as well as every of these
calls will overwrite each other. This is currently a limitation of mpv.

Fixes #18
2017-10-09 20:40:31 +02:00