Display statistics for the currently played file in mpv.
stats.lua in your
to autoload the script.
The script is binding itself to
I (however, not overriding your own
bindings) and can therefore be invoked by pressing these keys.
i will show the stats once while
I is toggling them.
You can set different bindings either by customizing this script (see below) or
by using the
script_binding input command (in
e script-binding stats/display_stats E script-binding stats/display_stats_toggle
By default Source Sans Pro is used as font. You can download it here.
This script requires mpv version 18.0 or above.
An older version (see Releases) can be used with a minimum required mpv version of 0.9.3.
There are no further/external dependencies.
How to get graphs?
Graphs are enabled by default.
Please note that they are only shown when stats are toggled and that only the
opengl VO is exposing frame timing data.
Turn graphs off with
plot_vsync_jitter=no (see Customization).
Why are my frame timing values colored?
Red: your hardware needs more time to render/present/upload a frame than available.
Yellow: your hardware needs more than 85% of the available time. This is merely a warning.
mpv has to show (render/present/upload) one frame every
In case of a 60Hz display this means there's
1/60 = 0.016666 sec (
16666 μs) time
per frame available.
Given display-resample is not used the video's FPS will be used for these calculations. Note that there are further parameters and coherences (depending on user configuration) influencing fluent playback and this is just a very general indicator.
Turn it off by setting
timing_warning=no (see Customization).
timing_warning_th=0.85 to set a factor determining when to warn (yellow).
Can I get a sum of all three timing values?
print_perfdata_total=yes to add an additional line showing the values
summed up (see Customization).
The graph's position is jumping
Please use a font with monospaced digits.
The default font does meet this requirement. Either download it (see Usage)
or set your own with
font_mono (see Customization).
font does not need to be a monospaced font.
Why does the layout change when showing graphs?
Long story short: there can't be text behind the graph drawings. (Why)
You can configure various settings by creating a file called
stats.conf in a folder
lua-settings within your mpv config folder (where your
mpv.conf is in).
Please refer to the
o table within the script for possible option names and
consult mpv manual regarding
To change e.g. the text display duration your
stats.conf may look like:
A more sophisticated example:
key_oneshot=e key_toggle=E plot_perfdata=no print_perfdata_total=yes font=Arial font_mono=Monospaced font_size=8 font_color=262626 border_size=0.5
Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR (blue green red).