]> git.sesse.net Git - ffmpeg/commit
libavfilter/vf_scale: Ensure scaled video is divisible by n
authorLars Kiesow <lkiesow@uos.de>
Mon, 12 Aug 2019 13:58:14 +0000 (15:58 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 13 Aug 2019 14:48:38 +0000 (16:48 +0200)
commit74d4bc0fa0e0f63b89ce020893c61e6703f3f282
tree81d69ae4982ccc3f6fea090655609dbc3764dcd7
parentdb78bc1297ebaa51cfe5c80775808ec11ed7512b
libavfilter/vf_scale: Ensure scaled video is divisible by n

This patch adds a new option to the scale filter which ensures that the
output resolution is divisible by the given integer when used together
with `force_original_aspect_ratio`. This works similar to using `-n` in
the `w` and `h` options.

This option respects the value set for `force_original_aspect_ratio`,
increasing or decreasing the resolution accordingly.

The use case for this is to set a fixed target resolution using `w` and
`h`, to use the `force_original_aspect_ratio` option to make sure that
the video always fits in the defined bounding box regardless of aspect
ratio, but to also make sure that the calculated output resolution is
divisible by n so in can be encoded with certain encoders/options if
that is required.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
doc/filters.texi
libavfilter/vf_scale.c