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

Kevin Mark kmark937 at gmail.com
Tue Jun 6 23:40:20 EEST 2017


Hey Moritz,

Thanks for the feedback.

On Tue, Jun 6, 2017 at 7:59 AM, Moritz Barsnick <barsnick at gmx.net> wrote:
> 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. ;-))

Haha, you're right. The best approach seems to be involve removing the
paragraph about the -1 stuff (since it's technically -n) and expand
the -n paragraph to include -1. So something like:

If the width value is 0, the input width is used for the output. If the
height value is 0, the input height is used for the output.

If one and only one of the values is -n with n >= 1, the scale filter
will 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.

If both values are -n with n >= 1, the behavior will be identical to
both values being set to 0 as previously detailed.

-

I noticed the z-scale documentation is very similar. I might need to
look at that too.

Thanks,
Kevin


More information about the ffmpeg-devel mailing list