AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > General Anime > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2007-01-09, 20:48   Link #1
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 37
VSFilter bugfixed

Be sure to look near the end of the thread! New versions have been released since this!


For those who aren't reading the Aegisub forums (I bet most in here aren't), I'll also post my fixed version of VSFilter here. This version should fix all known rendering bugs, and also adds two additional override tags.

Download URL: http://www.animereactor.dk/aegisub/v...38-clipfix.rar
(Includes patch files for guliverkli svn rev 611. They should be applied in the src/subtitles/ dir.)

The new override tags are \fax and \fay. They perform a shearing operation. Giving them parameter 0 is the same as no change.
For those mathematically inclined, transforms the text by this matrix, in a text-local coordinate system. Shearing happens before rotation.
Code:
 1  fax
fay  1
This is especially useful for typesetting signs whose parallax lines are too far away to make an \frx and \fry with \org practical.

What this does not fix:
I can't remember if the crash on excessive rectangular clips is also present in this svn revision, but if it is, it isn't fixed.
Also, the "100% CPU usage thread spawned when using in Avisynth without absolut path to subs file" bug isn't fixed either.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's

Last edited by jfs; 2008-07-24 at 09:31. Reason: Notice about newer versions being available
jfs is offline   Reply With Quote
Old 2007-01-09, 20:56   Link #2
ArchMageZeratuL
Aegisub dev
*IT Support
 
 
Join Date: Dec 2004
Location: Florianópolis, Brazil, Pale Blue Dot
Age: 36
Perhaps it should also be pointed out that the SVN versions of VSFilter (and, by consequence, this build) also support ASS2 (v4.00++), which is a very minor improvement over ASS (namely, it separates vertical border in top and bottom and adds a "relativeto" field for styles).
ArchMageZeratuL is offline   Reply With Quote
Old 2007-01-09, 21:06   Link #3
Nicholi
King of Hosers
 
Join Date: Dec 2005
Age: 38
/me votes post to sourceforge guliverkli patches area (as though anyone pays attention there) and doom9 as well.
Nicholi is offline   Reply With Quote
Old 2007-01-12, 19:55   Link #4
edogawaconan
Hi
*Fansubber
 
 
Join Date: Aug 2006
Send a message via MSN to edogawaconan Send a message via Yahoo to edogawaconan
Quote:
Originally Posted by jfs
"100% CPU usage thread spawned when using in Avisynth without absolut path to subs file"
Thanks for pointing this out O_o
__________________
edogawaconan is offline   Reply With Quote
Old 2008-07-22, 17:54   Link #5
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 37
Posting this here because I don't expect everyone to read the Aegisub forums or IRC channel.


I made some more bugfixes to VSFilter and even added 4 new tags and extended an old one

http://www.animereactor.dk/aegisub/v...isub-r2279.rar

It's newer than any version shipped with Aegisub currently, but I expect that the next build of Aegisub we put out will have this version of VSFilter with it.

The two bugfixes added in this version are:
  • Non-zero fill alpha + \bord smaller than 1.5 + \be1 bug
  • Border colour showing through during \fad and \fade
This should account for all known rendering bugs!

The new tags are \xbord \ybord \xshad \yshad, and the \be tag was extended, see the readme file for details.



Code:
VSFilter with Aegisub patches
=============================

This is a distribution of VSFilter with patches by the Aegisub team.

Not all of the patches applied are developed by the Aegisub team, but are
instead collected from various sources on the internet. We don't have
credit, sorry.

The patches include both bugfixes as well as new features, they are all
described below.


Vector clip bug
---------------

When an SSE2 code path was added to the rasterisation code by Gabest, he
unfortunately also introduced a regression in the rendering of lines with
vector \clip() masks. The regression caused the alpha mask of the actual
line to be effectively "thresholded" such that there weren't semi-
transparent pixels, only either on or off.

This has been fixed by going back to an earlier method of rasterising,
which uses two different "pixmix" functions, one for lines with clipping
mask and one for lines without, and adding an SSE2 code path for the one
that didn't have it.


Font name crash
---------------

Some malformed font names could make VSFilter crash, due to a buffer
overflow. This has been fixed by using the "secure" versions of the C
string functions, introduced by Microsoft in Visual C++ 8, instead.

This patch is obtained from the Doom9 forum.


Text shearing tags, \fax \fay
-----------------------------

Two new tags have been introduced to allow "shearing" operations on text,
the \fax and \fay tags. The default value for both are 0.

The parameter to them is a factor used for building a transofmation matrix.

For example, \fax1 means X = X + Y * 1

Similar, \fay-2 means Y = Y + X * -2


Common Subtitle Renderer Interface (CSRI)
-----------------------------------------

In addition to the regular DirectShow, VirtualDub and Avisynth interfaces,
a CSRI interface has been added to VSFilter. This allows Aegisub and other
applications to easily render in-memory subtitles to an arbitrary bitmap
surface. Aegisub uses this for subtitle and style previews.

The presense of CSRI does not affect the function of any of the other
interfaces.


Floating-point positioning
--------------------------

This patch allows using floating-point numbers in the \pos and \move tags
to get sub-pixel positioning without increasing PlayResX and PlayResY to
values higher than the actual video resolution.

For example: \pos(20.4,9.73)


Require [Script Info] line
--------------------------

We have patched VSFilter to only accept SSA and ASS files that include
the [Script Info] section header. A file not including that is considered
too broken to even consider rendering from.

VSFilter is traditionally very forgiving in what it accepts, but scripts
as malformed as this caused problems in Aegisub so we considered it would
be better to reject them at every level.


Avoid "moving \pos"
-------------------

Because the \pos tag is internally treated the same as \move it caused
some problems in rare cases, where the interpolation between times actually
caused a small jitter in the position of text placed with \pos.

The \move handling code has been patched such that text that isn't supposed
to move won't be moved either.


Non-zero fill alpha + \bord smaller than 1.5 + \be1 bug
-------------------------------------------------------

This bug caused "stray dots" to display when the fill alpha (\1a and \2a)
of a line is non-zero, the border is thinner than 1.5 pixels and "blur
edges" is enabled.

The bug was caused by an integer underflow during subtraction.

The fix is checking the integers before subtracting, to make sure the
result would be at most zero. If it would underflow, zero is used instead.


Border colour showing through during \fad and \fade
---------------------------------------------------

When using the \fad or \fade tags on lines with a non-zero border and
where both \1a and \2a are zero, the border colour would show through
in the fill colour during the fade, causing the fade to effectively be
incorrect, and look ugly.

This was caused by a strange/incorrect assumption in the border rendering
code, causing it to render not only border but also fill when \1a and \2a
were zero.

This does not affect the shadow showing through during fades. That is a
very different problem which is not readily fixable.


Different X and Y border size with \xbord and \ybord
----------------------------------------------------

The new tags \xbord and \ybord have been introduced, they allow
controlling the border size in X and Y direction separately. This can
for example be used to do aspect ratio correction, or just for visual
effect.

The \bord tag is still valid, using it sets both X and Y border at the
same time, ie. it overrides both \xbord and \ybord.

Examples:
    {\xbord10\ybord0}Only border in X direction
    {\xbord0\ybord10}Only border in Y direction
    {\xbord3\ybord0\t(\ybord10)}The Y border grows here


Different shadow offset in X and Y direction with \xshad and \yshad
-------------------------------------------------------------------

The new tags \xshad and \yshad allows setting the shadow offset in X
and Y direction separately. They also allow setting negative shadow
offsets in the two directions.

Setting negative shadow offsets is still not supported with the \shad
tag or in Style lines, for compatibility reasons.

Examples:
    {\xshad3\yshad1.5}This line has the shadow more to the right than down
    {\xshad-5\yshad0}A shadow of this line is 5 pixels to the left
    {\xshad-3\yshad3\t(\xshad3)}The shadow moves from left to right here


Variable strength blur with \be
-------------------------------

The \be tag has been extended to allow variable strength blur, and to
allow the blur effect to be animated with \t.

The parameter to \be now specifies how many passes of blur to perform
on the subtitles, a bigger number means a bigger blur.

Examples:
    {\shad0\bord5\be10}This one has a blurry border
    {\shad0\bord5\t(\be15)}The border here grows more blurry over time
(This file is also included in the archive.)
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's

Last edited by jfs; 2008-07-22 at 18:49. Reason: Quick update that adds variable \be effect
jfs is offline   Reply With Quote
Old 2008-07-22, 19:14   Link #6
martino
makes no files now
 
 
Join Date: May 2006
Very nice news, and thanks for the hard work.

Just a question, what about the fade to grey bug? Or does that fall under "Border colour showing through during \fad and \fade"?

Also, is there somewhere a documentation or spec for ASS2?
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2008-07-22, 19:35   Link #7
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 37
The "fade to grey" but is exactly the one you mentioned. The border colour is usually black or dark, so when it shows through a white subtitle, it displays as grey :P

I don't think there's any actual docs for ASS2 written...
Well Aegisub doesn't support the extra style fields anyway (We do have top and bottom margin separated internally though.)

I remember one new tag added: \kt
It's a karaoke tag, which resets the syllable start time to a new value, relative to the start of the line.
Example: {\k10}foo {\kt20\k10}bar {\kt10\k10}baz
Then the words are highlighted in order foo, baz, bar. I think you can also have overlapping times in this manner.
You can of course enter this manually, but Aegisub doesn't have any GUI to support it, and the Auto4 karaskel doesn't parse it either.

Both Dialogue and Style lines have added two new fields and removed one. Specifically, the MarginVertical field has been replaced with MarginTop and MarginBottom. Their use should be obvious.

The Style lines have also added one field, "relative to", at the end. It determines whether the subtitles with this style are positioned relative to the video frame or the rendering area, when the video frame and rendering area don't have the same aspect ratio. (Ie. when there are borders around the video frame inside the rendering area, such as with the MPC built in subtitle renderer.)
I can't remember which values mean what in this field, but I think it's 0, 1 and 2 that are valid.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2008-07-22, 20:34   Link #8
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 34
Send a message via AIM to Starks
I hope the CCCP team jumps on this for their betas.

(But then again, I'm an SMPlayer fan now...)
__________________
Starks is offline   Reply With Quote
Old 2008-07-22, 21:01   Link #9
Kovensky
Timer
*Fansubber
 
 
Join Date: Jul 2008
Location: Brazil
Age: 31
Whoa! A new convert

I wonder when this will be ported to libass. I'll mail Evgeniy next time I open my mail.
__________________

MPlayer FTW! Get my win32 build here; now with multithreading
/me is usually idling on #mplayer@chat.freenode.net or #cccp@irc.rizon.net
\SHAMEIMARU/
Kovensky is offline   Reply With Quote
Old 2008-07-23, 01:27   Link #10
pichu
Senior Member
*Fansubber
 
Join Date: Jul 2004
Quote:
Originally Posted by jfs View Post
The "fade to grey" but is exactly the one you mentioned. The border colour is usually black or dark, so when it shows through a white subtitle, it displays as grey :P
Yes I just call it "fade with tinting" (I remembered writing a bug-report somewhere about this issue)... Basically, when the second alpha channel (\2a) is set to exactly 0 (\2a&H00&), the fading caused by \fad or \fade will be tinted with the border colors (i.e., if the border is blue, the fade will be mixed [or, tinted] with some blue). Hence, one workaround would have been \2a&H01& on everything.

\xbord and \ybord don't seem to have any significant importance in signs or hardsubs though... Even in signs, I've hardly seen [or rather, have not seen] any signs with unequal weighted borders. The only situation I can think up of is when you're styling on an anamorphic video. Normal \bord will cause the style to have a thinner vertical border than horizontal border; this is good if and only if this is in the style... Another possibility, perhaps, is to simulate a vertical blur (i.e. bad interlaced). It's probably meant better for karaoke.

The \be*, on the other hand, seems somewhat interesting for glows and miscellaneous drop shadows. I've seen many occurrences of where this can be used.
pichu is offline   Reply With Quote
Old 2008-07-23, 01:45   Link #11
edogawaconan
Hi
*Fansubber
 
 
Join Date: Aug 2006
Send a message via MSN to edogawaconan Send a message via Yahoo to edogawaconan
apparently when \xbord set to 0, \ybord is automatically set to 0 too (there's no border at all). I don't see this happening when \ybord set to 0 and \xbord set to any positive value.
bug?

(and now I think I know why I feel weird when seeing subtitle with anamorphic video...)
__________________
edogawaconan is offline   Reply With Quote
Old 2008-07-23, 02:14   Link #12
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 37
Oh darn, I thought I had fixed that problem with xbord=0 causing nothing to be drawn... well I'll look into it when I get back from work. Otherwise a workaround is to use an extremely small X border, like 0.063 which I found was the smallest that worked, in my own tests :P (Maybe it's really 0.0625, 1/16, getting rounded up to 0.125, 1/8, since VSFilter works in 1/8 pixel coordinates internally.)
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2008-07-23, 06:32   Link #13
dj_tjerk
Ana-chan~
 
 
Join Date: May 2006
Location: Netherlands
Maybe a little offtopic, but I personally prefer MPC's Internal Subtitle renderer (blahblah, nice and sharp, subs rendered at desktop resolution), but that one doesnt care if the video is anamorphic or not; vsfilter does. So when people make/edit scripts for anamorphic releases, they change the ScaleResY to 480, and the font size in y-direction to 121% (in the case of dvd -> 16:9 AR).

That however, screws up with mpc's internal renderer, causing the subs to be smaller in x-direction; very ugly and not very easily readable. I personally believe that it's VSFilter's fault for not taking into account that the video is anamorphic, but since VSFilter is the standard, is there any way to haxx mpc's internal renderer to do the same as VSFilter when it comes to anamorphic video's?
dj_tjerk is offline   Reply With Quote
Old 2008-07-23, 10:40   Link #14
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 37
I don't have an environment to build MPC in myself, and I don't dare trying to set up one :P

Of course that problem should be fixable/work-aroundable, but I'm not entirely sure if the MPC passes all the information (about anamorphism etc) to the subs rendering. It would probably be easier to fix VSFilter to take it into account, for example by simply doing proper font scaling by the PlayResX and PlayResY values, instead of only using the video:script ratio in the Y direction as the scaling ratio for both X and Y for font sizes. (Everything else is properly scaled in both directions, just not font sizes. Well, not borders either.)
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2008-07-23, 10:44   Link #15
Kovensky
Timer
*Fansubber
 
 
Join Date: Jul 2008
Location: Brazil
Age: 31
I guess you would be making VSFilter scale like libass. That would break some Menclave's scripts, but they're wrong anyway for exchanging the PlayRes{X,Y} values.
__________________

MPlayer FTW! Get my win32 build here; now with multithreading
/me is usually idling on #mplayer@chat.freenode.net or #cccp@irc.rizon.net
\SHAMEIMARU/
Kovensky is offline   Reply With Quote
Old 2008-07-23, 10:50   Link #16
pichu
Senior Member
*Fansubber
 
Join Date: Jul 2004
Quote:
Originally Posted by Kovensky View Post
That would break some Menclave's scripts, but they're broken anyway.
lol... blame them not me - I DID correct the resolutions since Toshokan ep1 since I knew that problem will occur in players like mplayer; vsfilter is unaffected. (but I don't touch the scripts in the series I'm not assigned to work in heh)... And I remembered I complained before other series that were out... but I was ignored ;_; *sniffs*
pichu is offline   Reply With Quote
Old 2008-07-23, 10:53   Link #17
Kovensky
Timer
*Fansubber
 
 
Join Date: Jul 2008
Location: Brazil
Age: 31
Macross F and Code Geass are broken, I have to use some -ass-force-style overrides to get it to work. And scale down a bit the subs.

And VSFilter was unnafected because VSFilter was wrong, not otherwise... Too bad other players have to emulate VSFilter bugs, but that is going too far ><

And I really like your work with Gundam 00!
The only problem I had with that was due to a minor libass bug that was fixed right away. It picked the wrong subtitle color and thus the subs were always blue.
__________________

MPlayer FTW! Get my win32 build here; now with multithreading
/me is usually idling on #mplayer@chat.freenode.net or #cccp@irc.rizon.net
\SHAMEIMARU/
Kovensky is offline   Reply With Quote
Old 2008-07-23, 11:06   Link #18
pichu
Senior Member
*Fansubber
 
Join Date: Jul 2004
Quote:
Originally Posted by Kovensky View Post
Macross F and Code Geass are broken, I have to use some -ass-force-style overrides to get it to work. And scale down a bit the subs.

And VSFilter was unnafected because VSFilter was wrong, not otherwise... Too bad other players have to emulate VSFilter bugs, but that is going too far ><

And I really like your work with Gundam 00!
The only problem I had with that was due to a minor libass bug that was fixed right away. It picked the wrong subtitle color and thus the subs were always blue.
Untrue... When I checked the g00 scripts later on (after a few episodes were released), I found out that for some unknown reasons, the same style name was duplicated/repeated in the .ass style with different colors, and it appears that vsfilter picks the latter one whilst mplayer picks the first appearance (or whatever it is - they contradicted each other). Of course, I fixed the issue later on. I'm not sure if it's completely fixed.

Well, I don't really work for MacrossF (only a few karaoke), CG2, and g00 (miscellaneous signs). So for the most part, I wasn't involved. ;p

Last edited by pichu; 2008-07-23 at 11:29. Reason: Fixed the subs order - I'm bad at memory xD
pichu is offline   Reply With Quote
Old 2008-07-23, 11:18   Link #19
Kovensky
Timer
*Fansubber
 
 
Join Date: Jul 2008
Location: Brazil
Age: 31
Well, libass picks the first one too since I reported it on mplayer-users.

And I tought duplicate style name were meant to be used in the order they appear for each time the subtitle is displaced... lol

I watched the whole G00 season a few weeks ago and it was flawless.
__________________

MPlayer FTW! Get my win32 build here; now with multithreading
/me is usually idling on #mplayer@chat.freenode.net or #cccp@irc.rizon.net
\SHAMEIMARU/
Kovensky is offline   Reply With Quote
Old 2008-07-23, 14:19   Link #20
dragon5152
Junior Member
*Fansubber
 
Join Date: Aug 2007
Send a message via AIM to dragon5152 Send a message via MSN to dragon5152 Send a message via Yahoo to dragon5152
Did you fix the issue with x264 causing an 'avisynth: unknown exception'?

I think it's caused because of x264's threading but is a bug on vsfilter's side.
dragon5152 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
We use Silk.