vf_vapoursynth: add display resolution support

Add two new script environment variables 'video_in_dw' and
'video_in_dh', representing the display resolution of video. Along
with video resolution, sample ratio aspect can be calculated in
scripts.

Currently it's impossible to change sample ratio aspect with single
vapoursynth filter since '_SARNum' and '_SARDen' frame properties
from output clip will be ignored. A following 'dsize' filter is
necessary for this purpose.
This commit is contained in:
Bin Jin 2014-08-22 02:26:46 +02:00 committed by wm4
parent e2d27cded7
commit 96c2021cb1
1 changed files with 5 additions and 0 deletions

View File

@ -478,6 +478,9 @@ static int reinit_vs(struct vf_instance *vf)
if (p->vsapi->propSetNode(vars, "video_in", p->in_node, 0))
goto error;
p->vsapi->propSetInt(vars, "video_in_dw", p->fmt_in.d_w, 0);
p->vsapi->propSetInt(vars, "video_in_dh", p->fmt_in.d_h, 0);
vsscript_setVariable(p->se, vars);
if (vsscript_evaluateFile(&p->se, p->cfg_file, 0)) {
@ -519,6 +522,8 @@ static int config(struct vf_instance *vf, int width, int height,
.imgfmt = fmt,
.w = width,
.h = height,
.d_w = d_width,
.d_h = d_height,
};
if (reinit_vs(vf) < 0)