[FFmpeg-devel] [FFmpeg-user] How to create trapezoid videos with ffmpeg?

Michael Niedermayer michaelni at gmx.at
Sat Oct 18 01:23:50 CEST 2014

On Fri, Oct 17, 2014 at 02:09:49PM -0700, Nicholas Robbins wrote:
> > On Friday, October 17, 2014 2:30 PM, Nicholas Robbins <nickrobbins at yahoo.com> wrote:
> >
> <snip actual request>
> >
> > Ok, it seems like this should be easier. If we had a filter that did the same 
> > thing as vf_perspective but with inverse options this would be easy. So instead 
> > telling it what points you want to send to the corners, you tell it where you 
> > want the corners sent. 
> > 
> > I ran the math and the formulas to map between the two different ways of 
> > specifying the projective transformation are a bit messy. For instance, if you 
> > want to send the corners to  x0:y0:x1:y1:x2:y2:x3:y3 the first option for the 
> > vf_perspective should be 
> > 
> <snip messy formula>
> >
> > not something you can put on the command line or even want to work out by hand. 
> > However, it would be totally doable to calculate in filter initialization. 
> > 
> > So is it possible to make a filter that is basically just a wrapper around 
> > another filter? This hypothetical filter (call it vf_keystone) would just call 
> > vf_perspective with crazy options. Clearly I could just copy the vf_perspective 
> > filter and then insert these changes, but than any future changes to 
> > vf_perspective wouldn't filter down to vf_keystone.
> > 
> > Is this possible?
> >
> > -Nick
> Upon further thought and a closer read of the vf_perspective code, I think an easier option would be to insert an option of "sense" or "mode" or something. Then condition the code at lines 144-160 (these lines calculate the matrix used for the transformation) and then put in another block conditioned on the "mode" that finds the inverse matrix rather than the matrix currently found.
> Is this a reasonable approach? If so, I think I'll put this in in a little while.

yes, thats an option too

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141018/23398821/attachment.asc>

More information about the ffmpeg-devel mailing list