Log in

View Full Version : Subtitle standard


Catman
18th March 2005, 10:53
Hi! Can anyone give me a link where I could read about the parameters of standard subtitles? I mean for example what is the maximum number of lines that can be displayed one time?

violao
18th March 2005, 16:55
What are "standard subtitles"?

unmei
18th March 2005, 20:20
everything i could consider a "standard" - vobsubs, srt, ssa, those mp4 text subs (he probably doesnt refer to..) - do not have a limit on the number of allowed lines. The limit is what part of the picture you want to cover ..ie you can fill the entire movie frame area with subtitles ..might be around a dozen of lines .. i never tried :)

Catman
21st March 2005, 08:25
Oh, sorry, I forgot to mention, that I mean standard DVD subtitles. :)

violao
21st March 2005, 10:57
http://dvd.sourceforge.net/spu_notes

smiller667
21st March 2005, 11:05
Subtitles on a DVD are not text-based, but bitmap-based. They can fill the entire screen & you are not limited to a certain number of lines of text (or even limited to text at all, logos etc. can also be used).

Try downloading submux-dvd from http://www.home.zonnet.nl/panteltje/dvd/ and read the included docs - they have some valuable information on the format.

Steve

Catman
23rd March 2005, 08:56
Thanks for the replys.

smiller667, I know, that they are bitmap based, but I have experienced some strange things. I have created a dvd from avi, and I have added some subtitles. There were some subtitles which had three lines of text, and when I whatched it on tv, it was not properly displayed. It was flickering (not really flickering, but like the tv had very low refresh rate), and there wehe also some garbage displayed between the lines. But when there were only two lines displayed, it was correct. So this is why I asked, I thought there might be any standard which says "only two lines of text are displayed correctly", or something like that... So I don't know what the problem is...

ac-chan123
23rd March 2005, 09:04
the subpiture have a low limited bitrate. Maybe the 3 lines are to much.

Catman
23rd March 2005, 10:38
Hm, that's a good idea...

unmei
23rd March 2005, 21:04
@ac-chan123: Do you happen to know that rate just like this? I remember something about 32KByte .. but is is 32KByte/sec or 32KByte per frame ..or was it KBits, or something completly different?

[edit] with "frame" i mean one SPU, not one frame in an associated video stream..

mpucoder
24th March 2005, 06:43
There is no limit on the number of lines, it is all graphics. But you do have to be careful about two things that can cause flicker. Extreme contrast is one problem that gets worse with more text on the screen. The other is aliasing, mainly caused by too much detail. Horizontal lines should be a least 2 lines thick to prevent flicker caused by the time difference in the fields. Anti-aliasing is possible on a limited basis (working with only 4 colors)

As for the limits, 53220 bytes is the limit per SPU. That includes all the overhead bytes, not just the graphic buffer. The bitrate is limited to 3.36Mbps, so that is seldom a factor.

ac-chan123
24th March 2005, 07:51
Originally posted by mpucoder
As for the limits, 53220 bytes is the limit per SPU. That includes all the overhead bytes, not just the graphic buffer. The bitrate is limited to 3.36Mbps, so that is seldom a factor.

That canīt be right. If you can use 53KBytes per frame and max. 30fps the total is ~1.5MBytes. Or mean you Fields and not Frames?
You donīt forget that the Subpicture are compressed with RLE wich is a real low compression for pictures?

Catman
24th March 2005, 09:21
Now that is exactly the information I was looking for. :) But as I remember in some bitrate calculator I have seen 32Kbit/sec for subtitles stream...

I will also try low contrast colors.

violao
24th March 2005, 13:22
Originally posted by Catman
...I have added some subtitles. There were some subtitles which had three lines of text, and when I whatched it on tv, it was not properly displayed. It was flickering ...
At this point I would first suspect on subtitle authoring program. What are you using?

I remember having similar "flickering" problems with earlier versions of SubtitleCreator. The problem was solved recently. I think it's a good idea to have subpictures of even height placed at even offset from top/bottom.

Contrast would certainly not affect bitrate since subpitures don't even use colors. They only refer to the PGC palette entries using indexes.

violao
24th March 2005, 13:31
Originally posted by ac-chan123
That canīt be right. If you can use 53KBytes per frame and max. 30fps the total is ~1.5MBytes...
It doesn't work like that. Subpictures are not encoded on a per frame basis. They start at vob PTS and last for a number of frames encoded in subpicture pack end sequence. So only one sup pack is needed for a number of frames.

Catman
24th March 2005, 13:41
What are you using?

I remember having similar "flickering" problems with earlier versions of SubtitleCreator...

I am using Srt2Sup.

violao
24th March 2005, 13:54
It is my understanding that Srt2Sup is discontinued because the author lost it's source code so it might be better idea for you to move to some actively developed application. I have good experience with SubtitleCreator and dvdsuptools, although the latter doesn't support antialiasing.

mpucoder
24th March 2005, 14:02
Originally posted by ac-chan123
That canīt be right. If you can use 53KBytes per frame and max. 30fps the total is ~1.5MBytes. Or mean you Fields and not Frames?
You donīt forget that the Subpicture are compressed with RLE wich is a real low compression for pictures?
Like many of the maximums in DVD, you have to work with all of them. Besides the bitrate and SPU size maximum there is also a limit of 1440 bits per line. It might sound impossible to exceed that with 720 pixels of 4 colors, but the overhead of RLE works against you with high detail.
In order to make 30fps subpictures (they do exist) you have to make them small enough to satisfy the bitrate max. Although you can use the full resolution, you don't have to. Most animations I've seen use only 150 or so lines at the bottom of the frame.
And, yes, I'm aware of how they are compressed, Muxman contains a SPU encoder. It's very difficult to make a subpicture so complex that it needs the full 53K. Usually the SPUs that approach the limit have lots of commands in them for effects like scrolling or fading.

Catman
24th March 2005, 16:24
I think I will try SubtitleCreator...

unmei
25th March 2005, 13:36
thanks a lot, mpucoder.
I probably read the +/-53K and remembered it as 35K or the like..
And i did not know there is also a limit per line (however i don't think that's a problem with my simple encoder as it doesnt allow "advanced" commands).

Paddington
27th March 2005, 05:56
Originally posted by mpucoder
Usually the SPUs that approach the limit have lots of commands in them for effects like scrolling or fading.
I have often wondered about the scrolling or fading commands, but as I never found subtitles that actually do this, I have never been able to re-engineer the commands needed. So if you have any information wrt to these commands, I would really appreciate it, and I will try to include them in SubtitleCreator.

smiller667
27th March 2005, 10:51
Originally posted by Paddington
I have often wondered about the scrolling or fading commands, but as I never found subtitles that actually do this, I have never been able to re-engineer the commands needed.The demo dvd that comes with the "DVD demystified" has scrolling & fading subpics (and also animated subpics). I haven't seen it on any other dvd either.

Steve

Paddington
28th March 2005, 00:15
Originally posted by smiller667
The demo dvd that comes with the "DVD demystified" has scrolling & fading subpics (and also animated subpics). I haven't seen it on any other dvd either.
Thanks Steve, for the tip: That would be interesting to look at - any suggestions on how I might obtain this DVD? Wrt animation, I don't think that's too difficult to do - you just have to create a series of subtitle pictures, which you place behind each other. I could do the same for scrolling, and you can find subtitles who do that. Fading is something more difficult, and I would really need a command for that.
Erik

ac-chan123
28th March 2005, 18:02
I have never sayed that every Frame need a new Subpicture. But 30 fps is the max framerate. when you can use only 53kbits per frame, then the max. bitrate for one subpicture stream is ~1.5Mbit. I hope it is now clear what i would like to say.

mpucoder
28th March 2005, 18:07
Yes, I understood you before. I just wanted to point out that there are many constraints. You can use the full 53K per sub as long as you don't also exceed the bitrate. So for most subs, which are onscreen for 60 frames or so, the limiting factor is the buffer size. But for animation the limiting factor is bitrate, and you cannot use the full 53K/sub.