Revision d496d33d doc/filters.texi

View differences:

doc/filters.texi
1004 1004

  
1005 1005
Scale the input video to @var{width}:@var{height} and/or convert the image format.
1006 1006

  
1007
For example the command:
1007
The parameters @var{width} and @var{height} are expressions containing
1008
the following constants:
1008 1009

  
1009
@example
1010
./ffmpeg -i in.avi -vf "scale=200:100" out.avi
1011
@end example
1010
@table @option
1011
@item E, PI, PHI
1012
the corresponding mathematical approximated values for e
1013
(euler number), pi (greek PI), phi (golden ratio)
1014

  
1015
@item in_w, in_h
1016
the input width and heigth
1017

  
1018
@item iw, ih
1019
same as @var{in_w} and @var{in_h}
1012 1020

  
1013
will scale the input video to a size of 200x100.
1021
@item out_w, out_h
1022
the output (cropped) width and heigth
1023

  
1024
@item ow, oh
1025
same as @var{out_w} and @var{out_h}
1026

  
1027
@item a
1028
input display aspect ratio, same as @var{iw} / @var{ih}
1029

  
1030
@item hsub, vsub
1031
horizontal and vertical chroma subsample values. For example for the
1032
pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
1033
@end table
1014 1034

  
1015 1035
If the input image format is different from the format requested by
1016 1036
the next filter, the scale filter will convert the input to the
......
1025 1045

  
1026 1046
The default value of @var{width} and @var{height} is 0.
1027 1047

  
1048
Some examples follow:
1049
@example
1050
# scale the input video to a size of 200x100.
1051
scale=200:100
1052

  
1053
# scale the input to 2x
1054
scale=2*iw:2*ih
1055
# the above is the same as
1056
scale=2*in_w:2*in_h
1057

  
1058
# scale the input to half size
1059
scale=iw/2:ih/2
1060

  
1061
# increase the width, and set the height to the same size
1062
scale=3/2*iw:ow
1063

  
1064
# seek for Greek harmony
1065
scale=iw:1/PHI*iw
1066
scale=ih*PHI:ih
1067

  
1068
# increase the height, and set the width to 3/2 of the height
1069
scale=3/2*oh:3/5*ih
1070

  
1071
# increase the size, but make the size a multiple of the chroma
1072
scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
1073

  
1074
# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
1075
scale='min(500\, iw*3/2):-1'
1076
@end example
1077

  
1028 1078
@anchor{setdar}
1029 1079
@section setdar
1030 1080

  

Also available in: Unified diff