Show HN: Automatically synchronize subtitles with video
101–110 of 129 posts
Re: Show HN: Automatically synchronize subtitles with video
#102It seems people are going back to P2P for movies. I'd forgotten the ordeals of unsynchronized srt files. Thanks to the Netflix era.
Re: Show HN: Automatically synchronize subtitles with video
#103Earlier quoted context omitted.
ELI5: You can turn this problem into finding the best "convolution index", and fourier transforms make computing convolutions cheaper. ELIUndergrad: (note that \* means multiplication, there doesnt seem to be a way to escape an asterisk) Lets start by seeing how this is a convolution. We have the videoSpeech sequence, and the subtitle sequence - each is a vector, indexed by time, of 0's and 1's indicating whether the…
Why not use good ol 'x' for multiplication? :-)
Re: Show HN: Automatically synchronize subtitles with video
#104Earlier quoted context omitted.
ELI5: You can turn this problem into finding the best "convolution index", and fourier transforms make computing convolutions cheaper. ELIUndergrad: (note that \* means multiplication, there doesnt seem to be a way to escape an asterisk) Lets start by seeing how this is a convolution. We have the videoSpeech sequence, and the subtitle sequence - each is a vector, indexed by time, of 0's and 1's indicating whether the…
> ELI5: You can turn this problem into finding the best "convolution index", and fourier transforms make computing convolutions cheaper. I tried this sentence on my 5-year-old and got a blank stare. He then proceeded to tell me a story about how Darth Vader is so scary and cool and that he's actually Luke's father. YMMV.
Re: Show HN: Automatically synchronize subtitles with video
#105You should look into DNA and RNA sequence alignment algos for possible improvements on your FFT. It's a huge and very well-explored space.
https://en.wikipedia.org/wiki/Smith%E2%80%93Waterman_algorit...
> The Smith–Waterman algorithm performs local sequence alignment; that is, for determining similar regions between two strings of nucleic acid sequences or protein sequences.
Re: Show HN: Automatically synchronize subtitles with video
#106From the README: "[...] the naive O(n^2) strategy for scoring all alignments is unacceptable. Instead, we use the fact that "scoring all alignments" is a convolution operation and can be implemented with the Fast Fourier Transform (FFT), bringing the complexity down to O(n log n)." I absolutely love it when something that, at very first glance, has no business in being solved in the frequency domain, gets solved in t…
I thought I understood FFT, but totally not getting the relationship to this problem. Someone ELI5 please? :)
Re: Show HN: Automatically synchronize subtitles with video
#107You should look into DNA and RNA sequence alignment algos for possible improvements on your FFT. It's a huge and very well-explored space.
Since I already had it open (for unrelated reasons), this might be relevant. https://en.wikipedia.org/wiki/Smith%E2%80%93Waterman_algorit... > The Smith–Waterman algorithm performs local sequence alignment; that is, for determining similar regions between two strings of nucleic acid sequences or protein sequences.
> The Smith–Waterman algorithm is fairly demanding of time: To align two sequences of lengths m and n, O(mn) time is required.
Re: Show HN: Automatically synchronize subtitles with video
#108Thanks for this! I just happen to need it. I have the first season of my favourite US series, but dubbed in Spanish, because I want to train my ear. Unfortunately the subtitle files slowly drift apart from the audio by 10 seconds during each episode. I used to have a script to “stretch” subtitles manually, but it’s quite fiddly: https://gist.github.com/jgthms/7dfc20db3478a938069a0191c4e30...
That said, it sounds like for your particular case, if you use VLC, you might be able to adjust the subtitle FPS so that you don't have to continuously manually resync. (I haven't run into this so just going off what others have mentioned.)
Re: Show HN: Automatically synchronize subtitles with video
#109I recently ran across a similar tool for aligning subtitles based on a reference subtitle file called aligner: https://github.com/kaegi/aligner It seemed to work pretty well in my testing. Maybe it could be useful to look at?
Either way, I also thought this was a cool project and will be thinking more about whether any ideas can be borrowed.