summaryrefslogtreecommitdiffstats
path: root/player/lua/stats.lua
Commit message (Collapse)AuthorAgeFilesLines
* stats.lua: show osd-dimensions propertyKacper Michajłow4 days1-9/+14
| | | | | | | | | | This change displays the scaled position and size of the image before cropping to the target rectangle. In simple terms, it shows how much margin has been added to the image or how much of the image has been cropped. Note that target resolution is displayed after crop as in fact all other pixels are discarded anyway.
* stats.lua: add option to disable scale with video sizenanahi13 days1-11/+38
| | | | | This adds a new configuration option vidscale, which controls whether stats display is scaled with video, similar to the option for OSC.lua.
* stats.lua: add option to control plot border widthnanahi13 days1-2/+3
| | | | | This adds a new configuration option plot_bg_border_width, which controls the border width of plots.
* stats.lua: remove redundant style overridenanahi13 days1-1/+1
|
* stats.lua: display short decoder name if not generic one is usedKacper Michajłow13 days1-0/+8
|
* stats.lua: filter input bindings by typing themGuido Cella13 days1-3/+66
| | | | | | | | | This lets you press / in page 4 of the stats and type a keybinding or part of its command to filter it by using mp.input. This works badly without a VO because both stats.lua and console.lua use show-text and only one can be displayed at a time, but it's still better than not having the search available at all.
* stats.lua: inherit OSD stylesGuido Cella13 days1-11/+24
| | | | | | | | | | | | | | | Avoid having to configure both the OSD and the stats script opts when you change the OSD options, in particular avoid having to convert colors to BGR. Also document the shadow options. font_size, border_size and shadow offset defaults are kept because the same values look much bigger in the stats than in the corresponding OSD options. osd-back-color is now respected without extra checks until you explicitly set a shadow_color.
* player/command: remove codec-info and use track-list directlyKacper Michajłow2024-04-161-7/+7
| | | | | | | | Turns out that adding more medatata like HDR10+ and Dolby Vision would produce a lot of duplication and it is better to centralize it around the track-list property. Fixes: e720159f72be2a816db849acb286f36a1ac4622b
* stats.lua: add codec profileKacper Michajłow2024-04-151-2/+10
| | | | | | May be interesting information for users. Fixes: #13839
* stats.lua: remove unused variablesKacper Michajłow2024-04-131-4/+0
|
* stats.lua: use '➜' (U+279C) instead '→' (U+2192)Kacper Michajłow2024-04-131-1/+1
|
* stats.lua: fix scrolling for page 2Christoph Heinrich2024-04-091-1/+1
| | | | | Scrolling for page 2 was disabled in 777f69bee8aceadcd319edf046535e177ef43d48 but the keys were still bound, so this was clearly a mistake.
* command: add escape-assGuido Cella2024-03-211-13/+1
| | | | | | | | | | | | | | | | | This adds a command to escape ASS tags to remove code duplication between sub/osd_libass.c, console.lua, osc.lua, stats.lua and any user script that calls mp.create_osd_overlay(). A command is used instead of scripting functions so that all clients can use this and not just use Lua and JS ones. osd_mangle_ass() also interprets osd-sym-cc and osd-ass-cc/{0,1}, but since they use invalid UTF-8 characters there is no risk of escape-ass users using them by accident, like with any OSD message. Always replacing \n with \\N in mangle_ass() even when it is not called by escape-ass doesn't seem to cause any issue, but I made it conditional anyway to avoid changing how all OSD messages are treated unnecessarily.
* stats.lua: use term-size as terminal output sizeChristoph Heinrich2024-03-211-3/+4
| | | | | | | The terminal output was static in size with no way of automatically adjusting it to the current terminal size. The new term-size property makes truly automatic adjustment possible.
* stats.lua: fix and unify scroll hintChristoph Heinrich2024-03-211-10/+11
| | | | | | | | The scroll hint on page 4 had baked in ass tags, which shouldn't be there in the terminal. Also the scroll hint on page 0 was missing. Refactor scroll hint generation into a function and use that for pages 2, 4 and 0.
* stats.lua: use term_ellipsis for page 4Christoph Heinrich2024-03-211-16/+7
| | | | | Page 4 might as well use the same line shortening function as the other pages instead of rolling it's own.
* stats.lua: truncate long lines for the terminalChristoph Heinrich2024-03-211-30/+101
| | | | | | | | | | | | | | | The terminal is assumed to be 80x24 in size, the new options `term_width_limit` and `term_height_limit` can be used to overwrite that. Lines longer then the terminal width cause problems with scrolling pages and need to be shortened. The algorithm used for shortening can deal with tabs and escape sequences, has rudimentary support for UTF-8 and runs in O(n). avih helped in the creation of the term_ellipsis() function and split() is also from him.
* stats.lua: use scroll function for page 2 and 0Christoph Heinrich2024-03-211-52/+30
| | | | | | | | | | | | | | Pages 2 and 0 had their own scroll implementations, which worked fine for ass, but didn't work well in the terminal. Now they both use the same scroll function as page 4. That scroll function requires each output line to be one entry in the table. Page 0 did not adhere to that new requirement, instead it generated two table entries for a single output line when a graph is shown. To fulfill that requirement the generated graph now gets directly appended to the same table entry that's used for the rest of the line.
* stats.lua: refactor page 4 scrolling into functionChristoph Heinrich2024-03-211-10/+24
| | | | | | | | This scrolling implementation will be used for other pages in future commits. The comment said it takes up 20 lines of the terminal, but in reality it was 22 lines.
* stats.lua: add more information in audio sectionKacper Michajłow2024-03-211-6/+21
| | | | | | | | - current AO - AO device - AO volume - audio delay - output format
* stats.lua: display video parameters after filteringKacper Michajłow2024-03-091-0/+1
|
* stats.lua: fix blurry graphs when --osd-blur is setnanahi2024-02-271-1/+1
| | | | | | | | When --osd-blur is set to a nonzero value, the graphs also become blurry. This is because they are rendered by the osd-overlay command with the "OSD" style which has OSD blur applied, and are treated no differently from texts. Fix this by using the "Default" style for these graphs which uses the default OSD options.
* stats.lua: use deinterlace-active property insteadDudemanguy2024-02-071-1/+1
| | | | | But still read the deinterlacing option to distinguish between yes and auto.
* stats.lua: display the current GPU contextnanahi2024-01-201-0/+2
| | | | | | This displays the current GPU context when --vo=gpu or --vo=gpu-next is used, which shows the platform and backend information of the vo which are previously not available.
* stats.lua: make capitalization consistent across pagesllyyr2024-01-171-11/+11
|
* stats.lua: fix incorrect storage aspect ratio valuenanahi2023-11-141-1/+7
| | | | | | | | | | | The "Resolution" property shows the storage resolution for videos with non-square pixels. Currently, display aspect ratio is shown for both "Resolution" and "Output Resolution" properties which results in a duplicate, and is incorrect for the "Resolution" property. The correct aspect ratio is now shown using the sar and sar-name properties.
* stats.lua: disable ASS formatting when printing to terminalKacper Michajłow2023-11-081-1/+1
|
* stats.lua: remove unused variableGuido Cella2023-11-071-3/+0
| | | | 056072bf95 deleted the only use of property_list.
* stats: don't overwrite color and alpha of `osd-back-color`Christoph Heinrich2023-11-071-4/+6
|
* ALL: use pl_hdr_metadata and nuke sig_peakKacper Michajłow2023-11-051-5/+0
| | | | | | | | This commit replaces all uses of sig_peak and maps all HDR metadata. Form notable changes mixed usage of maxCLL and max_luma is resolved and not always max_luma is used which makes vo_gpu and vo_gpu_next behave the same way.
* csputils: add pl_hdr_metadata to mp_colorspace and deprecate sig_peakKacper Michajłow2023-11-051-5/+3
| | | | | Note this commit does not change all uses of sig-peak, this is for future refactoring.
* lua: remove a ton of unneeded parenthesesDudemanguy2023-11-021-3/+3
| | | | | | | | | | | For whatever reason, some of the lua code (particularly the osc and ytdl_hook) is full of a bunch of stuff like if (foo), if not (foo == nil), etc. The parenthesis aren't needed in lua and actually just look weird since nobody actually writes lua like this. You can see most of the other conditionals are written normally. So cleanup the style to match when the parenthesis clearly aren't doing anything. Not directly related, but also add some spaces on a few math operations while we're at it.
* stats.lua: disable tonemapping plot by defaultDudemanguy2023-10-221-1/+1
| | | | | | Nobody except a chosen few (I'm not one of them) even knows what it means. Multiple people thought it was actually some kind of rendering bug. Just disable it by default. Closes #12671.
* stats.lua: hide images' FPSGuido Cella2023-10-191-1/+3
| | | | | It is useless to show this because it's just a bogus value taken from --mf-fps.
* stats.lua: remove compatibility aliases of propertiesllyyr2023-10-151-17/+3
| | | | | | These are ancient and have existed since before stats.lua lived in the mpv repository. We don't need to worry about ancient mpv versions anymore, so remove these.
* stats.lua: fix page 2 alignment of "Total"Christoph Heinrich2023-10-151-3/+3
| | | | | | | | | The text didn't line up with with the percentages above it because it didn't use a monospace font. Instead insert the text at the same position in the template as the percentages and convert one o.prefix_sep from the percentages into hard coded \h\h to ensure alignment even when the user changes o.prefix_sep.
* stats.lua: add chroma-locationKacper Michajłow2023-10-141-0/+3
|
* stats.lua: change "Pixel Format" to "Format"Kacper Michajłow2023-10-141-1/+1
|
* stats.lua: fix missing newline when print_perfdata_passes is enabledKacper Michajłow2023-10-141-4/+4
|
* stats.lua: sort filter parameters to ensure consistent outputKacper Michajłow2023-10-141-2/+2
|
* stats.lua: don't print custom pixel format, when hwdecKacper Michajłow2023-10-141-5/+2
| | | | | There is already other place to indicate hw decoding. "cuda" or "d3d11" is not a pixel format.
* stats.lua: remove leading zeros from pass timingsKacper Michajłow2023-10-141-2/+2
| | | | Makes it more readable in my opinion.
* stats.lua: add frame infoKacper Michajłow2023-10-141-0/+23
|
* stats.lua: simplify fps displayKacper Michajłow2023-10-141-15/+26
| | | | | | - 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
* stats.lua: adjust spacing between values a littleKacper Michajłow2023-10-141-23/+43
|
* stats.lua: show HDR meta if not equal to 203Kacper Michajłow2023-10-141-4/+7
| | | | | SDR white (203) is indeed not interesting, but anything else, even if lower is.
* stats.lua: separate video parameters from video outKacper Michajłow2023-10-141-42/+85
| | | | | | | | 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.
* stats.lua: don't display full frame cropKacper Michajłow2023-09-081-5/+23
| | | | It is valid to have 0x0+w+h crop, but no need to print that.
* stats.lua: display --video-crop values when usedKacper Michajłow2023-08-311-0/+4
|
* stats.lua: enable --tone-mapping-visualize while stats shownNiklas Haas2023-08-301-0/+10
| | | | Except in oneshot mode. Controllable via new option.
* stats.lua: display hdr metadata and peak detectionKacper Michajłow2023-08-291-6/+67
|
* stats.lua: add hints about scrollingKacper Michajłow2023-08-281-3/+6
|
* stats.lua: refactor video params displayKacper Michajłow2023-08-281-10/+20
| | | | | | | | - 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
* stats.lua: remove dummy new lines from headersKacper Michajłow2023-08-281-3/+3
|
* stats.lua: display actual output video size after anamorphic correctionKacper Michajłow2023-08-281-5/+7
| | | | | This makes much more sens than frame size that is the same as native one.
* stats.lua: display output resolution if it differs to native oneKacper Michajłow2023-08-181-11/+23
| | | | | Useful when filters are applied that alters the video resolution, like crop. Also display aspect ratio per each resolution.
* stats.lua: hide window scale in fullscreenKacper Michajłow2023-08-181-1/+3
| | | | | It display window (not fullscreen) scale, which is quite confusing as it doesn't match any other currently displayed values.
* stats.lua: use video-params/aspect-nameKacper Michajłow2023-08-131-1/+3
|
* stats.lua: set sans-serif as default fontm154k12023-07-101-1/+1
| | | | sans is deprecated and unsupported on some platforms.
* various: fix typosHarri Nieminen2023-03-281-1/+1
| | | | Found by codespell
* stats.lua: display HDR peak in nitsdyphire2023-02-021-1/+1
| | | | | | | | The value of `sig-peak` is relative to the SDR peak. This is not a problem when used inside the player, but the `HDR peak` in stats should display human-readable information. So change to return the actual nits value of HDR. Closed https://github.com/mpv-player/mpv/issues/10127
* various: remove trailing whitespaceGuido Cella2022-05-141-1/+1
|
* various: fix typosCœur2022-04-251-2/+2
|
* stats.lua: page 2 - frame timing: use fixed display orderAvi Halachmi (:avih)2022-02-231-1/+10
| | | | | | | | | | | | | Page 2 displays the frame timing info for each type (currently "Fresh" and "Redraw"), but since they're unordered keys of a map, their iteration order and hence their order on screen could (and did) change depending on $things, which was annoying. haasn thinks none of them should be considered more important (and therefore maybe worthy of being displayed on top), so we go with lexicographic order, which currently means that "Fresh" is first. Fixes #9901
* stats.lua: graphs: fix bad rendering due to division by 0Avi Halachmi (:avih)2022-02-211-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two potential divisions by 0 at generate_graph(...): - If v_avg is (given and) 0. - if v_max is 0. The former doesn't seem to happen in practice because v_avg is only used at one generate_gpah call, where it's apparently not 0. The latter triggers if all the graph values are 0 (hence v_max is also 0). The implication of these divisions by 0 is an invalid y-value which ends up at the ASS coordinates string for the graph inner content. On linux the value ends as "nan" (luajit) or "-nan" (lua 5.1/5.2), and on Windows it's "nan" (luajit) or "-1.#IND00" (lua 5.1/5.2), maybe due to msvcrt's snprintf. All these strings are wrong as ASS numbers, but due to luck in how libass parses the coordinates, "nan" and "-nan" result in empty graph (which looks OK for "all values are 0"), while "-1.#IND00" is parsed as -1, which breaks the graph rendering (affects other graphs too). One example of "all values are 0" is at page 0 (internal performance graphs) on Windows - because the cpu metrics don't work. So this fixes at least page 0 on Windows with lua 5.1/5.2. While at it, move the scale calculations to one place, which now avoids division by 0, instead of duplicating this calculation. In the future, we can consider improving the generate_graph API: - It needs one peak value, but takes 3 (v_max, v_avg, scale) which are meshed into one final value. - v_avg is only used in 1 of 6 call sites, but at the middle of the arguments, so all other call sites need to pass explicit "nil". - "scale" is arbitrary and used to leave some space at the top of the graph. 5 places use 0.8, one uses 0.9. Could probably be unified.
* stats.lua: typo lavfi-complexStefan de Konink2021-08-151-2/+2
| | | | Fix typo lavi-complex to lavfi-complex.
* stats.lua: page 4 (keys): group current-window-scale under windowGuido Cella2021-08-061-1/+1
| | | | | This groups "set current-window-scale ..." under the "window" group instead of "current" in the list of keybindings.
* stats.lua: page 4 (keys): better alignment of non-ascii keysAvi Halachmi (:avih)2021-07-311-2/+16
| | | | | | | | | | | | | | | | | | | | | | | Previously we assumed the key-name string occupies strlen(name) cells, now we count codepoints instead. This improves alignment of non-english key names. Still not perfect because we don't know if the key name is single or double width, but wcwidth not available to scripts, notoriously unreliable (depends on locale, correct and updated tables, etc), and also not always available (Windows). Still, better than nothing, and we err by at most one cell - vs up to three before this commit (4 bytes keyname codepoint). In the future we could do the alignment using libass tags, however, this both complicates the ass-output generation, and also not available when we output for the terminal, so for now only count codepoints. Also, if the key name was in a right-to-left language, then previously the name/command were swapped visually. Now we inject a left-to-right marker before the name to ensure direction. This works also when harfbuzz is disabled for libass (--sub-ass-shaper=simple).
* stats.lua: page 4 (keys): detect single-quotesAvi Halachmi (:avih)2021-07-301-2/+2
|
* stats.lua: fix ass-escape while persistent_overlay=yesAvi Halachmi (:avih)2021-07-251-14/+27
| | | | | | | | | | | | | | | | | | | | | | | |