vapoursynth / subtext

Subtitle plugin for VapourSynth based on libass
MIT License
16 stars 5 forks source link

Missing ass_set_storage_size call #16

Open TheOneric opened 1 month ago

TheOneric commented 1 month ago

Hi, it seems subtext currently isn't calling ass_set_storage_size which can lead to incorrect rendering for some subtitle+video combinations unless the rather recently introduced LayoutRes* headers are set. The storage size needs to be the resolution at which the encoded video is stored, i.e. before anamorphic desqueezing.

If a preceeding filter rescaled or unsqueezed the image, this may be different from the properties of the frame subtext receives, but at least AviSynth(+) and third-party VapourSynth assrender plugins (AS(+), VS) seem to think using the current frame size is a good enough default (but they also added input parameters to override it).

Affected demo files (both anamorphic and non-anamorphic) with correct reference output can be found e.g. here: https://code.videolan.org/videolan/vlc/uploads/b54e0761d0d3f4f79b2947ffb83a3b59/vlc-issue_libass-storage-size.tar.xz

See also: https://github.com/libass/libass/issues/591 and current storage size docs

myrsloik commented 1 month ago

Fixed and verified, will be in the next release

myrsloik commented 1 month ago

Forgot to add arguments to override it