mpv-scripts icon indicating copy to clipboard operation
mpv-scripts copied to clipboard

skiptosilence: disable video/subtitle while skipping

Open Eisa01 opened this issue 2 years ago • 8 comments

Disabling the video and subtitle while skipping instead of applying a blackout filter, fixes #3.

When there are too many packets in the demuxer packet, caused by exceeding the expected inside a packet then skipping will not stop and result in the action to never end. This is resulted from subtitles and video output from my testing.

Also fixed the script-opts template in the same PR.

Eisa01 avatar Aug 13 '23 10:08 Eisa01

Wonderful. That bug has been a thorn in my sides since I never actually managed to replicate it in the first place. I'll test the changes later today so expect a merge by tomorrow.

I never even knew the opts template was wrong...

detuur avatar Aug 14 '23 10:08 detuur

There are also additional possible enhancements. I'll probably make enhancements to this PR or add additional one.

In case a file that doesn't have any moment of silence, it is better to add an mp.register_event('end-file) to handle it, so that once the file ends, the function stops "even if this case is very rare, it is still a possibility". This will also solve a possible issue that loading a new item from playlist while the function is running, will result in the function to keep on running towards the next file.

It is also possible to include mp.observe_property('pause',... to stop the function when initiating pause.

Also, a nice feature could be is to set a configurable maximum silence length, so it breaks the functions (or doesn't even initiate "dont know the possibility for now", if the next silence point exceeds the configured time) e.g.: 120 seconds.

Eisa01 avatar Aug 14 '23 14:08 Eisa01

I have made drastic changes to be able to include additional options. However, I'll move the script to separate branch (since I believe it could be not what you are intending with skiptosilence) and include it in my mpv-scripts collection whilst mentioning that it is a separate fork of skiptosilence.lua of course.

When I am not changing the script too much, I could be submitting a PR, however maintaining two separate projects of similar functionality will be an overhead for me.

Eisa01 avatar Aug 17 '23 12:08 Eisa01

The above commits adds many new features and enhancements, which are not related to the bug.

I think now I poured most of the ideas I have for skiptosilence, thank you for the awesome script =) Now I'll create a separate branch and set the current code as a start for my next project.

Eisa01 avatar Aug 18 '23 14:08 Eisa01

Totally agree with all your comments, things got mixed with the branch in where I was planning to make drastic changes, and the one I am doing enhancements / fix for PR. For osd_msg I would suggest removing the option, since I see that all osd messages important and should be displayed for the user. Let me know what you think, and I will start working on the requested changes =)

Eisa01 avatar Sep 03 '23 15:09 Eisa01

Let's get rid of osd_msg. Anyone concerned with tweaking the values can add debug print statements anywhere they want in the script.

detuur avatar Oct 05 '23 12:10 detuur

Apologies, been very busy lately. I'll try to dedicate time very soon hopefully to resolve this.

Eisa01 avatar Nov 08 '23 18:11 Eisa01

Take your time. There's no urgency here.

detuur avatar Nov 08 '23 23:11 detuur