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

Kevin Mark kmark937 at gmail.com
Tue Jun 6 10:27:06 EEST 2017


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.

if (w < 0 && h < 0)
    eval_w = eval_h = 0;

Signed-off-by: Kevin Mark <kmark937 at gmail.com>
---
 doc/filters.texi | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 65eef89d07..b9d6eafc74 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -12125,12 +12125,13 @@ the complete list of scaler options.
 Set the output video dimension expression. Default value is the input
 dimension.
 
-If the value is 0, the input width is used for the output.
+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 of the values is -1, the scale filter will use a value that
 maintains the aspect ratio of the input image, calculated from the
-other specified dimension. If both of them are -1, the input size is
-used
+other specified dimension. If both of them are negative, the behavior
+will be identical to both values being set to 0 as explained above.
 
 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
-- 
2.13.0



More information about the ffmpeg-devel mailing list