Converting subitles from wsrt to srt

If you are from Sweden or are watching swedish TV anyway chances are that you have come across subtitle files with the extension wsrt. I know I have, and with that, prepare for one of my unnecessary long rants where I try and explain things, if you are only interested in the converter tool you can find it here.

For those that don’t know SubRip or srt is a popular subtitle format for videos on the internet. wsrt on the other hand is not, in fact as far as I know the only sites that use it are SVTPlay and ÖppetArkiv, both of which are run by Sveriges Television. This leads me to believe that wsrt is probably an in-house format for subtitles that Sveriges Television use. Well, that’s great but what if you want to play them in an external player like say VLC or Emby? Then you are out of luck, it wont work because they don’t support the format.

Now here is the good part, wsrt just as the extension suggests is actually based on srt. In fact wsrt and srt files look almost identical but wsrt has a few extra features. Great, then I can just rename the file to have the srt extension and it will be fine you might be saying now, and well, you are partly right. For some players like for example VLC it will actually work but for some it won’t. The reason for this is a small but annoying change that was made to the time in the wsrt file format. Lets see if you can catch it.

00:00:42.640 –> 00:00:48.720
00:00:42,640 –> 00:00:48,720

Ok so the top one is in the wsrt format and the bottom one is in the srt format. The difference is very small but enough to make a lot of players out there say that no, I don’t know anything about this and if you are lucky just keep playing the video without subtitles or if you are unlucky, BAAM, the player will crash.

So what is the small difference, did you catch it? Ok, ok, I’ll tell you. In srt there is a comma, in wsrt this comma has been replaced by a dot. That’s it, well to be honest there are some other additions made to the wsrt format but they don’t seem to mess things up as long as you get those dots replaced. And replacing the dots, is an easy task, it’s just extremely time consuming. Considering the file I took the example from had about 5500 lines meaning there is probably about 1100 lines where you need to go in and replace the dot with a comma. There is no way that I am going to do that for every wsrt file I want to use, so how do we fix this?

Easy, we do  a quick search and replace and all the dots will become commas. Ohh, wait maybe not, don’t most sentences usually end with a dot? Yeah, silly mistake you might think, there is no way that happened, unfortunately you would be wrong, I am that stupid from time to time. So now that we have established that how will we go about doing it then? It’s actually pretty easy, what we do is we search for all the dots that have a character after them and then we replace that dot with a comma. And we are done.

To make this process a little bit easier in the future I made a small web utility that does this for you, the tool is available for anyone to use on my tools page and the source has been released on GitHub. At the moment the tool won’t do anything about the other improvements to the format, I might go back and add that later but it isn’t really a problem as far as I can tell so probably not.

Update: The tool will now also remove other wsrt specific meta data. I think all of it will get removed but if you should find anything that gets left please leave a comment and let me know so I can fix it.

Update 2: Apparently some players can’t handle files encoded in UTF-8. Should you get some weird characters when using the text try to encode it with windows-1252 instead. I added an option for this to the tool, I also fixed a problem with the file name that occurred on Firefox.

9 thoughts on “Converting subitles from wsrt to srt

  1. Thank you for that detailed explanation of the two file formats. Also thanks for your hard work to make a utility to convert wsrt to srt. It is much appreciated.

    1. It doesn’t no.

      But it could be added, any particular reason why you would want that? As far as I know it is a format only used by the SVT player, have you found something else that’s using it?

  2. Thank you for this tool . i downloaded a srt subtitle for a korean movie but it was not working on the TV , only on the computer . the file was like you said wsrt .
    after using your tool it works great on the TV.

    thank you

  3. tacken Herr’n för ditt bidrag till världen! Härmed har du uppfyllt din plikt här på jorden, mission kompliit 😉

  4. Worked out exactly the way you said it would: I simply renamed the .wsrt subitle file for Midnattssol to .srt, and it worked like a charm. Didn’t have to convert anything. I do use VLC, but I’m also on a mac. Maybe that helps too in this case?

    Either way: thank you for the tip.

Leave a Reply

Your email address will not be published. Required fields are marked *