View Full Version : SSA format
alexnoe
31st March 2003, 20:18
This is a line of an SSA fileDialogue: Marked=0,0:07:54.65,0:07:59.77,Style1,Comment,0000,0000,0000,,- Was ist mit ihrem Gedächtnis?\N- Da sind Lücken. Synaptische Störungen.
Where is the information about its location on the screen?
I'm gonna support SSA in AVI-Mux GUI, so I need to know something about this format...
int 21h
31st March 2003, 20:20
http://divxstation.com/article.asp?aId=27
Apparently it is in the beginning of the file?
timecop
1st April 2003, 13:32
documented quite well by the source code of either
* vobsub/textsub
* subtitler
* opensource lunix "ssa replacement" called bakasub
* in the .hlp file that comes with .ssa
* in the beginning of the file (somewhat)
the "position" on the screen is determined by smart thinking of whatever subtitler filter is being used. Trying to duplicate that functionality is not only inefficient waste of resources, but will probably look different when used by the real subtitle filter.
Position depends on font style, margins, possible overrides in the line, etc etc.
What exactly are you trying to "parse" in the .ssa? or just display the line as text? or..
alexnoe
1st April 2003, 13:38
"Support for AVI-Mux GUI" means that subtitle streams can be split / joined when splitting / joining AVI files.
For SRT files, the entire file is interpreted, and then rerendert to SRT format.
This is to be done for SSA without losing any information. But if there are no location information, then it doesn't matter...I just needed to know whether they exist or not. If they don't, it's fine with me
ChristianHJW
1st April 2003, 17:05
So you are planning to mux SSA into AVI ?
alexnoe
1st April 2003, 18:17
Yes. After SRT, this would be the next logical step (hoping that DVobSub is going to replay it)
Belgabor
1st April 2003, 22:45
One thing tc forgot to mention is that VobSub ships with two doc files about ssa/ass.
For avimuxgui you probably should remember two things:
- repeat the header part for every splitted file, joining can be tricky if headers differ.
- ssa is non-linear, which means having later timecodes first in a file is ok by the specs (well, at least all filters I know allow it)
alexnoe
1st April 2003, 23:07
ssa is non-linear, which means having later timecodes first in a file is ok by the specs (well, at least all filters I know allow it)My current implementation of SRT support would handle it correctly, but would not repair its order.
I'll make it the same way for SSA
repeat the header part for every splitted fileOf course. This is done for SRT as well (even a SRT chunk has headers, namely GAB2 xxxx ....).
Subtitles work about this way in AVI-Mux GUI:
SUBTITLE::Open(STREAM* source);
SUBTITLE::Merge(SUBTITLE* lpsub,QUADWORD qwBias);
SUBTITLE::SetRange(QUADWORD qwBegin,QUADWORD qwEnd);
SUBTITLE::SetBias(QUADWORD qwBias);
SUBTITLE::RenderToAVIChunk(void* lpDest);
Open processes subtitle headers and sets up a bunch of internal structures to handle the subtitles, including a list of descriptors which contain all attributes for each subtitle, Merge just merges 2 such structures, SetRange selects a range in time which shall be processed when calling RenderToAVIChunk, which will create the complete chunk, incl. GAB2 headers etc.
So after writing an AVI file, just before initiating the closing process and writing indices and headers, the subtitles are added by a few simple calls, provided by a not so simple class...
I don't see much difference between merging / splitting SRT or SSA subtitles, except for the style thing with SSA.
timecop
3rd April 2003, 05:31
Its perfectly valid to have multiple lines with same timings in the ssa file that only differ by position...
Probably don't want to split them in half...
bill_baroud
3rd April 2003, 14:52
Where is the information about its location on the screen?
dunno if someone responded or if you find the information yourself, but the position of a SSA event is defined by the three "0000,0000,0000".
Which are MarginLeft, MarginRight and MarginVertical(?)
i don't really know the scaling used (perhaps 1/1000 of resolution, or x pixels from side s).
it might depend of the playback filter.
if you plan to look at Advanced SSA (from vobsub), subtitle's position can be set with the tag : {\pos(x, y)}
(those tags are interpreted by vobsub even if filetype is SSA)
bill_baroud
10th April 2003, 22:50
i don't know, i never tried.
I suppose Sub Station Alpha will read them, because it's the way the specs should have been set, but there is differences (i think) between SSA and the other apps (like Vobsub and Vdub Filter) not written by Kotus.
If I understand vobsub code well, it won't work if you change the order because it's hardcoded.
vdub filter i don't know, Avery's code is very dark for me ^^;;
...after a new reading it's look like its hardcoded too
(but i've _never_ used 'goto' after an 'if' in C (!!), so i can misunderstand)
alexnoe
10th April 2003, 22:52
OK, you've answered 5 mins after I've deleted my post....i decided to support out-of-order attributes and re-order them if necessary, so there was no point in leaving the question here.
That means, AVI-Mux GUI will read the attributes in whatever order they are supplied, and will bring them into the order which is created by SubRip when using SSA output.
Parsing of SSA files already works (meaning that I retrieve a list of styles and a list of all events).
Now I only have to add re-rendering of SSA, and joining (the style value of each entry has to be changed if the SSA file to join uses different styles than the first file, so joining is a bit tricky)
alexnoe
11th April 2003, 09:55
I think it's done (http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/Pre-release/)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.