[FFmpeg-devel] [RFC] Affine video transformation filter

Nicolas George nicolas.george at normalesup.org
Thu Jul 5 17:46:12 CEST 2012

Le septidi 17 messidor, an CCXX, Michael Bradshaw a écrit :
> However, I'm not sure how to best handle the overlapping functionality
> of affine transformations and existing filters. We already have
> transpose, scale, v/hflip (and maybe others?) video filters, which

IMHO, redundancy is not a problem provided the reason for it are good and
well understood by everyone. In this particular case, I think it is
perfectly fine: everyone should be able to realize that a hflip filter is
simpler to use and faster than a generic affine filter, but can only be used
for horizontal flipping.

> What are your thoughts on the overlapping functionality? Should some
> note along the lines of "if you are applying only a single
> affine/linear transformation with an existing corresponding filter,
> consider using that one filter, as it is likely optimized in its speed
> and quality for that transformation" be put in the docs or something?

Helpful documentation is always good.

> Should overlapping functionality be removed (i.e. disable scaling)
> from the affine transformation filter?

How would you do that, anyway?

> While I've got your attention, what seems like a sane way to pass
> arguments to an affine transformation filter? I'm thinking something
> along the lines of
> "affine=scale=1.1\,1.3:rotate=15:translate=4\,10:shear=1.2\,2:reflect=-1\,0:sampling=bilinear"
> for example where order matters and options can be repeated (and maybe
> allowing "affine=matrix=x11:x12:x13:x21:x22:x23:x31:x32:x33").

That looks nice.

>								 I
> haven't thought of a way to specify the background fill color that I
> like, though.

That is a problem for all filters that may leave part of the video blank:
pad (has a color option), tile (arbitrary black), etc. A global solution
would be welcome.

As a side note, I wonder how much a good anti-aliasing algorithm is
important for an affine transform. I have the notion that adding a ×2 or so
factor to the affine transform and then downscaling with a good and highly
optimized downscaler would give almost as good and fasts results with much
less code.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120705/d5c2280d/attachment.asc>

More information about the ffmpeg-devel mailing list