News:

--

Main Menu

Filter SSA

Started by IPl, January 30, 2013, 06:47:04 PM

Previous topic - Next topic

Nik

Jan, not yet :)
I usually use a simple sub file as watermark or edit the text with notepad ... lol

I have to check this later :)

Jan Gruuthuse

#16
tested by me, and found to be functional:
QuoteAnamorphic video

OR: How to get your subtitles to not look stretched

The following paragraphs assumes that you have a working knowledge of what anamorphic video is and how aspect ratios work. If you feel unsure, you may want to consult a gentle but fairly complete introduction.

Image stretching and subtitle rendering

An anamorphic image needs to be stretched to the proper aspect ratio before it is presented to the viewer. On a computer, this is usually done by the video renderer, and thereby lies a problem. Most subtitle renderers (including VSFilter, the current "standard" renderer) do the subtitle drawing on the image before it is stretched, and since the renderer is not aware of any aspect ratio issues, the subtitles will be stretched along with the image when the video is displayed to the viewer, and therefore they will look stretched. Aegisub does its subtitle rendering this way as well (since that way it will be WYSIWYG with most players); you can test how it looks by using the "Override aspect ratio" in the video menu.

Compensating for the stretching

Fortunately it's easy to compensate for the stretching, since you know by how much the image will be stretched (since you know its original dimensions and the display aspect ratio). You just calculate how many percent the image will be stretched in either the X or the Y direction, and then set the ScaleX or ScaleY parameter in the style (or use the \fscx or \fscy overrides) to the same amount but in the other direction.

Example: we have a 704x480 image that we know will be displayed as 16:9 (or 1.7777...:1). If we assume that the player will stretch the width but leave the height untouched, this means that the new width will be: (16 / 9) * 480 = 853.333... which in percent is: 853.333... / 704 = 1.212121... i.e. 121%. Hence, to compensate for this horizontal (X-direction) stretch we set ScaleY in all our styles to 121% to stretch the subtitles by the same amount, and after rendering they now no longer look stretched.

OR we can do the stretching in the other direction, assuming that the player changes the height of the image instead. Assuming the same image: 704 / (16 / 9) = 396 which corresponds to: 396 / 480 = 0.825 or 82.5%, which means we can compensate for the vertical (Y) compression by setting ScaleX to 82.5%.

source: From installed aegisub 3.0 documentation

with ScaleX you can achieve the wanted result with the calculation from example and change the value for ScaleX in the ssa file:
QuoteFormat: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,45,&H00FFFFFF,&H000000FF,&H00000000,&H02000000,0,0,0,0,100,100,0,0,3,0,0,2,20,20,15,1
Style: Default,Arial,45,&H00FFFFFF,&H000000FF,&H00000000,&H02000000,0,0,0,0,121,100,0,0,3,0,0,2,20,20,15,1
keep in mind: while testing I switched the ScaleX and ScaleY: the 121% should have been in ScaleY and not in ScaleX
attached screenshots and ssa sample file are from/for 720p video.

Nik

woah, many thanks, Jan!!
very helpful :)

Jan Gruuthuse

Think if time is there and no other urgent priorities (like current windows development) perhaps mean or another developer can do something in avidemux ssa filter to adjust these values with some kind of control in preview (gui).