FFmpeg 0.9.4
Since* 0.7
#

Scale the input video to width:height[:interl={1|-1}] and/or convert the image format.

The parameters width and height are expressions containing the following constants:

in_w, in_h

the input width and height

iw, ih

same as in_w and in_h

out_w, out_h

the output (cropped) width and height

ow, oh

same as out_w and out_h

a

same as iw / ih

sar

input sample aspect ratio

dar

input display aspect ratio, it is the same as (iw / ih) * sar

sar

input sample aspect ratio

hsub, vsub

horizontal and vertical chroma subsample values. For example for the pixel format "yuv422p" hsub is 2 and vsub is 1.

If the input image format is different from the format requested by the next filter, the scale filter will convert the input to the requested format.

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

If the value for width or height is -1, the scale filter will use, for the respective output size, a value that maintains the aspect ratio of the input image.

The default value of width and height is 0.

Valid values for the optional parameter interl are:

1

force interlaced aware scaling

-1

select interlaced aware scaling depending on whether the source frames are flagged as interlaced or not

Some examples follow:

# 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'