Revision 484a3308 doc/filters.texi

View differences:

doc/filters.texi
985 985
It accepts the following parameters:
986 986
@var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
987 987

  
988
The parameters @var{width}, @var{height}, @var{x}, and @var{y} are
989
expressions containing the following constants:
990

  
991
@table @option
992
@item E, PI, PHI
993
the corresponding mathematical approximated values for e
994
(euler number), pi (greek PI), phi (golden ratio)
995

  
996
@item in_w, in_h
997
the input video width and heigth
998

  
999
@item iw, ih
1000
same as @var{in_w} and @var{in_h}
1001

  
1002
@item out_w, out_h
1003
the output width and heigth, that is the size of the padded area as
1004
specified by the @var{width} and @var{height} expressions
1005

  
1006
@item ow, oh
1007
same as @var{out_w} and @var{out_h}
1008

  
1009
@item x, y
1010
x and y offsets as specified by the @var{x} and @var{y}
1011
expressions, or NAN if not yet specified
1012

  
1013
@item a
1014
input display aspect ratio, same as @var{iw} / @var{ih}
1015

  
1016
@item hsub, vsub
1017
horizontal and vertical chroma subsample values. For example for the
1018
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
1019
@end table
1020

  
988 1021
Follows the description of the accepted parameters.
989 1022

  
990 1023
@table @option
......
994 1027
value for @var{width} or @var{height} is 0, the corresponding input size
995 1028
is used for the output.
996 1029

  
1030
The @var{width} expression can reference the value set by the
1031
@var{height} expression, and viceversa.
1032

  
997 1033
The default value of @var{width} and @var{height} is 0.
998 1034

  
999 1035
@item x, y
......
1001 1037
Specify the offsets where to place the input image in the padded area
1002 1038
with respect to the top/left border of the output image.
1003 1039

  
1040
The @var{x} expression can reference the value set by the @var{y}
1041
expression, and viceversa.
1042

  
1004 1043
The default value of @var{x} and @var{y} is 0.
1005 1044

  
1006 1045
@item color
......
1012 1051

  
1013 1052
@end table
1014 1053

  
1015
For example:
1054
Some examples follow:
1016 1055

  
1017 1056
@example
1018 1057
# Add paddings with color "violet" to the input video. Output video
1019 1058
# size is 640x480, the top-left corner of the input video is placed at
1020 1059
# column 0, row 40.
1021 1060
pad=640:480:0:40:violet
1061

  
1062
# pad the input to get an output with dimensions increased bt 3/2,
1063
# and put the input video at the center of the padded area
1064
pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
1065

  
1066
# pad the input to get a squared output with size equal to the maximum
1067
# value between the input width and height, and put the input video at
1068
# the center of the padded area
1069
pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
1070

  
1071
# pad the input to get a final w/h ratio of 16:9
1072
pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
1073

  
1074
# double output size and put the input video in the bottom-right
1075
# corner of the output padded area
1076
pad="2*iw:2*ih:ow-iw:oh-ih"
1022 1077
@end example
1023 1078

  
1024 1079
@section pixdesctest

Also available in: Unified diff