[MPlayer-dev-eng] Re: [PATCH] SSA/ASS subtitles support

Evgeniy Stepanov eugeni.stepanov at gmail.com
Sun Jun 4 14:54:22 CEST 2006


On Sunday 04 June 2006 14:55, Uoti Urpala wrote:
> Now it renders the bitmaps using sh_video->pts as the time _after_ vo
> flip has already been called for the image with that pts, so it's wrong
> even if there are no special filters. But as I mentioned above
> sh_video->pts is currently somewhat wrong anyway, unless you use the
> -correct-pts option in the patch I posted earlier.

The timecodes in the filter are supposed to be correct, at least the most 
close to correct I can get in mplayer ? A good reason to move rendering back 
to the filter. So, it (filter) will render subtitles and then either blend 
the resulting bitmaps, or pass them to the vo, depending on VFCAP.

> +.B \-ass-top-margin <value>
> +Adds a black band at the top of the frame. SSA/ASS renderer will place 
toptitles there
> 
> +.B \-ass-bottom-margin <value>
> +Adds a black band at the bottom of the frame. SSA/ASS renderer will place 
subtitles there.
> 
> Any reason to have these separately from the existing "-vf expand"
> functionality? How do they interact with it?

Renderer needs to know the exact placement of original image inside the frame. 
Expand filter does not share such information. This breaks subtitle 
positioning.

ass-*-margin adds a black band to the frame (impemented in vf_ass) and passes 
its height to the renderer. Maybe it would be better to store vf_expand args 
in some global variables and use them instead. The same probably needs to be 
done with vf_crop.

Generally, there is no way to automatically determine correct image placement 
withing the frame. Usually, vf_expand is used to add black bands, and 
vf_crop - to remove then. Looks like the best guess is to use frame 
dimensions after crop, but before expand for subtitle positioning.



More information about the MPlayer-dev-eng mailing list