Closed tupo2 closed 9 months ago
I cannot reproduce. Can you share some more information like operating system and mpv version?
After removing the files with non-latin characters it works faster?
Debian Sid and mpv 0.36.0. If I remove line 5 (...Ci_zad39Uhw), it' smooth.
If you make filename_replace
setting null does it change anything?
Or can you try if it gets faster if you change parse_filename
function to this:
function parse_filename(string, name, index)
local base = tostring(plen):len()
return string:gsub("%%pos", string.format("%0"..base.."d", index+1))
:gsub("%%name", name)
end
I'm wondering if the gsubs are causing some performance issues with some characters.
Also can you try using this title:
#EXTINF:,【オリジナル楽曲】粛聖!! ロリ神レクイエム/ しぐれうい(9さい)
I wonder if it's the ☆
character causing the issue.
Also could you try using another font if that solves the issue? Then it could be some issue in font rendering rather than in this script.
If you make
filename_replace
setting null does it change anything?Or can you try if it gets faster if you change
parse_filename
function to this:function parse_filename(string, name, index) local base = tostring(plen):len() return string:gsub("%%pos", string.format("%0"..base.."d", index+1)) :gsub("%%name", name) end
I'm wondering if the gsubs are causing some performance issues with some characters.
Also can you try using this title:
#EXTINF:,【オリジナル楽曲】粛聖!! ロリ神レクイエム/ しぐれうい(9さい)
I wonder if it's the
☆
character causing the issue.
Same issue.
Also could you try using another font if that solves the issue? Then it could be some issue in font rendering rather than in this script.
The default font I'm using for OSD is sans-serif
. Tested with others fonts and it's much better.
I did not notice before, this message spam in the terminal when I display the playlist:
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF09 for font: (sans-serif, 400, 0)
I think 0xFF09 is the )
character. FULLWIDTH RIGHT PARENTHESIS. It could be that causing the slowness in the rendering.
Maybe this discussion has some solutions https://www.reddit.com/r/archlinux/comments/8ciooy/support_for_fullwidth_latin_letters/
I'm not sure if there is anything I can do on the script level to fix this issue. It might be also useful to report to mpv repository, as they could probably do some caching and more performant fallbacks on missing characters.
I think 0xFF09 is the
)
character. FULLWIDTH RIGHT PARENTHESIS. It could be that causing the slowness in the rendering.
0xFF09
, is not the only character displayed in a loop in the terminal:
[osd/libass] fontselect: failed to find any fallback with glyph 0x30AA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30B8 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30CA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EB for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x697D for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x66F2 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x7C9B for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x8056 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30ED for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EA for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x795E for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30EC for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30AF for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30A4 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30A8 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x30E0 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3057 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3050 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x308C for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3046 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3044 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF08 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3055 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0x3044 for font: (sans-serif, 400, 0)
[osd/libass] fontselect: failed to find any fallback with glyph 0xFF09 for font: (sans-serif, 400, 0)
I think this cause performance issues, do you know how to stop it (except to close the playlist)?
Maybe this discussion has some solutions https://www.reddit.com/r/archlinux/comments/8ciooy/support_for_fullwidth_latin_letters/
Thanks for the info, I tested fonts-noto-cjk
and it's OK too.
Here is a thread about similar topic, mentioning the slowdown as well. https://github.com/mpv-player/mpv/issues/8919
I think the solution is either in the system or optimizations in mpv/libass. I recommend opening or looking for an issue in those repositories if you cannot resolve the issue.
I'll close this as there is not really anything this script can do to avoid this issue, and my knowledge on the topic is limited.
Playlist to test:
Does not happen when paused.