tp7 / Sushi

Automatic subtitle shifter based on audio
MIT License
639 stars 45 forks source link

Allow multiple subtitles to be processed #40

Open qgustavor opened 4 years ago

qgustavor commented 4 years ago

Currently I'm running Sushi for every subtitle separately, by doing so it wastes time redoing most of processing. By allowing multiple subtitles to be processed it can improve performance when working with multiple subtitles timed to the same source.

Interacting thought every script inputted is a way of implementing it, but I think it's better splitting shift calculation from event remapping into two separate functions/commands: the first working only with the audio files and the second taking the result of the first function and a script, then doing the event remapping. I think it would make the code easier to understand and maintain as, currently, run handles a lot of things.

qgustavor commented 1 year ago

Since I posted the comment above I have been working on an alternative way to synchronize videos using audio. In August I published Douki. The main difference with Sushi is that Douki, instead of comparing a lot of audio data, it compresses the audio data into fingerprints then compare the fingerprints, improving performance.

It's still a work in progress and is nowhere as close as Sushi. At the moment I've been using mostly to synchronize song translations to episodes: there's a function that generates fingerprints from a media file and a second function that takes those fingerprints and matches against a second media file and synchronizes one or more subtitles files based on those matches. I tried using it to synchronize full episodes (like TV vs. BD releases), but at the moment it don't works well, the matching algorithm needs improvements.

I hope it can serve as an inspiration for Sushi.