large text on STATS page 5 causes lag and frame drops
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
mpv Information
mpv v0.41.0-687-gdb7385799 Copyright © 2000-2026 mpv/MPlayer/mplayer2 projects
built on May 21 2026 20:15:46
libplacebo version: v7.364.0 (v7.360.0-55-g464d6ea-dirty)
FFmpeg version: N-124569-g99e1ecca3
FFmpeg library versions:
libavcodec 62.34.100
libavdevice 62.4.100
libavfilter 11.17.100
libavformat 62.18.100
libavutil 60.31.100
libswresample 6.4.100
libswscale 9.7.100
Other Information
- Windows version: Win10 22H2
- GPU model, driver and version:
- Source of mpv: https://github.com/zhongfly/mpv-winbuild
- Latest known working version:
- Issue started after the following happened:
Reproduction Steps
ytdl hook may use the "memory://" protocol to generate subtitles with extremely long filenames, these long filenames will be rendered on the STAT page 5 without any truncation.
for simply reproduce, create a lua script to generate a “memory://” protocol subtitle about 1MiB size.
test.lua
mp.register_event('file-loaded', function()
local srt_lines = {}
for i = 1, 1024 do
table.insert(srt_lines, '' .. i)
table.insert(srt_lines, mp.format_time(i - 1, '%H:%M:%S,%T') .. ' --> ' .. mp.format_time(i - 0.001, '%H:%M:%S,%T'))
table.insert(srt_lines, ('A'):rep(1024))
table.insert(srt_lines, '')
end
mp.commandv('sub-add', 'memory://'..table.concat(srt_lines, '\n'), 'select')
end)
mpv any.mkv --no-config --script=test.lua --log-file=log.txt
show STATS page 5 and try scrolling up and down.
https://github.com/user-attachments/assets/92c012f1-b31d-4011-9f4b-c4a35f41a30c
Expected Behavior
no lagging
A feasible solution is to truncate the filenames, just as the selectable items are truncated in console.lua
https://github.com/mpv-player/mpv/blob/db73857997b7787e529b12dadbfd187806d1b7ed/player/lua/console.lua#L1765-L1779
Actual Behavior
lagging
Log File
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- I tested and confirmed that the issue exists with the latest release version or newer.
- I provided all required information including system and mpv version.
- I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- I attached the full, untruncated log file.
- I attached the backtrace in the case of a crash.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided command with test.lua, then inspect the STATS page rendering and compare its handling of long filenames with the truncation logic in player/lua/console.lua (the affected subtitle path is referenced in player/lua/ytdl_hook.lua). Done means reproducing the frame drops no longer causes lag when scrolling STATS page 5 with a very large memory:// subtitle filename.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- cli, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100