Git Product home page Git Product logo

mpv-stats's Introduction

Note

This script is now part of mpv and, therefore, not updated in this repo as of Nov 2018. For an up to date version please visit: https://github.com/mpv-player/mpv/blob/master/player/lua/stats.lua

You do not need to download it here unless you want a specific version, e.g. because you are using an old version of mpv (you shouldn't).
In such a case, start mpv with --load-stats-overlay=no in order to disable the internal version and place your desired script version at the locations mentioned below.

There's also some documentation available.

mpv-stats

Display statistics for the currently played file in mpv.

Default (screenshot is outdated)

Requirements

mpv 0.28.0 is not sufficient. You need a more recent version of mpv. For older mpv versions please go to Releases. The oldest supported version of mpv is 0.9.3.

By default Source Sans Pro is used as font. You can download it here.
If you want to use your own, please make sure your alternative choice supports as many font weights and monospaced digits, for an optimal visual experience.

Usage

Place stats.lua in your ~/.config/mpv/scripts/ or ~/.mpv/scripts/ folder to autoload the script.

The script is binding itself to i and I (however, not overriding your own bindings) and can therefore be invoked by pressing these keys. i will show the stats once while I will toggle them.

While the stats are visible on screen, you can use numeric keys (1, 2, 3, ...) to switch between "pages" of stats. So far, the following pages are defined:

  1. stats (as usual)
  2. frame timings

There will be more pages in the future. Also, expect some layout changes of current pages in the near future.

You can set different bindings either by customizing this script or by using the script_binding input command (in input.conf), e.g.:

e script-binding stats/display-stats
E script-binding stats/display-stats-toggle

F.A.Q.

How to get graphs?

Graphs are enabled by default. Due to their size, graphs for Frame Timings can only be shown on their dedicated page (2). For VSync Ratio and VSync Jitter they are only shown when stats are toggled (page 1) because they need to be recorded. Please note that only the opengl VO is exposing frame timing data.

Turn graphs off with plot_perfdata=no, plot_vsync_ratio=no and plot_vsync_jitter=no (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).
Note that font does not need to be a monospaced font.

Customization

You can configure various settings by creating a file called stats.conf in a folder named 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 configuration syntax.

To change e.g. the text display duration your stats.conf may look like:

duration=5

A more sophisticated example:

key_oneshot=e
key_toggle=E
font_size=8
plot_perfdata=no
font=Arial
font_mono=Monospaced
font_color=262626
border_size=0.5

Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR (blue green red).

mpv-stats's People

Contributors

argon- avatar haasn avatar kevmitch avatar medhefgo avatar sfan5 avatar wiiaboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-stats's Issues

Enable ass formatting again when vo window re-opens

eval_ass_formatting() does not re-enable ass formatting when the vo window is closed then re-opened.

Steps to reproduce:

  1. Launch mpv from console
  2. Toggle stats display
  3. Switch video track (window closes)
  4. Switch video track again (window re-opens)

failed to load stats.lua script when launching mpv

> mpv  ~/Videos/a-test-file.mp4 
[stats] 
[stats] stack traceback:
[stats]         /home/bruce/.config/mpv/scripts/stats.lua:51: in main chunk
[stats]         [C]: in ?
[stats]         [C]: in ?
[stats] Lua error: /home/bruce/.config/mpv/scripts/stats.lua:51: attempt to index local 'options' (a boolean value)

Lua error

[stats]
[stats] stack traceback:
[stats] [C]: at 0x7ff65b9bf600
[stats] Lua error: D:/mpv/portable_config/scripts/stats.lua:7: unexpected symbol near '<'

drop-frame-count Warning

I am getting the warning from MPV:

Warning: property 'drop-frame-count' was replaced with 'decoder-frame-drop-count' and might be removed in the future.

Thought I'd mention it.

Cheers for the great script!

CLI reporting dropped frames

The terminal is reporting dropped frames (9), but calling the script shows 0 dropped frames.

mpv version is -git.

About font color

I prefer to use specific color for some values such like potplayer ‘s OSD ,which is a media player for windows system. I think it’s convenient to find Information I needed quickly and more attractive.

Can this be achieved ? or limited by mpv itself ?

image

Colorlevels stat

If I use the MPV option format=outputlevels=full (--video-output-levels=full in MPV 0.12) to change the RGB levels from Limited to Full the stats always display Limited.
Is it possible to update the script to handle this case ?

graph and frame timings only work for a few drivers

graph and frame timings display on debian linux only works, if you choose the opengl video output driver, otherwise mp.get_property_native("vo-performance") will not return valid numbers.

i think, this should be mentioned in the documentation.

File: line

It appears to be inserting a carriage return to prevent the line from going beyond half the window length.
I'm trying to learn; do you know where this behavior is located in the code?

Relicensing

In order to get this script included into mpv (mpv-player/mpv#4918), the license needs to be changed to LGPL 2.1.
I have no idea how this works but I assume when every contributor agrees, this can be done. I also assume that a modified version of the agreement mpv used works:

I agree that my past contributions to mpv-stats are relicensed to 
the GNU Lesser General Public License (LGPL) version 2.1 or later

So I kindly ask you (@haasn @wiiaboo @kevmitch @atomnuker @medhefgo) for permission to relicense this script.
Thanks in advance.

video bitrate graph

it would be really nice and useful, if mpv-stat could display the change of video bitrates in a similar graph as frame timings.

Add performance metrics (upload / render / present times)

These were added in mpv-player/mpv@393a069

Many people have requested this feature, which is present in madVR and MPDN's equivalent “stats” dialogs. mpv now has support for it, so it might be a good idea to add them to stats.lua.

Some notes: The ‘peak’ and ‘average’ values can be rather unreliable during the beginning of playback, since the first frame will usually be very high (due to shader compilation and other initialization). As a result, the ‘average’ value is also severely bloated for a good few seconds. So I personally recommend displaying all three figures (last, avg and peak) if you can find the space for it.

[Feature Request] display bitrate?

Very nice script, love it.
Have you considered looking into displaying the file's bitrate in kb/s, like in ffprove (from ffmpeg)? That would be very useful.

Just curious. Thanks for sharing. :)

Latest commit have some problem

It breaks at line 50 with error message "Attempt to index local..."
And this commit works fine now.

mpv 0.9.2 (C) 2000-2015 mpv/MPlayer/mplayer2 projects
built on 2015-08-06T16:15:01
ffmpeg library versions:
libavutil 54.27.100
libavcodec 56.41.100
libavformat 56.36.100
libswscale 3.1.101
libavfilter 5.16.101
libswresample 1.2.100

Chapters and time info

Hi,

Is it possible to add info about total number of chapters and total/passed/remaining time?

Regards,
Alex

PS. This info probably could be added in the Chapter line (the 4th one from above).

Toogle stats info displaying

Hi. Thank you for such useful userscript.

I've noticed though that it's not that covenient (at least for me) to constantly press hotkey in order to read all video info that I'm looking for. I think it would be great to have option to display info until user pressed hotkey for the second time (i.e. toggling). This mode may be enabled e.g. when duration=0.

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.