How to use whisper to synchronize existing subtitles? #1770
-
Hello everyone, let's say I already have a subtitle file that has the correct sentences but the timings are way off. Like so bad that none of the other subtitle synchronization softwares can fix it. I'm talking different framerates, commercial blocks, all that. Now I can use whisper to automatically create subtitles with matching timings, but the quality of the sentences is worse. What would be a good way to use the timings of one subtitle file and the sentences from another reference subtitle file to create one excellent subtitle file? Whisper sometimes skips background noises or misunderstands whole sentences which makes things a little difficult. Has somebody maybe implemented a similiar scenario in the past and could give me some hints on how to build this? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Forced alignment is not supported out of the box but you can refer to this notebook example. This method only works for 30 seconds or shorter, but I can imagine you can write a logic to shift the text and the audio and repeat the same alignment process on a longer audio. |
Beta Was this translation helpful? Give feedback.
-
I don't fully understand everything I see but that seems really helpful. Thank you! |
Beta Was this translation helpful? Give feedback.
-
What you are looking for is here: 😉 |
Beta Was this translation helpful? Give feedback.
-
I'm having a little trouble following your explanation, but let me see if I understand by splitting it into different cases. Case A
Case B
Case C
And you want to align all of these better to the actual video/audio. For Case A Back in 2019, I had success using "Alass 2": It would adjust all the timings to match the sound in the video more closely. And like its Usage states, I was able to run:
I successfully used it on multiple harder cases too, where the subtitles were slowly drifting further and further away from the audio... so by the time I was at the end of the show, original subtitles were MANY seconds off. For Case B Same, you can just run the GOOD subtitles (Subtitle 2) through the tool to align it better. Hopefully that would squish your issue. For Case C Looks like @EtienneAb3d 's link might work. |
Beta Was this translation helpful? Give feedback.
-
Not sure if you mean me or him, but I actually trued out WhusperTimeSync. The postitive aspects first: On one of my problematic videos, it worked PERFECTLY. I've never encountered such a reliable aligner. But... On another video, it didn't work as great. For that video, Whisper skipped some sentences altogether, and your software doesn't seem to handle that properly. I want the exakt subtitles as in the file I pulled from OpenSubtitles.com but adjusting the timestamps with whisper. I would want something like Alass, but it compares the subtitles content. That being said, I'm currently working on my own solution. (Unless you can help me with my problem, that would be great.) |
Beta Was this translation helpful? Give feedback.
@skittlesvampir
What you are looking for is here:
https://github.com/EtienneAb3d/WhisperTimeSync
😉