[FFmpeg-devel] [Patch] Scale filter should use multiples of 2

Daniel G. Taylor dan
Wed Jul 7 21:53:16 CEST 2010

On 07/01/2010 10:27 AM, Stefano Sabatini wrote:
>> Basically, I don't know how I can do this easily, and writing a
>> bunch of code doing it a stupid way seems like a waste of time, so
>> any advice would be appreciated if we do want to go this way.
> libavutil/eval.h, check how it is done in the libavfilter-soc overlay
> and setpts filters. This requires to add eval evalutation to the scale
> filter, check the recent patch by Baptiste on which I commented
> yesterday.

Thanks for the help here Stefano.

I've run into a bit of a snag I'd say... See attached patch to reproduce 
what I'm running into, but basically:

  * av_parse_expr and such use a comma as a delimiter for function
  * avfilter's graph parsing uses a comma as a delimiter for filters

Because of that it means anytime you put a comma into the filter 
arguments it thinks you are passing in the next filter. If we are going 
to allow functions and such as filter arguments it might be a good idea 
to change the syntax for specifying filters, maybe using a pipe 
character like "|" or something, e.g. -vf "scale|unsharp|...|crop".

Attached patch works for stuff like -vf "scale=320:240" or -vf 
"scale=W/2:H/2" and such but if you try -vf "scale=W:round(H, 16)" 
you'll immediately see the issue.


Take care,
Daniel G. Taylor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scale_eval.diff
Type: text/x-diff
Size: 3438 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100707/de545f77/attachment.diff>

More information about the ffmpeg-devel mailing list