Something went wrong. Try again.
🎥 Command line media player
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299STATS=====
This builtin script displays information and statistics for the currentlyplayed file. It is enabled by default if mpv was compiled with Lua support.It can be disabled entirely using the ``--load-stats-overlay=no`` option.
Usage-----
The following key bindings are active by default unless something else isalready bound to them:
==== ==============================================i Show stats for a fixed durationI Toggle stats (shown until toggled again)? Toggle displaying the key bindings==== ==============================================
While the stats are visible on screen the following key bindings are active,regardless of existing bindings. They allow you to switch between *pages* ofstats:
==== ==================1 Show usual stats2 Show frame timings (scroll)3 Input cache stats4 Active key bindings (scroll)5 Selected Tracks Info (scroll)0 Internal stuff (scroll)==== ==================
If stats were displayed by toggling, these key bindings are also active:
==== ==================ESC Close the stats==== ==================
On pages which support scroll, these key bindings are also active:
==== ==================UP Scroll one line upDOWN Scroll one line down==== ==================
On page 4, these key bindings are also active:
==== ==================/ Search key bindings==== ==================
Configuration-------------
This script can be customized through a config file ``script-opts/stats.conf``placed in mpv's user directory and through the ``--script-opts`` command-lineoption. The configuration syntax is described in `mp.options functions`_.
Configurable Options~~~~~~~~~~~~~~~~~~~~
``key_page_1`` Default: 1``key_page_2`` Default: 2``key_page_3`` Default: 3``key_page_4`` Default: 4``key_page_5`` Default: 5``key_page_0`` Default: 0``key_exit`` Default: ESC
Key bindings for page switching while stats are displayed.
``key_scroll_up`` Default: UP``key_scroll_down`` Default: DOWN``key_scroll_search`` Default: /``scroll_lines`` Default: 1
Scroll key bindings and number of lines to scroll on pages which support it.
``duration`` Default: 4
How long the stats are shown in seconds (oneshot).
``redraw_delay`` Default: 1
How long it takes to refresh the displayed stats in seconds (toggling).
``persistent_overlay`` Default: no
When `no`, other scripts printing text to the screen can overwrite the displayed stats. When `yes`, displayed stats are persistently shown for the respective duration. This can result in overlapping text when multiple scripts decide to print text at the same time.
``file_tag_max_length`` Default: 128
Only show file tags shorter than this length, in bytes.
``file_tag_max_count`` Default: 16
Only show the first specified amount of file tags.
``term_clip`` Default: yes
Whether to clip lines to the terminal width.
``plot_perfdata`` Default: yes
Show graphs for performance data (page 2).
``plot_vsync_ratio`` Default: yes``plot_vsync_jitter`` Default: yes
Show graphs for vsync and jitter values (page 1). Only when toggled.
``plot_tonemapping_lut`` Default: no
Enable tone-mapping LUT visualization automatically. Only when toggled.
``flush_graph_data`` Default: yes
Clear data buffers used for drawing graphs when toggling.
``font`` Default: same as ``osd-font``
Font name. Should support as many font weights as possible for optimal visual experience.
``font_mono`` Default: monospace
Font name for parts where monospaced characters are necessary to align text. Currently, monospaced digits are sufficient.
``font_size`` Default: 20
Font size used to render text.
``font_color`` Default: same as ``osd-color``
Color of the text.
``border_size`` Default: 1.65
Size of border drawn around the font.
``border_color`` Default: same as ``osd-border-color``
Color of the text border.
``shadow_x_offset`` Default: same as ``--osd-shadow-offset``
The horizontal distance from the text to position the shadow at.
``shadow_y_offset`` Default: same as ``--osd-shadow-offset``
The vertical distance from the text to position the shadow at.
``shadow_color`` Default: same as ``osd-shadow-color``
Color of the text shadow.
``alpha`` Default: 11
Transparency of text when ``font_color`` is specified, of text borders when ``border_color`` is specified, and of text shadows when ``shadow_color`` is specified.
``plot_bg_border_color`` Default: 0000FF
Border color used for drawing graphs.
``plot_bg_border_width`` Default: 1.25
Border width used for drawing graphs.
``plot_bg_color`` Default: 262626
Background color used for drawing graphs.
``plot_color`` Default: FFFFFF
Color used for drawing graphs.
``vidscale`` Default: auto
Scale the text and graphs with the video. ``no`` tries to keep the sizes constant. ``auto`` scales the text and graphs with the OSD, which is scaled with the window or kept at a constant size, depending on the ``--osd-scale-by-window`` option.
Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR(blue green red).
Different key bindings~~~~~~~~~~~~~~~~~~~~~~
Additional keys can be configured in ``input.conf`` to display the stats::
e script-binding stats/display-stats E script-binding stats/display-stats-toggle
And to display a certain page directly::
i script-binding stats/display-page-1 h script-binding stats/display-page-4-toggle
Active key bindings page~~~~~~~~~~~~~~~~~~~~~~~~
Lists the active key bindings and the commands they're bound to, excluding theinteractive keys of the stats script itself. See also ``--input-test`` for moredetailed view of each binding.
The keys are grouped automatically using a simple analysis of the commandstring, and one should not expect documentation-level grouping accuracy,however, it should still be reasonably useful.
Using ``--idle --script-opt=stats-bindlist=yes`` will print the list tothe terminal and quit immediately. Long lines are clipped to the terminal widthunless this is disabled with ``--script-opt=stats-term_clip=no``. Escapesequences can be disabled by adding ``-`` before ``yes``, i.e.``--script-opt=stats-bindlist=-yes``.
Like with ``--input-test``, the list includes bindings from ``input.conf`` andfrom user scripts. Use ``--no-config`` to list only built-in bindings.
Internal stuff page~~~~~~~~~~~~~~~~~~~
Most entries shown on this page have rather vague meaning. Likely none of thisis useful for you. Don't attempt to use it. Forget its existence.
Selecting this for the first time will start collecting some internalperformance data. That means performance will be slightly lower than normal forthe rest of the time the player is running (even if the stats page is closed).Note that the stats page itself uses a lot of CPU and even GPU resources, andmay have a heavy impact on performance.
The displayed information is accumulated over the redraw delay (shown as``poll-time`` field).
This adds entries for each Lua script. If there are too many scripts running,parts of the list will simply be out of the screen, but it can be scrolled.
If the underlying platform does not support pthread per thread times, thedisplayed times will be 0 or something random (I suspect that at time of thiswriting, only Linux provides the correct via pthread APIs for per thread times).
Most entries are added lazily and only during data collection, which is whyentries may pop up randomly after some time. It's also why the memory usageentries for scripts that have been inactive since the start of data collectionare missing.
Memory usage is approximate and does not reflect internal fragmentation.
JS scripts memory reporting is disabled by default because collecting the dataat the JS side has an overhead and will increase memory usage. It can beenabled by setting the ``--js-memory-report`` option before starting mpv.
If entries have ``/time`` and ``/cpu`` variants, the former gives the real time(monotonic clock), while the latter the thread CPU time (only if thecorresponding pthread API works and is supported).