zenyd / mpv-scripts

Scripts for the mpv media player
GNU General Public License v3.0
167 stars 29 forks source link

speed-transition.lua: Suggestion for youtube generated subtitles (minimum subtitle length forced skip) #28

Closed Reinbowsaur closed 7 months ago

Reinbowsaur commented 3 years ago

Youtube generates subtitles but they are useless with this plugin unfortunately to the way they are generated, each line of subtitle will be shown until the next line is generated leaving no gaps for this plugin to skip through.

This could be solved by implementing an option that will fast foward automatically after a subtitle has being showing for a certain amount of seconds.

An option for example might be useful to call it "forcedLookAhead = x" (After a subtitle has being showing for x seconds it will forcefully speed up to the next subtitle) this is because with youtube the talker has likely already finished, while the subtitles generated by youtube will continue to show forever until it generates more subtitles, leaving massive gaps of silence, that could be skipped if detected showing too long.

chapmanjacobd commented 2 years ago

Yes. I have encountered subtitles from many sources (not just YouTube ones) that have this issue. A max_duration or subtitle_timeout setting should fix this.

Maybe directskip can do this or maybe similar functionality of directskip should be added to speedup mode

chapmanjacobd commented 1 year ago

I added this functionality to the Ben Kerman sub-skip script https://github.com/chapmanjacobd/computer/blob/main/.config/mpv/scripts/sub-skip.lua

it feels a bit hacky but it is working for me :)

chapmanjacobd commented 1 year ago

There were quite a few bugs but I've ironed them out:

https://github.com/chapmanjacobd/computer/blob/main/.config/mpv/scripts/sub-skip.lua

zenyd commented 7 months ago

This is implemented as of 9bdce0050144cb24f92475f7bdd77180e0e4c26b