An even harder and cooler problem to solve would be finding extra scenes. Sometimes subtitle or movie have slightly different "cut" (e.g. directors cut) and there are some extra scenes added. A similar algorithmic approach could be used to solve this problem as well.
Show HN: Automatically synchronize subtitles with video
31–40 of 129 posts
Re: Show HN: Automatically synchronize subtitles with video
#32Earlier 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.
Ohh now I got you. I believe README should be improved in this part then. It reads: ==== Although it can usually work if all you have is the video file, it will be faster (and potentially more accurate) if you have a correctly synchronized "reference" srt file, in which case you can do the following: subsync reference.srt -i unsynchronized.srt -o synchronized.srt ==== I believe you should explain that if you have a r…
Re: Show HN: Automatically synchronize subtitles with video
#33This 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…
A neat subtitle feature I found out mpv has, but no other video player: Hide those parts of the subtitle which are mainly for those with impaired hearing like '[loud noise]' etc, but keep the rest: `mpv --sub-filter-sdh ...` That logic could probably be extracted into a separate subtitle filtering tool.
Re: Show HN: Automatically synchronize subtitles with video
#34That'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.
Re: Show HN: Automatically synchronize subtitles with video
#35Recently I rolled my own code to play WebVTT to an audio (think video without the pictures) track. I had assumed there would be off the shelf libraries that would do this for me. Oh how wrong I was!
I took it a bit further than white text in a black box at the foot of the screen. Not having pictures kind of made it that way. So I decided I needed cartoon grade speech bubbles, with the speech bubble coming from the left for one voice and the other side of the screen for the other voice, again finding myself in the realms of no ready made examples to do this. The speech bubbles had to scale to fit the content with them being suitably rounded, a la cartoon style. I found an SVG solution to my problem.
The WebVTT format and variants have all kinds of goodies in them to position speech and do things in time, as per karaoke.
I think one reason I found myself in the world of rare code was that we assume anything to do with accessibility is for disabled people and therefore has to be boring and done with no creativity whatsoever.
Re: Show HN: Automatically synchronize subtitles with video
#36Surely you can do much better than this using a speech recogniser?
By speech recognizer, are you referring to a method that would perform speech-to-text transcription? If so, you could probably do better when your video and subtitles are in the same language, but you would lose the ability to be language-agnostic (unless you manage to solve machine translation well enough :) Interestingly enough, I haven't actually found any cases where the synchronization doesn't work (assuming the…
Re: Show HN: Automatically synchronize subtitles with video
#37Earlier quoted context omitted.
By speech recognizer, are you referring to a method that would perform speech-to-text transcription? If so, you could probably do better when your video and subtitles are in the same language, but you would lose the ability to be language-agnostic (unless you manage to solve machine translation well enough :) Interestingly enough, I haven't actually found any cases where the synchronization doesn't work (assuming the…
Frequently there will be subtitles that describe sounds and noises for the deaf (i.e. door closes). How is this handled?
These will introduce some noise, but the synchronization algorithm seems to be robust enough that noise doesn't matter (whether it's from the voice activity detector or from non speech-related subtitles).
Re: Show HN: Automatically synchronize subtitles with video
#38Sorry for the dumb question, but what exactly does this do? `subsync reference.srt -i unsynchronized.srt -o synchronized.srt` I mean, I already have a synchronized srt file, so what would I be syncing here?
I haven’t tried this command, but I believe the use case is as follows: • Open audio/video file with —supposedly— synchronized file • After a few seconds, I realize the subtitles appear before/after the dialogues • I immediately close the multimedia player, and open the Terminal • I execute the “subsync” command which does who knows what • Open the SRT and discover that the subtitles are now in the correct timestamps…
Re: Show HN: Automatically synchronize subtitles with video
#39Earlier 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.
Given it just processes audio, how long does processing one video file usually take?
Re: Show HN: Automatically synchronize subtitles with video
#40Not sure I understand this right - is this basically treating both binary strings as square waves, converting them to the frequency domain and determining the offset as a pitch shift between the two spectrograms?