Live data from Hacker News

Show HN: Automatically synchronize subtitles with video

github.com

121–129 of 129 posts

Re: Show HN: Automatically synchronize subtitles with video

#121
post #51
post #13

Earlier quoted context omitted.

Great question. The main use case I can think of is when reference.srt and unsynchronized.srt are in different languages, and you want to eventually merge them into a single dual-language subtitle file. EDIT: Oh, I should also mention that you don't need a reference.srt -- it can look at the video directly and use that as a reference.

> when reference.srt and unsynchronized.srt are in different languages I just want to thank you for including this use-case, because it's exactly the thing I'm regularly running into. Subs in one language are bundled with the vid, all subs from OpenSubtitles are desynchronized.

You are most welcome! This is exactly the use case I was initially targeting; I got super lucky that the VAD-based synchronization happened to be low-hanging fruit that has a higher "Wow" factor.

Re: Show HN: Automatically synchronize subtitles with video

#122
post #74
post #34

> I have yet to find a case where the automatic synchronization has been off by more than ~1 second That's actually quite bad synchronization error for A-V; maybe it's less noticeable for subtitles. I wonder if there is a good way to reduce that error down to milliseconds.

100 ms A/V is already quite noticeable, with some training one might spot 50 ms too.

I agree 100ms is bad :-). I think even 10s of ms sync error is readily jarring for most people, at least for A-V. Subtitles may be more forgiving.

Re: Show HN: Automatically synchronize subtitles with video

#123

Earlier quoted context omitted.

Why not use good ol 'x' for multiplication? :-)

I keep AltGr+8 mapped to × for just such an emergency.

The Compose key works great for this (I use WinCompose on Windows). Most of the time I can guess the key combination. I think × is Compose, x, x.

Re: Show HN: Automatically synchronize subtitles with video

#124
post #86

Earlier 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.

lol, that makes sense. heres another try:

ELI5 v2: you can look at the sequences a different way, like tilting your head to look at them from a different angle. and from that angle, we can more easily try every possible way of putting them together, so that we can choose the best way.

Re: Show HN: Automatically synchronize subtitles with video

#125

Earlier quoted context omitted.

'x' is a letter, not the times symbol.

It is _a_ multiplication symbol. Why not use period ".".

Because there are a lot of those in the vicinity and it's very small?

Re: Show HN: Automatically synchronize subtitles with video

#126

You should look into DNA and RNA sequence alignment algos for possible improvements on your FFT. It's a huge and very well-explored space.

Agreed -- definitely worth thoroughly investigating this space to see whether there are any ideas that can be borrowed.

Re: Show HN: Automatically synchronize subtitles with video

#127

Earlier quoted context omitted.

This sounds amazing! Did you use a USB TV tuner or an online source? Is there chance you could open source the code?

I used an online stream source; A HLS stream that one of my local TV stations broadcasts online. My method will only work with streams that have SCTE35 packets embedded. This is normally used for local ad insertion on cable networks, so it may not always be available on OTA streams. There is not much code because it is mostly ffmpeg that does the work. I used nodejs to manage an ffmpeg child process, read its output…

Thanks so much!

Re: Show HN: Automatically synchronize subtitles with video

#128
I see this will only shift the timings some offset. But many times it isn't enough e.g. if the video source is NTSC and the subtitle were meant for PAL.

In this scenario I use Subtitle Workshop, which allows me to specify two (or more) pairs of times, and all subtitles are synchronized accordingly.

Optimally the two pairs of times would be near the beginning and the end, but to prevent big plot spoilers, I usually use the beginning and 2/3 of the length.

Re: Show HN: Automatically synchronize subtitles with video

#129
post #46

This is an area I am actively looking into at the moment for my employer. It's an interesting project, and I am excited to see work in this domain. Note that this will not pass QC at any broadcaster/OTT. Our tolerance is typically within 1-12 frames (and a bunch of other requirements around shot changes, etc.)

> Our tolerance is typically within 1-12 frames (and a bunch of other requirements around shot changes, etc.) Tell me more!

Netflix did a good job outlining their requirements (which are mirroring industry requirements): https://partnerhelp.netflixstudios.com/hc/en-us/articles/215... Note that I do not work for Netflix rather another multinational mass media conglomerate.
Post reply on HN