Complete support for .srt subtitles

Feature requests for VLC.
ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Complete support for .srt subtitles

Postby ale5000 » 01 Sep 2008 23:15

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
Last edited by ale5000 on 19 Sep 2008 03:00, edited 8 times in total.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Complete support for .srt subtitles

Postby VLC_help » 02 Sep 2008 09:04

You have specs for these? And have you tried nightly builds?
http://nightlies.videolan.org/
https://trac.videolan.org/vlc/ticket/1825

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 02 Sep 2008 14:33

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.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 07 Sep 2008 00:13

I have made a table to show current progess of players in supporting these things: http://ale5000.altervista.org/subtitles.htm

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 08 Sep 2008 20:19

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?

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 09 Sep 2008 11:18

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.
Last edited by ale5000 on 18 Sep 2008 02:56, edited 1 time in total.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 11 Sep 2008 20:49

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Complete support for .srt subtitles

Postby dionoea » 12 Sep 2008 16:21

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.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Complete support for .srt subtitles

Postby Jean-Baptiste Kempf » 12 Sep 2008 18:52

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...
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 12 Sep 2008 20:41

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.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 13 Sep 2008 13:05

- 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"
Last edited by ale5000 on 22 Sep 2008 11:38, edited 3 times in total.

boing
Blank Cone
Blank Cone
Posts: 13
Joined: 03 Sep 2008 21:59
VLC version: 1.0.0-git
Operating System: Linux
Location: Cholet (49), France

Re: Complete support for .srt subtitles

Postby boing » 14 Sep 2008 13:37

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

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 14 Sep 2008 22:02

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.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 18 Sep 2008 02:43

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
Last edited by ale5000 on 20 Sep 2008 00:34, edited 1 time in total.

boing
Blank Cone
Blank Cone
Posts: 13
Joined: 03 Sep 2008 21:59
VLC version: 1.0.0-git
Operating System: Linux
Location: Cholet (49), France

Re: Complete support for .srt subtitles

Postby boing » 19 Sep 2008 22:03

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

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 20 Sep 2008 00:33

@boing: Probably they aren't so synchronized between different OS.

@Developers: Are there problems with bold and italics?

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 20 Sep 2008 01:43

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".

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 20 Sep 2008 17:56

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.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 20 Sep 2008 21:32

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/

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 21 Sep 2008 00:07

It does that because we have a precision of about one or two frames (40/80ms) for subtitle rendering, so ...

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 21 Sep 2008 00:11

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 _ ;)

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 21 Sep 2008 02:51

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
Last edited by ale5000 on 22 Sep 2008 01:40, edited 1 time in total.

fenrir
Blank Cone
Blank Cone
Posts: 45
Joined: 09 Mar 2004 21:45

Re: Complete support for .srt subtitles

Postby fenrir » 21 Sep 2008 23:54

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?

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 22 Sep 2008 01:40

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.
Last edited by ale5000 on 23 Sep 2008 03:07, edited 1 time in total.

ale5000
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 03 Mar 2004 16:12
Operating System: Windows
Contact:

Re: Complete support for .srt subtitles

Postby ale5000 » 22 Sep 2008 11:30

"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.


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: Google [Bot] and 17 guests