[MPlayer-dev-eng] [libass] Ignore PlayResX/Y aspect ratio for font aspect ratio.

Karl Blomster kalle at agigen.se
Wed Aug 19 08:52:24 CEST 2009


Nicolas George wrote:
> Hi.
> 
> I recently noticed that a lot of my subtitles for anamorphic encodings of
> DVB recordings, which used to look fine, now look horizontally stretched.
> 
> I bissected the revisions and tracked back the change to this commit:
> 
> # r28814 | greg | 2009-03-05 21:05:56 +0100 (Thu, 05 Mar 2009) | 1 line
> # 
> # Ignore PlayResX/Y aspect ratio for font aspect ratio.
> 
> What is the reason of this change? I may be mistaken, but it seems deeply
> wrong to mm.
> 
> For example, the width of the font is not the same with vo=xv and vo=gl,
> because xv renders the subtitles at the resolution of the video (anamorphic,
> PAR=64/45) while gl renders the subtitles at the screen resolution (PAR=1).
> IMHO, this should not be.

Brace yourself, because this is rather messy.

There is no real ASS spec and has never been; instead the format is defined by 
how VSFilter (the de facto standard renderer) handles things. In this case 
VSFilter does the same thing as Ye Olde SSA did: font sizes etc are scaled based 
on PlayResY. PlayResX is only used for determining the coordinate system used 
for absolute positioning, margins, vector drawings etc. Also, the "PlayRes" does 
NOT determine the aspect ratio of the rendered text, just like in old SSA.

Now, it could certainly be argued that this is an oversight in the 
spec/implementation that should be fixed (in fact, I do agree that it should be) 
but the problem is that if you change this behavior (there is actually a patched 
version of VSFilter that can optionally change it) you will break a large amount 
of existing scripts that assume that fonts are always rendered at an 1:1 aspect 
ratio, before anamorphic stretching occurs (like VSFilter does) and therefore do 
their own anamorphic stretching with ScaleX/ScaleY in the styling. For example 
there is a lot of anamorphic 16:9 scripts with ScaleX set to ~80% to compensate 
for the fact that the text will be stretched ~121% horizontally on playback.

What you should really do to be "compliant" is ensure that all renderers draw 
text at 1:1, and do it before stretching. Yeah. ASS is really messy. :/

Regards,
Karl Blomster



More information about the MPlayer-dev-eng mailing list