Removing some lines from .srt subtitle files

The .srt format seems to be most popular for storing subtitles for corresponding video files. It is very flexible (allowing you to define begin and end of displaying each phrase to the level of single frame).

One big disadvantage of this format is that it is indexed. Meaning that each following line has a consequential numbering. You cannot simply delete let’s say line number 511 (as you would do in case of .txt or other subtitle file formats), because you’d have to renumber manually all following lines. Which, in case of modern movies, can have up to 1000-2000 lines.

Thus, if you wish to get rid of some line or lines (i.e. sound-like sentence) you must either use some designated software that will do the auto-renumbering of the following lines (not covered in this article) or do this manually, keeping some tips in your mind.

Since you can’t simply remove a line, you have to clear the text that is being displayed on screen.

For example, to turn something like this:

9
00:02:07,240 --> 00:02:09,368
[crying loudly]
10
00:02:51,600 --> 00:02:56,447
My birthday actually began
the way of all my birthdays.

Into something like this:

9
00:02:07,240 --> 00:02:09,368
 
10
00:02:51,600 --> 00:02:56,447
My birthday actually began
the way of all my birthdays.

And that’s it. Instead of unwanted phrase and empty line will be shown in the screen.

All that you need to remember is that you must replace removed sentence with a single space character. Never replace such lines with empty ones, because many modern video players gets wako on this. Instead of not showing you nothing, they start to show you following line (which is a timeframe designation of the following subtitle sentence). And they do this in an incorrect moment.

Seems that empty lines are not supported by video player or by .srt file format itself.

Leave a Reply