Closed gnanet closed 3 months ago
Well, it's not really wrong. There is no spec. And it's not Matroska's format, not up to them. Also, interestingly, the Wikipedia article says
4. A blank line containing no text, indicating the end of this subtitle
but Matroska wiki has changed to
4. A blank line indicating the start of a new subtitle.
https://www.matroska.org/technical/subtitles.html#srt-subtitles
I find extra blank lines (beyond the conventional final newline) silly, especially since many people like myself have configured text editors to strip extra trailing spaces to avoid, among other things, excessive git diffs. So, it's easy to lose that extra.
But if you have observed some players require this silly extra, I think it's fine to add. We can be accomodating.
Honestly, i have not followed the link from wikipedia over to matroska's text, but i see their intent. Even WEBVTT is already describe this, and its also a logical not to require a blank line at EOF. But as i saw the difference to the SRT generated by https://github.com/Softcatala/whisper-ctranslate2 and the edited one saved by aeidon, and found the description on wikipedia, i accepted the fact that an obscure requirement could drop the last subtitle. At the time i was preparing the PR i was wondering how this was not an issue for other users.
If there will be reports in the future about problems with the "new" srt, i can live with reverting.
I think, what you started as a finger-practice, grown to a very useful project, the code was easy to read for me as a non programmer. There was no issue i could not work around somehow, and all the basic needs are fulfilled for fine tune auto-transcripted subtitles and then do a translation. Everything is intuitive and comfortable.
I am closing this issue.
SinceAt least by the time of commit f144502 the SRT format is written wrong, causing some players to skip the last subtitle item.The problem lies in misunderstanding the "one subtitle item": the empty line is an integrated piece of a subtitle-item, thus it has to be written even after the last subtitle item.
The SRT format line-by-line (https://en.wikipedia.org/wiki/SubRip)
Simply said: the SRT must end with an empty line.
The SRT generated with latest version gaupol/aeidon:
This SRT was manually corrected, to contain the missing empty line: