Live data from Hacker News

Show HN: Automatically synchronize subtitles with video

github.com

91–100 of 129 posts

Re: Show HN: Automatically synchronize subtitles with video

#91
post #3

This is cool. I am constantly impressed by ffmpeg and it capabilities. Last week I was able to make it act as a proxy for live streaming video that reduced the volume of ad-breaks by 50% automatically by listening for SCTE35 cue packets in the stream and adjusting a volume filter accordingly. My housemate has a reality TV addiction, and the ads were getting on my nerves. I just intended to see if it was possible, but…

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

https://gist.github.com/satori99/2cb06938bfe8532ecc00e609065...

Keep in mind it's PoC code, I stopped when it worked the first time :P

Re: Show HN: Automatically synchronize subtitles with video

#92
post #78

Earlier quoted context omitted.

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…

please do

https://gist.github.com/satori99/2cb06938bfe8532ecc00e609065...

Re: Show HN: Automatically synchronize subtitles with video

#93
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!

Re: Show HN: Automatically synchronize subtitles with video

#94

Completely tangential question to this awesome discussion: who even writes subtitles? It feels like a thankless job to write subtitles for rips of movies and TV shows old and new. I get that maybe they source original from, say, Netflix, but .set files existed long before Netflix, and for lots of movies not on Netflix. Writing all those tags for hearing impaired seems like a lot of work, which anyone other than the f…

> Both are in English, so I don't see why they can't just transcribe what's being said.

Try writing subtitles yourself, and you'll probably see why. There's a limited space and time budget - people need to be able to read the thing without spending too much time focusing on it.

Sometimes, if it's a quick back and forth, you even have to leave out some of the dialogue. Now what do you cut?

And this is just for subtitles in the same language. Imagine also facing translation issues - where you not only are trying to roughly hit the same meaning and connotations, but also need to stay relatively close to the acting, e.g. you can't translate a strong exclamation word into something too soft. And there's also the issue of difference between spoken and written language, e.g. the viewers may accept someone saying "fuck that", but seeing it written down "- Fuck that" feels awkward.

It is truly a work of art.

And that's probably also why people are doing it in their spare time, perhaps after having seen a bad job from the official movie.

I imagine doing it will also get you really close to understanding how the movie is built up.

Re: Show HN: Automatically synchronize subtitles with video

#96

Earlier quoted context omitted.

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

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

But if you have to choose between '\*' and 'x', then 'x' might well be the best choice, no? :-)

Re: Show HN: Automatically synchronize subtitles with video

#97
post #22

From 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? :)

It has nothing to do directly with FFT, which is why it is confusing:

What he is looking for is maximal correlation between two binary series (think "Pearson's r or r-square correlation coefficient"). Now, correlation is just like convolution except one series is flipped around on the time axis. Which means, if you have an efficient way to compute convolutions (and you do, through FFT), you have an efficient way to compute correlations.

(I don't think 5 year olds heard of Pearson's correlation coefficient or convolutions, but ... that's the best I can do).

In many ways, correlation and covariance are more fundamental than convolution - they are closely and directly related to the inner product.

And the only reason to use the FFT here is convenience (i.e., it is fast and simple to compute), but the correlation/convolution property applies to many "transform domains" - Laplace, Z, Cosine, Sine, and a few others (all of which are closely related among themselves, but only a few easy to compute numerically).

Re: Show HN: Automatically synchronize subtitles with video

#98

Earlier quoted context omitted.

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

But if you have to choose between '\*' and 'x', then 'x' might well be the best choice, no? :-)

If they had used ‘x’ instead, I would be scouring the comment for where the variable had been introduced.

Re: Show HN: Automatically synchronize subtitles with video

#100
post #98

Earlier quoted context omitted.

But if you have to choose between '\*' and 'x', then 'x' might well be the best choice, no? :-)

If they had used ‘x’ instead, I would be scouring the comment for where the variable had been introduced.

Ok, use 'x' and write "(note that 'x' means multiplication)" instead of "(note that \* means multiplication, there doesnt seem to be a way to escape an asterisk)". More legible and shorter and 'symbol is already used for the purpose' and..
Post reply on HN