Log in

View Full Version : Suggestions for developing a subtitle renderer


Youka
4th December 2012, 01:27
I'm planning to develop a new subtitle render filter + format as alternative to VSFilter (http://en.wikipedia.org/wiki/DirectVobSub) and ASS (http://en.wikipedia.org/wiki/SubStation_Alpha#Advanced_SubStation_Alpha), but focused on typesetting.
Main advantage should be a better choice of more powerful styling tags (http://aegisub.cellosoft.com/docs/ASS_Tags), so simple 3D rendering, gradients and animations by math expressions should be possible too.
The filter should support plugin interfaces for DShow, VDub and AviSynth, be able to render softsub (so it should be very fast) and make subbing more enjoyable.

Currently my blueprint for a new format looks like that:
#META
Title: Test
Author: Youka
Version: 1
Description: Hello world!

#DESTINATION
Width: 800
Height: 600
Depth: 1000
View: orthogonal

#STYLES
MyShape: [border=2;join=miter;color=00FF00,00FF00,00FFFF,00FFFF;mode=lines]
Simple: [font=Times New Roman;size=80.5;bold=n;underline=y;position=200.5,-6.125,-30.5;alignment=0.5,0.5;space=0,-10]
Advanced: [Simple;translate-x=50;matrix=1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1;border=2;color=FFFF00;alpha=A0;blend=add;blur-v=4;(500,-1000,sin(t*_pi),position=0,300.25&color=0000FF);(balpha=00)]

#SOURCE
//I'm a comment!
0-8.0|MyShape|Just some lines|0 0 100.5 100 200 -20.25 200 200
10.0-1:25.0|Advanced||ひらがな\n [italic=y]Ähm

Styling tags are planned as...
font
size
bold
italic
underline
strikeout
language

position
alignment
margin
direction
space

rotate
scale
translate
shear
matrix
reset

mode
border
join
deform

color
bcolor
alpha
balpha
texture
texfill

stencil
blend
blur

kdur
kset
keff

(animation)

-----------------------

font="Arial"

size=30.0

bold=n

italic=n

underline=n

strikeout=n

language=en_US

position=0.0,0.0
position=0.0,0.0,0.0

alignment=7
alignment=0.0,0.0

margin=0.0
margin=0.0,0.0,0.0,0.0
margin-top=0.0
margin-right=0.0
margin-bottom=0.0
margin-left=0.0

direction=0.0

space=0.0
space=0.0,0.0
space-h=0.0
space-v=0.0

rotate=0.0,0.0,0.0
rotate-x=0.0
rotate-y=0.0
rotate-z=0.0

scale=0.0,0.0
scale-x=0.0
scale-y=0.0

translate=0.0,0.0,0.0
translate-x=0.0
translate-y=0.0
translate-z=0.0

shear=0.0,0.0
shear-x=0.0
shear-y=0.0

matrix=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0

reset

mode=text

border=0.0

join=round

deform=

color=FFFFFF
color=FFFFFF,FFFFFF,FFFFFF,FFFFFF

bcolor=FFFFFF
bcolor=FFFFFF,FFFFFF,FFFFFF,FFFFFF

alpha=FF
alpha=FF,FF,FF,FF

balpha=FF
balpha=FF,FF,FF,FF

texture=

texfill=0.0,0.0,1.0,1.0
texfill=0.0,0.0,1.0,1.0,clamp

stencil=clear

blend=normal

blur=0.0
blur=0.0,0.0
blur-h=0.0
blur-v=0.0

kdur=0
kset=0
keff=FF0000

(position=100,0)
(sin(t*_pi),position=100,0)
(1000,-1000,position=100,0)
(1000,-1000,sin(t*_pi),position=100,0)
For the beginning, colorspace RGB24/32 should be supported, other colorspaces and VFR (http://en.wikipedia.org/wiki/Variable_frame_rate) follows.
Now i'm asking me how to render 2D + 3D to memory (directly) in a fast way. Currently i tend to D2D(+DWrite for complex scripting) & DX11, but that means no support for WinXP anymore.


I hope for constructive criticism and suggestions (and maybe contributors later). Thanks for your attention and time to read this.

Keiyakusha
5th December 2012, 15:00
Youka
Get in touch with aegisub devs. They have (had) drafts for new renderer (crossplatform) and newer sub format, but not enough motivation to work on this. Maybe you can lend them a hand. Creating something new on your own is a waste of your time. You don't want format that noone (except few unrelated guys) is going to support. Unless you one of the devs and requesting help here? But it doesn't looks like that to me, I believe there was more work already done that what you posted.

julius666
5th December 2012, 16:11
Youka
Get in touch with aegisub devs. They have (had) drafts for new renderer (crossplatform) and newer sub format, but not enough motivation to work on this. Maybe you can lend them a hand. Creating something new on your own is a waste of your time. You don't want format that noone (except few unrelated guys) is going to support. Unless you one of the devs and requesting help here? But it doesn't looks like that to me, I believe there was more work already done that what you posted.

This. The format's name is AS5, it's an improved version of ASS made by the Aegisub guys, though the project seems pretty much dead now.

And there's the new subtitle format for HTML5 video, WebVTT (Web Video Text Tracks) as well. http://dev.w3.org/html5/webvtt/

JEEB
5th December 2012, 21:23
This. The format's name is AS5, it's an improved version of ASS made by the Aegisub guys, though the project seems pretty much dead now.
AS5 was what was worked upon a few years ago, until people started implementing AS5 things within ASS... (vsfiltermod). After that happened, work on AS5 pretty much stopped because people had just moved towards making ASS even more of a mess than it used to be.

AS6 on the other hand is what nielsm/jfs was working on most lately, but unfortunately he has been rather busy lately. It is a new format, as opposed to being just a hack over ASS. There is a basic alpha-level Avisynth plugin renderer for AS6 (as6render) with a simple readme going over the basics of the format available on the internets for that, but it is (unsurprisingly for alpha level software) really unstable.

Youka
6th December 2012, 17:24
Youka
Get in touch with aegisub devs. They have (had) drafts for new renderer (crossplatform) and newer sub format, but not enough motivation to work on this. Maybe you can lend them a hand. Creating something new on your own is a waste of your time.
Doing such a difficult thing alone can't success, i know and would like to work on an improvement of subtitle creation with other developers, but how you commented it: there's no motivation from others and aegi devs aren't very communicative.
I want many changes like you maybe saw on my design and not AS6.

Youka
...I believe there was more work already done that what you posted.
To be true: i've already written all 3 plugin interfaces, parser and the base. My current step is rendering available data to given images, then i would have something to present.

There is a basic alpha-level Avisynth plugin renderer for AS6 (as6render) with a simple readme going over the basics of the format available on the internets for that, but it is (unsurprisingly for alpha level software) really unstable.
Not found until now. Have you a link?

JEEB
6th December 2012, 17:32
Not found until now. Have you a link?
This (http://www.animereactor.dk/aegisub/as6render-20120521_1000.rar) is the newest one I know of.

Keiyakusha
6th December 2012, 17:35
To be true: i've already written all 3 plugin interfaces, parser and the base. My current step is rendering available data to given images, then i would have something to present.
I see. But even if you'll succeed, you still need for example user-friendly subtitle editor, which is as much important as having renderer for a standard. In other words project need to be better in every way, otherwise everyone will still use ASS. Because to be honest, for most users it is good enough. But it looks like my posts sound too negative, if you feel you can do it - do it.

Not found until now. Have you a link?

I guess I have it, but I wonder if I should share it, there is nothing really useful, its a plugin and funny readme, but without source code, without specs...

^UPD: oops I'm too late on that

Youka
18th December 2013, 02:09
I didn't give up and already wrote a well working renderer. I'll test everything next days, then the beta would be ready.
Before, i would like to get some suggestions to the format (see attachment) for last improvements.
Example script (http://pastebin.com/eiDnax7n)
Example image (http://i.imgur.com/ZYuK0k6.jpg)

real.finder
18th December 2013, 17:43
It is better to make portable render to work on all systems from the beginning to avoid what happen in libass VS vsfilter compatibility mess

And taking all the problems of ass into consideration

with a good editor for translation to use all features easily

Otherwise, as Keiyakusha said, people will remain use ass

Youka
18th December 2013, 19:23
It is better to make portable render to work on all systems from the beginning to avoid what happen in libass VS vsfilter compatibility messThe renderer was developed to run on Windows and Unix from the beginning. Currently he works on Windows, after some further implementations (second release) Unix would be available too.
I'm not a friend of Mac, but the source code and libraries would allow it without much more work.

And taking all the problems of ass into considerationI know there're a lot, but could you list what all you mean?

with a good editor for translation to use all features easilyI'll try to make it usable with Aegisub, but for now i want to concentrate on the renderer. Maybe some developers are impressed enough to contribute.

real.finder
18th December 2013, 19:48
I know there're a lot, but could you list what all you mean?



I meant all about of ass from aegisub (http://forum.aegisub.org/viewforum.php?f=5&sid=51db1bbb7deee8a2ef0990664be83f58) and vsfilter VS libass (http://code.google.com/p/libass/issues/list) etc...

many things like: Support for right to left languages, support all kinds of fonts in script attachments, not only TTF as ass did, etc...

you should open a thread of the differences and advantages between the ass and what you want to reach with your format, then people will tell you the objections and what to add/change

------


it's good to support Linux since the beginning :)

I thought you will support vista and above only, because of:-

Currently i tend to D2D (+ DWrite for complex scripting) & DX11, but that means no support for WinXP anymore.

Youka
18th December 2013, 20:18
I thought you will support vista and above only, because of:-
Currently i tend to D2D (+ DWrite for complex scripting) & DX11, but that means no support for WinXP anymore. Dropped.
Now i'm using cairo (http://www.cairographics.org/) and the native font API. It's far better for 2D rendering in memory and has no dependency like a newer OS and graphics hardware.