Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added silence_level_analysis (sla) for easier deciding of silence level #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mphirke
Copy link

@mphirke mphirke commented Aug 1, 2020

It is a bit time consuming to test silence levels for videos by repeatedly entering different silence level commands , and some videos I used unsilence on had 0 difference using the default -35 silence level, so I thought of creating a table with multiple silence levels that would make good reference for user to decide what the silence level should be. Can be easily expanded by just changing the list values.

Here’s a short video demo of how it works on my Win10:
https://www.youtube.com/watch?v=raWyQhvf4WI&feature=youtu.be

@lagmoellertim
Copy link
Owner

This is an awesome idea, this will definitely be part of the next big release. I have to more ideas that will probably make this even better:

  1. Instead of exiting the program after selecting no when asked to continue with the original silence, adding the option to select a new silence level via console input will save even more time, since you don't need to re-run the detection.

  2. I think we should add a string parameter after -sla to select the range of silence levels to be tested. So you have e.g. the options low,normal,high,full for low, normal and high silence decibel levels, and full if you want to test every level?

What do you think about that?

@mphirke
Copy link
Author

mphirke commented Aug 1, 2020

Hi, I like your improved ideas very much. Hadn't thought of having a low, normal, high, full version. That would be quite comprehensive and nice.

I'll work on them tomorrow along with one feature I was thinking of - If someone uses unsilence and there is no difference in output video (0.00% delta for all audible, silence and combined), then it would suggest to use sla so that user can choose a correct silence level value. (Edit: By suggest, I mean having a choice dialog).

@lagmoellertim
Copy link
Owner

Great idea! I'm looking forward to your update!

Do you think it is necessary to also add these features to the python library?
I wanted to keep the command line tool and the library in sync, but I think adding sla to the library will bloat the code, since this can be done easily in code, eventhough it is a really useful thing to have in the command line tool.

@mphirke
Copy link
Author

mphirke commented Aug 2, 2020

Hi, I don't think it's necessary in the library. As you said, it should be easy for user to implement this in their code if they use the library. I would not want to unnecessarily bloat the code either.

I've added the features that we discussed in the latest commit.

  1. Console input to enter new silence value after SLA if user chooses to
  2. low, normal, full and high options for decibel ranges
  3. Rerunning run with argument sla on if user chooses to after finding 0 delta/no change in output intervals.

@lagmoellertim
Copy link
Owner

Hey, thanks for your great work 😀 I'm going to look over the changes later this day and merge it into the next release branch. I will also probably add a lru cache to the silence calculation in order to avoid executing the function again with the same parameters (caching would be a big speed up compared to a rerun)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants