mmguero / cleanvid

cleanvid is a little script to mute profanity in video files
BSD 3-Clause "New" or "Revised" License
56 stars 6 forks source link

Entire line censored in output audio #38

Closed theinversepixel closed 1 month ago

theinversepixel commented 1 month ago

I've been using SubtitleEdit with the Faster-Whisper-XXL model to generate srts for videos. When I run them through cleanvid, the swears are censored correctly but the audio file has the entire line censored every time there is a swear present. This results in large gaps of silence. Not sure if there is a setting I'm missing or if it's something to do with how I'm making the srt!

mmguero commented 1 month ago

Yes, the reason an entire line is censored is because that's all the precision the program has with regards to audio timestamps: as it's using the subtitles, it doesn't have "word-level" granularity, just whatever the phrase that has a start time and an end time with it.

I do have another script with similar goals that I use for podcasts and audiobooks. It uses whisper or vosk to break the file down and then does the muting at the word level. It's primarily intended for audio files, but I do have it so that if a video file is passed in it will edit the audio and remux the video back in as-is. You could try that.