[FFmpeg-devel] [PATCH] vf_crop: add support for dar, sar, hsub, and vsub variables

Stefano Sabatini stefano.sabatini-lala at poste.it
Wed Aug 3 13:14:22 CEST 2011


On date Wednesday 2011-08-03 09:45:33 +0200, Michael Niedermayer encoded:
> On Tue, Jul 05, 2011 at 06:34:39PM +0200, Stefano Sabatini wrote:
[...]
> > > @@ -162,6 +170,11 @@ static int config_input(AVFilterLink *link)
> > >      crop->var_values[VAR_PI]    = M_PI;
> > >      crop->var_values[VAR_IN_W]  = crop->var_values[VAR_IW] = ctx->inputs[0]->w;
> > >      crop->var_values[VAR_IN_H]  = crop->var_values[VAR_IH] = ctx->inputs[0]->h;
> > 
> > > +    crop->var_values[VAR_DAR]   = crop->var_values[VAR_A]  = (float) link->w / link->h;
> > 
> > And I realized this is not right, DAR is SAR * W/H.
> > So what do you think it is better:
> > 
> > 1) change the meaning of the "a" var in scale/pad to match the
> > implementation (a = inw/inh)
> > 
> > 2) or change its meaning to match the documentation (a = dar)
> > ?
> 
> Iam fine wth either but it should be consistent between filters

I choose 1), which avoids breaking scripts, and I already pushed the
needed changes.
-- 
FFmpeg = Fancy and Frightening Merciless Portentous Elitarian Gargoyle


More information about the ffmpeg-devel mailing list