Eisa01 / mpv-scripts

This repository contain scripts I have made for mpv media player...
BSD 2-Clause "Simplified" License
505 stars 35 forks source link

Script Interference (Referring To Issue #109) #125

Open AziRizvi opened 6 months ago

AziRizvi commented 6 months ago

Two months ago I ran into the issue #109 when trying to use SmartSkip with the speed-transition script. Speed Transition Script: https://github.com/zenyd/mpv-scripts/blob/master/speed-transition.lua

Now, I'm running into the same issue when I try to use another script called Sub-Skip. Script Link: https://github.com/Ben-Kerman/mpv-sub-scripts/blob/master/sub-skip.lua

The way these scripts work is they "read" the video ahead and see if there's a subtitle line 5 seconds away (this is configurable) and if it is, it speeds the video up by however much you want till the next subtitle line is visible, this helps me save a lot of time and lets me watch through my stuff quicker.

But even with using Sub_Skip, I'm still running into the same issue as #109, best I can tell is that if you start skipping to silence and the skipping duration overlaps with the time when Sub-Skip or Speed-Transition is supposed to initiate/activate, it causes that issue.

This is quite problematic because I need that feature, so I would like to please request this functionality for SmartSkip natively.

Eisa01 commented 6 months ago

From what I can see a slight modification to sub-skip/speed-transition scripts can add compatibility to SmartSkip. The purpose of these scripts from what I understand, is to quickly go through the video until a scene in which there is a narrative, to enjoy the narrative, it reverts to original speed.

Is there any other purpose I am missing? Also, what is the difference between the two scripts sub-script / speed-transition, and which is better?

It will be useful to know so that I either make the script work with SmartSkip and create a PR, fork it inside SmartSkip with my own modifications (if any modifications needed).

AziRizvi commented 6 months ago

From what I can see a slight modification to sub-skip/speed-transition scripts can add compatibility to SmartSkip. The purpose of these scripts from what I understand, is to quickly go through the video until a scene in which there is a narrative, to enjoy the narrative, it reverts to original speed.

Is there any other purpose I am missing? Also, what is the difference between the two scripts sub-script / speed-transition, and which is better?

It will be useful to know so that I either make the script work with SmartSkip and create a PR, fork it inside SmartSkip with my own modifications (if any modifications needed).

Yes, your understanding is correct, it speeds up the parts of the video where there are no subtitles (the time length of how far the script looks in the video is configurable so for example if I'm at 1:00 minute and there are no subtitles till 1:05 it will speed up the video and stop 1 second before subtitle line shows up, I can change it from 5 seconds to 10 seconds or whatever I want, from what I can tell the Speed-Transition script is more advanced, the sub-skip script is a bit basic but fulfils the primary function that I want just fine I have only used the sub-skip script for two days so I can't be sure if there are any bugs or other issues in that script it's upto you to decide which one you may want to fork and add since you would better understand the code and their functions. From what I can tell, both scripts work nearly identically but I like speed transition better because to me, it feels smoother so I recommend modifying and forking it.

Here's a video of how the scripts work: Watch the videos with the audio, don't mute the audio.

First up is Speed-Transition: (When the video was at 1:45 the script "saw/read" that there was a subtitle line 5 seconds away at 1:51 and it speeded the video up and stopped at 1:50 just before the subtitle line became visible at 1:51 and it also reverted back to the original speed that was set before, then again same thing happens at the scene at 1:59 and same happens to the scene at 3:08.. at 3:08 there were no subtitles for 5 seconds which means 3:13 so it speeded the video up and stopped at 3:20 and the subtitle line became visible at 3:21.

https://github.com/Eisa01/mpv-scripts/assets/129892077/3e22a02a-db57-4361-b4b9-f9f978dcc6a3

AziRizvi commented 6 months ago

Now here's the same video/clip using Sub-Skip:

https://github.com/Eisa01/mpv-scripts/assets/129892077/acc40702-205a-4763-8165-efc54dd40793

AziRizvi commented 6 months ago

I've also seen that you if you try to skip to silence at the same time when sub-skip or speed-transition is active, it causes that issue at #109. As for any other features, both the scripts have a feature where you can skip to the next subtitle line altogether instead of speeding the video up.