Log in

View Full Version : Fansubbers: TCMP Incoming subtitle format


BlackSun
17th August 2002, 09:10
[Toff] and I are working on a new subtitles format, we know that a bunch exists, but we want to provide you a good solution and an easier solution than SSA.

The file format is XML based:
http://www.lordox.ovh.org/sexy/tcmpsub_spec.zip

Give us your comments ;)

[Toff]
17th August 2002, 10:53
Oups ! I forget some details.
(new file sent to BlackSun for upload)

I've added a "language" element to the "metadata" element:

<metadata>
<!-- ISO 639-1: 2-letter codes -->
<language code="en">English</language>
</metadata>

And a "relative-to" attribute to the "position" element so your subtitle position can be relative to the window or to the video :

<position alignement="BottomCenter" vertical-margin="20%" relative-to="Window" />

Also I forget to say that margin can be in pixels or in %.

Bulletproof
18th August 2002, 02:30
All the power to you, but I think right now the most time consuming thing is the actual timing process, if you could write up a GUI program that lets you time with this form of script and it is more efficient than SSA then that would be great.

Yusaku
18th August 2002, 04:14
I think that you should not have any predefined effects like "zoom out" etc. Much nicer would be the ability to have possibility to script this yourselves. I don't think this should go to the "styles"'s element though, because quite often you want to distinguish styles from (motion) effects.

In the end, I think effects + styles should be powerfull enough to script karaoke filling with them, movement+rotation over a bezier curve and stuff like that (rasterizer.cpp from VDub's subtitler is heavily underestimated library, even in ASS)

Ex.:

<!headers />
<styles>
<!-- style defs-->
</styles>

<effects>
<effect name="Fadeout">
<starttime stylename="style_at_the_start_of_effect" />
<starttime offset="500">
<!--override style at starttime + 500ms-->
<fontstyle size="130%" alpha="100%"/>
<position relative-to="bottom right">
</starttime>
<endtime offset="33%">
<fontstyle size="100%" alpha="30%" yscale="300%" />
<position relative-to="bottom right">
</endtime>
<endtime>
<fontstyle alpha="0%" yscale="500%" />
<position relative-to="bottom right" xoffset="-500px" />
</endtime>
</effect>
</effects>

<subtitles />

Meaning a definition of effect named "Fadeout" that will set the style at the start, then continue enlarging text to 130% and (possibly) increasing alpha to 100% (opaque) during the first half a second.

Considering standard 2secs subtitle, from 500 till 1500ms (33% off the end from the remaining 1,5sec) it would keep on stretching the sub to the top (baseline still) and back to 100% width (right side of bounding box still, shrinking a bit); and lovering the opacity to 30%.

And from 1500 till 2000ms, sub would slowly completely disappear, stretch a bit more in the Y direction and escape to the top of the screen.



Ughhh... pretty complicated, I wouldn't want to write it :)
But if you want to write a new subtitle format, there should be a reason to do it. Simplicity is simply not the factor, I don't think average Joe will find XML easier than SSA / ASS. Unless you write a nice XSLT for usage in MSIE, with a nice HTA to go that will serve as a nice editor that is... (hey! look at normal, fixed structure SSA and compare it to your mess ^_^)

So, ruling out the simplicity, the reason should be obsoleteness of SSA. I completely agree, we need some new format - ASS is great, but for a lot of scriptable things we still keep on using Premiere & other stuff simply because SSA is not powerful enough.
Man, so much programming ahead :(

Edit: added <code> ubb stuff :scared:

[Toff]
18th August 2002, 14:44
Thanks for your input Yusaku.

Of course it would be great to have scriptable effect.
I think you would like to be able to define some key frames for your effect and then the player interpolate the delta frames. Yes it's a great idea.
But like you said it's pretty complicated.
We must do that in real time whithout overloading the CPU.
ATM DirectShow is not really helpfull doing effect like fade in, fade out or other forms of alpha-blending.
I hope that DirectX9 will change that.

There is a lots of "simple" format and a lot's of them have some default.
The main default is that there is no official specification for lot's of them. So each player use is own specification, add some special tag ...
It's why we want to have some official spec.
And as I'm not an expert in subtitling your input are very usefull.

I keep your idea in mind.
Thanks again.

Yusaku
18th August 2002, 18:08
Well, the thing is that gabest's ASS format from http://vobsub.edensrising.com (textsub + DVobSub) is now de facto standard in fansubbing. And since it can do a LOT, can be overlaid realtime over video in DShow or in VDUb/AVISynth, it is really nice thing. Also in the program you already have functions for polygonizing TT fonts, movement etc; and it is open-source, so you can include it directly in the player if you want (as Gabest did in his MPC). So IMHO all the work necessary here would be to link it with XML parser and include it in gabest's codebase; because the restrictions it is facing now are not based in code - it can do a lot now (motion support, beziers rendering, alpha blending...). Instead, it is limited with all the compatibility stuff implied from ASS - including XML parser could not hurt I guess.

[Toff]
18th August 2002, 19:57
I must definitely try the ASS format with Vobsub.
Too bad there is no demo script ATM.
I think some part are from VirtualDub which is under the GPL license. So as BlackSun don't want to release the code we can't use it :-(

If see just one small default with DVobsub, it's that it work as a transform filter and not as a renderer filter. It can only work on the video surface, to put text in the black bars it need to had them itself and when you resize the video window the text is stretched by you video card so text became blured.
Other than that it's wonderfull.

Yusaku
18th August 2002, 20:52
well, considering the opensource:
it is encapsulated in vobsub.dll, so as long as you just enhance (and leave opensource) the DLL, it is possible to turn off the subs and subbing is not the main goal of your program, you can use it under generic GPL (heck, even gabest's vobsub is not released under GPL, even though sources are public) and just link to the library.

about renderer: well... drawing on YUV surface is not the case of MPC - try it :). But to be honest I like drawing on the YUV the most - it looks as if the subs are embedded in the video :)

And about black bars - nope, DVobSub has te possibility of adding the bars automaticaly, you don'thave to encode them in the actual movie. So at the cost of slightly higher processor usage it can be done (enlarging the overlay surface doesn't have so big processor impact hovewer...).

Ad demo for ASS: hmm... see PM.