aboutsummaryrefslogtreecommitdiffstats
path: root/doc/filters.texi
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-03-27 22:58:08 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-26 07:29:29 +0200
commit68e23c083a5d907748481e962ee38abbcb167174 (patch)
tree14965807ae57a14f7120c876a63c8ac8085d6956 /doc/filters.texi
parentb137bf7df35b3cc792d8cd645a47c4f1d8f1d58f (diff)
downloadffmpeg-68e23c083a5d907748481e962ee38abbcb167174.tar.gz
scale: make the filter parametric
Make the filter accept parametric expressions for the output video size. Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'doc/filters.texi')
-rw-r--r--doc/filters.texi60
1 files changed, 55 insertions, 5 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 1a26f10c59..669a334eca 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -772,13 +772,33 @@ can be used to test the monowhite pixel format descriptor definition.
Scale the input video to @var{width}:@var{height} and/or convert the image format.
-For example the command:
+The parameters @var{width} and @var{height} are expressions containing
+the following constants:
-@example
-./ffmpeg -i in.avi -vf "scale=200:100" out.avi
-@end example
+@table @option
+@item E, PI, PHI
+the corresponding mathematical approximated values for e
+(euler number), pi (greek PI), phi (golden ratio)
+
+@item in_w, in_h
+the input width and heigth
+
+@item iw, ih
+same as @var{in_w} and @var{in_h}
+
+@item out_w, out_h
+the output (cropped) width and heigth
+
+@item ow, oh
+same as @var{out_w} and @var{out_h}
-will scale the input video to a size of 200x100.
+@item a
+input display aspect ratio, same as @var{iw} / @var{ih}
+
+@item hsub, vsub
+horizontal and vertical chroma subsample values. For example for the
+pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
+@end table
If the input image format is different from the format requested by
the next filter, the scale filter will convert the input to the
@@ -793,6 +813,36 @@ ratio of the input image.
The default value of @var{width} and @var{height} is 0.
+Some examples follow:
+@example
+# scale the input video to a size of 200x100.
+scale=200:100
+
+# scale the input to 2x
+scale=2*iw:2*ih
+# the above is the same as
+scale=2*in_w:2*in_h
+
+# scale the input to half size
+scale=iw/2:ih/2
+
+# increase the width, and set the height to the same size
+scale=3/2*iw:ow
+
+# seek for Greek harmony
+scale=iw:1/PHI*iw
+scale=ih*PHI:ih
+
+# increase the height, and set the width to 3/2 of the height
+scale=3/2*oh:3/5*ih
+
+# increase the size, but make the size a multiple of the chroma
+scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
+
+# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
+scale='min(500\, iw*3/2):-1'
+@end example
+
@anchor{setdar}
@section setdar