Fixing Overlapping Timecodes in YouTube Auto-Generated Captions: A Comprehensive Guide
Learn how to resolve overlapping timecodes in YouTube auto-generated captions using various tools and methods, ensuring smooth and readable subtitles.
File
How to fix overlapping captions (subtitles), including autogenerated .srt files from YouTube
Added on 09/30/2024
Speakers
add Add new speaker

Speaker 1: Hi, this video is about how to fix the problem of closed captions that display weirdly on the screen because of overlapping timecodes, which is something that can happen if you're basing your captioning on an auto-generated file from YouTube using the kind of method I covered in a previous video. Now, I made a mistake in that video, but it's one of those lucky situations where I still ended up giving the right advice just for the wrong reasons, so I've left it up as it stands and I'm going to explain more here. This comes out of discussions with Christopher Lovell, who made the original how-to video showing the method which I based mine on, and with Thanasis Kineas in the States, who's working on caption issues from a Linux perspective. Incidentally, if you haven't watched Christopher's video, please do, the link's in the description. He can give you something particularly valuable which I can't, which is a deaf user's perspective. In my tutorial, I advise you to download the automatic captions through a website called and not to get them directly from YouTube, because, I said, YouTube provides them in the wrong format. Now, that's not necessarily true. It depends where you look for them. The YouTube interface, showing I think more generosity than clarity, provides at least four different places to download the caption file.

Speaker 2: 1, 2, 3, and 4.

Speaker 1: Now, as to numbers 1, 2, and 4, I was right. The download link just takes you straight to a file in SBV format, which we don't want. The easy format for re-captioning is SRT. But download button number 3 on the View Published Subtitles page, in fact, gives you the option of SBV or SRT, or indeed a third option, that's WebVTT, which I won't go into here. And I should really have remembered this way to get an SRT file from Christopher's video, because that's the method he uses. And it is slightly simpler than my method of using the DownSub website. But you should still use DownSub anyway if you're editing the captions anywhere but inside YouTube Studio itself, because the SRT you get from YouTube is not the same as what you get from DownSub, and there may be a problem with it. If you compare the two, we've got YouTube on the left, DownSub on the right here, you can see that the caption start times are identical, but the caption end times, the time codes of when those captions should disappear off screen, are different. In the DownSub version, they're in perfect sequence. Caption 1 disappears at the exact point that Caption 2 appears. In the YouTube version, they are strangely staggered. Caption 1 stays up with Caption 2, and in fact disappears when Caption 3 appears. And that's the pattern all the way through. So, to visualise what's going on, this is what the DownSub captions do. No overlap there. But the direct YouTube version gives us this. And from the second caption onwards, there are continually two captions trying to be on screen at the same time. So, what happens when two captions have to share a time code? Well, it very much depends. Different systems interpret it differently, which is why it's such a fiddly problem to document and to deal with. If you use these timings for closed captions, then it'll probably be the user's video player that makes the decision. So, for instance, my copy of VLC does this. And this is maybe okay. I don't like it much because there's no animation to show the lower line has moved up, so I keep reading it twice. Other media players, like MPV, do much the same. But look what happened when I did the exact same caption encoding in Handbrake, but set to open rather than closed captions. Remember, this lettering is burned straight into the image of the file, so it'll look the same in any player. And it is totally unusable. And from what Finasys tells me, some closed captions on institutional streaming services have similar problems. You may well ask why YouTube overlaps its time codes in the first place. I did wonder if it was intentional, if the overlaps somehow signified pushing a line up and fitting a new line underneath. But as far as I can establish, no media player and no caption software supports that. In fact, if you open this file in an editing program, like Subtitle Edit, it'll flag up any overlaps as errors needing to be fixed. I suspect the real answer is, YouTube's just a little bit broken, as we all are in these times. Captioning is one of the few things that hasn't been transferred over from the so-called classic studio to the new studio, and I'm not sure it's getting the developer attention it deserves. The auto captions actually start out in a more complex format that allows individual words to build up one by one on the screen, which is how they're presented in the third format, the WebVTT file, and apparently it's easy to end up with overlaps when you simplify that into SRT. But the big clue here is that if you edit the captions from within YouTube in any way, if you make even one tiny inconsequential change and save it, you get a different subtitle file again, which has two lines rather than one line per caption, and again doesn't have any overlaps. So maybe, before you do that, the two-line timecodes exist but are being applied to the one-line captions for some unearthly reason. Now, the instructions in Christopher's video, which include direct download from YouTube, also expect you to do your caption corrections inside YouTube, so following those instructions should be fine, provided you follow them in full. You'll get two-line captions without the overlap. Whereas if you follow my instructions, likewise, that's fine, you'll get non-overlapping one-line captions. So, if you prefer editing caption files outside YouTube, as I do, just make sure you get the SRT file from DownSub, as shown in my previous video. Incidentally, one thing I didn't show you there is that instead of going onto the DownSub site and then entering the YouTube link, you can go straight to downsub.com slash query URL equals, then paste in the YouTube link, including the HTTPS, and it'll get straight to work. And there we have our SRT with, as I say, no overlaps. This works fine on everything I've tested it on. So what if you're already stuck with a file with overlapping timecodes because of the YouTube snafu or for any other reason, and you need to correct it? Well, if you're more confident with coding than I am, you might want to look at these routines people have been writing in the Go language, which automate the job, thanks to Corey Stout for putting me onto these, and you could customize this approach for any specific problems. But most people viewing this, I think, will want something easier, and the easiest way I've found is with a free caption editing program called Aegisub. I'll just show you why I'm not doing this in SubtitleEdit, which is the system I recommended last time, and is in most ways really helpful and easy to use. There's a very promising looking entry on the tools menu called Fix Common Errors, which can sort out all manner of common problems, and one of the settings is Fix Overlapping Display Times. But the way it fixes them is to divide the overlapping section exactly in half, and give half to each of the subtitles alone, which would actually be the best way of dealing automatically with other kinds of overlap. But in the YouTube case, the timings should really look like this, compared to which the timecodes are always going to come in too late, and by an amount which will vary. Now I've tried this out, and it's actually not too bad. It's a bit off, not always noticeably so, but there's no need to put up with it, because Aegisub, which is again free and open source, will do the job we want very easily. Just open the SRT file, select everything, timing, make times continuous, change end, and we're done. Then you have to go to export to make a new SRT, which, if I compare it to the down sub version here, is identical, give or take the odd millisecond. One last thing. I mentioned that my instructions give you one-line captions, that's how I've captioned all my videos so far. But when I showed you the two-line version, you may have been thinking, hang on, I prefer two-line captions, two is a good number of lines, is there some easy way to merge the pairs of single lines together outside of YouTube? Well, there is, but I can show you something even better, and this time you do want subtitle edit. I've got the SRT file up with the correct non-overlapping one-line caption timings here, and I'm going to select everything and go to tools, merge short lines, and then increase this value on maximum characters in one paragraph to something that's a good maximum for two lines of text at a likely size. I find 100 is good. And you'll see here that it's actually merging sometimes two and sometimes three lines, but always to make two lines worth of text. So you then save that as an SRT, and you can edit and encode it as usual. Make sure you do that as the very first step after downloading from YouTube, while the text still doesn't have any punctuation or consistent capitals. The merge operation can mess the formatting up, but not if there's no formatting to mess up. And once you've got your two-line SRT, you can of course work through and correct it using the tricks I showed you in my other videos. So I hope that makes life easier for anyone who was mystified by the overlap problem. If you find any other approaches that you think would be worth sharing, let me know, and I'll do my best to add updates in the description. Bye for now.

ai AI Insights
Summary

Generate a brief summary highlighting the main points of the transcript.

Generate
Title

Generate a concise and relevant title for the transcript based on the main themes and content discussed.

Generate
Keywords

Identify and highlight the key words or phrases most relevant to the content of the transcript.

Generate
Enter your query
Sentiments

Analyze the emotional tone of the transcript to determine whether the sentiment is positive, negative, or neutral.

Generate
Quizzes

Create interactive quizzes based on the content of the transcript to test comprehension or engage users.

Generate
{{ secondsToHumanTime(time) }}
Back
Forward
{{ Math.round(speed * 100) / 100 }}x
{{ secondsToHumanTime(duration) }}
close
New speaker
Add speaker
close
Edit speaker
Save changes
close
Share Transcript