Page 1 of 2

Complete support for .srt subtitles

Posted: 01 Sep 2008 23:15
by ale5000
It would be nice to add the complete support for .srt subtitles.
I have made a .srt file to test features, it is linked in this page: http://ale5000.altervista.org/subtitles.htm

Re: Complete support for .srt subtitles

Posted: 02 Sep 2008 09:04
by VLC_help
You have specs for these? And have you tried nightly builds?
http://nightlies.videolan.org/
https://trac.videolan.org/vlc/ticket/1825

Re: Complete support for .srt subtitles

Posted: 02 Sep 2008 14:33
by ale5000
I don't think that specs exist but you can look at sources of Media Player Classic.
In the latest nighly build there is a incomplete support for color, size and underline but nothing more.

Re: Complete support for .srt subtitles

Posted: 07 Sep 2008 00:13
by ale5000
I have made a table to show current progess of players in supporting these things: http://ale5000.altervista.org/subtitles.htm

Re: Complete support for .srt subtitles

Posted: 08 Sep 2008 20:19
by fenrir
In the master (1.0) I have fixed all issues except
- position (left, right, top, ...)
- subtitles overlap

About overlapped subtitles, what would be the right way?
- The more recent override the previous one?
- or both should be displayed at the same time? and if so, which one should be on the top of the other one?

Re: Complete support for .srt subtitles

Posted: 09 Sep 2008 11:18
by ale5000
Both should be displayed but it isn't so easy to explain in words.

Load "SubRip subtitles capability tester 1.2e by ale5000" with any video from 00:00:31 to 00:00:55 (the part that tests "overlapped subtitles") on "Media Player Classic".
Media Player Classic has the perfect behaviour.

Re: Complete support for .srt subtitles

Posted: 11 Sep 2008 20:49
by ale5000
In the master (1.0) I have fixed all issues except
I have tested it and it only reach 10/19 but it is a very good work compared to the latest stable version, look here: http://ale5000.altervista.org/subtitles.htm

Re: Complete support for .srt subtitles

Posted: 12 Sep 2008 16:21
by dionoea
Your test page should read VLC ... Git and not SVN (since we don't use SVN anymore).
I'll have a look at some of the missing features in the upcoming days.

Re: Complete support for .srt subtitles

Posted: 12 Sep 2008 18:52
by Jean-Baptiste Kempf
Your test page should read VLC ... Git and not SVN (since we don't use SVN anymore).
I'll have a look at some of the missing features in the upcoming days.
First we have to decide of a few things... about subtitles...

Re: Complete support for .srt subtitles

Posted: 12 Sep 2008 20:41
by fenrir
About VLC 1.0 (git) :
- are you sure bold and italics are not working? They work perfectly here. What OS are you using?
- about font face: why would your sample not display anything ? On my computer I do not have the font you request, so instead of loosing the subtitle, a default font is used. I will not change this behavior, because we would end up loosing subtitles. Font face using an existing font should already be supported.
- Support for "display coordinates" is broken by design and I will not implement it UNLESS the video size is embedded in the subtitle (but it does not seems to be there). You cannot be sure the video has not been re-encoded with a lower resolution.
- "Hide these tags: {\some_letters_or_num}". I am curious, why should we not display them?

I am working on the overlap problem and I am sure to have a solution very soon.

Re: Complete support for .srt subtitles

Posted: 13 Sep 2008 13:05
by ale5000
- are you sure bold and italics are not working? They work perfectly here. What OS are you using?
I'm sure, my OS is Windows XP SP3
- about font face: why would your sample not display anything ? On my computer I do not have the font you request, so instead of loosing the subtitle, a default font is used. I will not change this behavior, because we would end up loosing subtitles. Font face using an existing font should already be supported.
The font "Webdings" on Windows has symbols instead of letters so it should look like this: http://ale5000.altervista.org/other/MPC_subtitles.png
So this is the meaning of "If you read this text, the player don't support font face"
On Windows XP SP3 it doesn't work.
- Support for "display coordinates" is broken by design and I will not implement it UNLESS the video size is embedded in the subtitle (but it does not seems to be there). You cannot be sure the video has not been re-encoded with a lower resolution.
But could be added the option to enable/disable support of them on the fly, so if the video has been re-encoded they can be disabled.
Also there can be an automatic detection if they appear outside the video and if it happens they can be disabled automatically.
- "Hide these tags: {\some_letters_or_num}". I am curious, why should we not display them?
Because there can be other tags less known that the player don't support, it is like "hide invalid html tags".

About "Read subs inside a Multipart OpenDML AVI", VLC detect the subtitles track but if I enable them then nothing happen.
Subtitles can be inserted in the avi with "AVI-Mux GUI 1.17.7"

Re: Complete support for .srt subtitles

Posted: 14 Sep 2008 13:37
by boing
Hello,

First sorry for the pictures in the post, my web account has been suspended...

Using vlc-1.0.0-git on Ubuntu 8.04 (Hardy Heron) I did some test with your subtitles file and found that :
- font face : it works perfectly for me, but vlc has to be able to display the font... I tried to install msttf fonts (with the Webdings one) and use it in vlc but it seems to me that this font can't be used with vlc, nothing was displayed
By modifying your sub file to use one of my linux font (Purisa.ttf), it works like a charm Image

- subs parameters are ignored if one of them is incorrect :
You tried

Code: Select all

3 00:00:07,601 --> 00:00:11,500 This should be an E with an accent: È <b><i><u>This text should be bold italics and underline</u></i></b> <font color="#00ff00">This text should be small and green</font> <font color=#ff0000 size=9>This text should be small and red</font> <font color=brown size=24>This text should be big and brown</font>
and only white plain text is displayed (also for me)
but it seems that vlc:
- does not support text for color (red, green, brown...), only rgb in hexa ( #ff0000 for red )
- completely wipes out the subs parameters (colors, bold, font type...) if one is incorrect: no "" for the parameters, color name instead of rgb components, unknown parameter... the main problem is that vlc deletes ALL parameters for the displayed strings, not only the ones it does not understand (if you just remove only one " in the following code, it won't work anymore)
vlc switches back to it's default font and parameters when a incorrect/unknown parameter is found

Code: Select all

3 00:00:07,601 --> 00:00:11,500 This should be an E with an accent: È <b><i><u>This text should be bold italics and underline</u></i></b> <font color="#00ff00">This text should be small and green</font> <font color="#ff0000" size="9">This text should be small and red</font> <font color="#bf7d35" size="24">This text should be big and brown</font>
gives
Image

For the rest of the remarks, I agree, it's not working correctly also for me
Personally the vertical/horizontal placement is not a problem... but the overlapping is

EDIT: the \an parameter is not working here

Re: Complete support for .srt subtitles

Posted: 14 Sep 2008 22:02
by ale5000
Using vlc-1.0.0-git on Ubuntu 8.04 (Hardy Heron) I did some test with your subtitles file and found that :
- font face : it works perfectly for me, but vlc has to be able to display the font... I tried to install msttf fonts (with the Webdings one) and use it in vlc but it seems to me that this font can't be used with vlc, nothing was displayed
By modifying your sub file to use one of my linux font (Purisa.ttf), it works like a charm Image
Maybe it works on linux but on windows it doesn't work, I have tried also with "Algerian" font (ALGER.TTF).
and only white plain text is displayed (also for me)
but it seems that vlc:
- does not support text for color (red, green, brown...), only rgb in hexa ( #ff0000 for red )
- completely wipes out the subs parameters (colors, bold, font type...) if one is incorrect: no "" for the parameters, color name instead of rgb components, unknown parameter... the main problem is that vlc deletes ALL parameters for the displayed strings, not only the ones it does not understand (if you just remove only one " in the following code, it won't work anymore)
vlc switches back to it's default font and parameters when a incorrect/unknown parameter is found

Code: Select all

3 00:00:07,501 --> 00:00:11,500 This should be an E with an accent: È <b><i><u>This text should be bold, italics and underline</u></i></b> <font size=9 color="00ff00">This text should be small and green</font> <font color=#ff0000 size=9>This text should be small and red</font> <font color=brown size=24>This text should be big and brown</font>
On vlc 1.0.0 git 2008-09-12 0006 for Windows they works fine except bold and italics.

Re: Complete support for .srt subtitles

Posted: 18 Sep 2008 02:43
by ale5000
The two subtitle from 00:00:50,501 to 00:00:55,500 are shown in the incorrect order but everything else in the "overlapped subtitles" support is fine,
you have made a very good work on 2008-09-18 build.

PS: The latest version of the subtitle file now is 1.2f, re-download it if you have an older version.
PS2: Look also at this part of the table about "Bugs detected by SubRip subtitles bug tester":
1) If there aren't 2 newlines at the end of the .srt file then the last message is NOT displayed
2) If the start time is less then 00:00:00,025 the message is NOT displayed

Re: Complete support for .srt subtitles

Posted: 19 Sep 2008 22:03
by boing
Hello,

Well on my ubuntu box everything is working fine, except the overlapping thing (the most useful for me...)

EDIT: The last line ("Hide these tags...") is also shown completely

Re: Complete support for .srt subtitles

Posted: 20 Sep 2008 00:33
by ale5000
@boing: Probably they aren't so synchronized between different OS.

@Developers: Are there problems with bold and italics?

Re: Complete support for .srt subtitles

Posted: 20 Sep 2008 01:43
by ale5000
I have inserted "SubRip subtitles capability tester ALTERNATIVE 1.0b by ale5000" in the same page of the table that allow to test better "overlapped subtitles".

Re: Complete support for .srt subtitles

Posted: 20 Sep 2008 17:56
by fenrir
I have fixed all overlap positioning problems except one in your last test:
the one with a subtitle that starts 1 frame before the end of the previous subtitle.
I will try to see why but it does not seem really important for me.

About the italic/bold problem, it isn't present under linux, so it may be a win32 vlc specific problem. I will try to debug it.

Re: Complete support for .srt subtitles

Posted: 20 Sep 2008 21:32
by ale5000
except one in your last test:
the one with a subtitle that starts 1 frame before the end of the previous subtitle.
This one: 00:00:45,499 --> 00:00:50,500
If I change it to 00:00:45,480 --> 00:00:50,500 then it works fine, it's strange.

PS: Look on http://nightlies.videolan.org/build/intrepid-i386/arch/
although the date say 20-Sep-2008, the filename say 20080906 so it is pretty old, broken?
The same for http://nightlies.videolan.org/build/int ... md64/arch/

Re: Complete support for .srt subtitles

Posted: 21 Sep 2008 00:07
by fenrir
It does that because we have a precision of about one or two frames (40/80ms) for subtitle rendering, so ...

Re: Complete support for .srt subtitles

Posted: 21 Sep 2008 00:11
by fenrir
By the way, I have a question about "Hide these tags: {\some_letters_or_num}" :
What characters are allowed inside the {\} ?
If some_letters_or_num is really only A-Z aZ and 0-9 then the one you use will not be hidden because of _ ;)

Re: Complete support for .srt subtitles

Posted: 21 Sep 2008 02:51
by ale5000
What characters are allowed inside the {\} ?
All chars, now it is "Hide these tags: {\some_letters_or_numbers_or_chars}" :D

PS: I have added

Code: Select all

1 00:00:00,000 --> 00:00:00,000 Don't show this text it may be used to insert hidden data

Re: Complete support for .srt subtitles

Posted: 21 Sep 2008 23:54
by fenrir
I have fixed the positioning of
00:00:45,499 --> 00:00:50,500

I am looking at the invalid tags and <> display and I will add "support" for it but I don't really feel that a player should handle such broken streams/designs. Using html tags and <> instead of </> seems wrong (Not that vlc supports correctly </> yet ;) ).

By the way, what is the meaning and format of {\frX} ?

About:
1
00:00:00,000 --> 00:00:00,000
;Don't show this text it may be used to insert hidden data

Why should I ignore it? Is it because of the start and stop time being the same? Or because of the ; used as the first character?

Re: Complete support for .srt subtitles

Posted: 22 Sep 2008 01:40
by ale5000
I am looking at the invalid tags and <> display and I will add "support" for it but I don't really feel that a player should handle such broken streams/designs. Using html tags and <> instead of </> seems wrong (Not that vlc supports correctly </> yet ).
Although some html tag are supported it isn't a complete html parser and it don't need to be also I haven't seen a player that support </>
Could be made in a way that if the parser find a > without first encounter a < (not already part of other < > couples) it is considered as text also if the parser find a < and then another < then re-consider the first "<" as text.
By the way, what is the meaning and format of {\frX} ?
\fr => "Rotates the text by the specified number of degrees, in the specified axis. If axis is omitted, then "z" is used as default."
Why should I ignore it? Is it because of the start and stop time being the same? Or because of the ; used as the first character?
It is because start and stop time being the same.

Re: Complete support for .srt subtitles

Posted: 22 Sep 2008 11:30
by ale5000
"overlapped subtitles" works perfectly although the build of today is a bit unstable.
The text at 00:00:15,501 --> 00:00:20,500 in "SubRip subtitles capability tester ALTERNATIVE" is split in four lines when it should fit in three lines.