[FFmpeg-devel] [PATCH 4/4] Make the crop filter accept parametric expressions.

Stefano Sabatini stefano.sabatini-lala
Thu Sep 9 12:06:16 CEST 2010


On date Thursday 2010-09-09 01:11:42 +0200, Stefano Sabatini encoded:
> On date Wednesday 2010-09-08 15:56:27 +0200, Michael Niedermayer encoded:
> > On Thu, Jul 22, 2010 at 07:52:35PM +0200, Stefano Sabatini wrote:
> [...]
> > > diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
> > > index 6a7ae70..df9b5a2 100644
> > > --- a/libavfilter/vf_crop.c
> > > +++ b/libavfilter/vf_crop.c
> > > @@ -24,7 +24,31 @@
> > >   */
> > >  
> > >  #include "avfilter.h"
> > > +#include "libavutil/eval.h"
> > >  #include "libavutil/pixdesc.h"
> > > +#include "libavutil/avstring.h"
> > > +
> > > +static const char *var_names[] = {
> > > +    "E",
> > > +    "PHI",
> > > +    "PI",
> > > +    "x",
> > > +    "y",
> > > +    "w",      ///< width  of the input video
> > > +    "h",      ///< height of the input video
> > 
> > t for timestamp in seconds
> > f for frame number
> 
> This will be only possible for x and y, as w and h cannot (yet) be
> dynamically changed.

Another idea would be to implement a separate cropeval filter in the
same file partly sharing the crop code, and perform x/y evaluation and
validity checks in start_frame() (this to avoid to slow down the crop
filter, which currently does just one evaluation during the
configuration stage).

In the same way we could also add a cropfile filter which takes the
crop values to be applied from a file, that would be useful for a
2-steps process (e.g. pattern detection in the first step -> file, and
cropfile used to apply the detected crop values).

Regards.
-- 
FFmpeg = Fascinating and Fanciful Mournful Powered Emblematic Gymnast



More information about the ffmpeg-devel mailing list