[FFmpeg-devel] [PATCH] doc/filters: Correct scale doc regarding w/h <= 0

Moritz Barsnick barsnick at gmx.net
Tue Jun 6 14:59:46 EEST 2017


On Tue, Jun 06, 2017 at 03:27:06 -0400, Kevin Mark wrote:
> According to libavfilter/scale.c, if the width and height are both
> less than or equal to 0 then the input size is used for both
> dimensions. It does not need to be -1. -1:-1 is the same as 0:0 which
> is the same as -10:-42, etc.

This makes it obvious that the paragraph following the one you fixed is
a bit misleading (to me):

    If one of the values is -n with n > 1, the scale filter will also
    use a value that maintains the aspect ratio of the input image,
    calculated from the other specified dimension. After that it will,
    however, make sure that the calculated dimension is divisible by n
    and adjust the value if necessary.

This is true only if *exactly* one of the two values is "-n with n > 1".
(It also doesn't apply to "-1:-2". Good luck finding words to describe
this behavior. ;-))

Just nitpicking,
Moritz


More information about the ffmpeg-devel mailing list