How do I change the perspective of a video with AviSynth? Say, I want to create thumbnails on a "3D" surface?
There was a thread on this at Doom9 forums, but they only allow posting after being registered for five days, and I'm a bit impatient for that just now.
The suggestion there was to use "ffdshow's perspective correction via it's raw-filter-processing as input for AviSynth". However I haven't a clue as to how this is practically done.
That aside, I've seen several transition plugins to AviSynth that twist and tweak the picture in all possible ways, and the perspective change would be using only a tiny bit of that code. It's hard to believe it isn't out there already, but for the life of me I can't find it.
+ Reply to Thread
Results 1 to 8 of 8
-
-
Does the trick. For reference:
avisource("testing.avi")
ffdshow(options="perspectiveY2=16,perspectiveX3=6,
perspectiveY3=89,perspectiveX4=87,perspectiveY4=74 ,
perspectiveInterpolation=1,perspectiveIsSrc=0,show Perspective=1,
halfPerspective=0,isPerspective=1,orderPerspective =12,fullPerspective=1,
perspectiveX1=6,perspectiveY1=15,perspectiveX2=87" )
Tweak the options as necessary. I need to go over them and document them for myself to make some sense of them, I don't want to tweak them in the ffdshow interface, I need to tweak pixels up and down with exact precision. More on that soon.
With regards to the black spots, it seems they only appear with certain settings. Let's hope they get this spot issue fixed soon. -
OK, here are the settings. The perspectiveX and perspectiveY values are given as percentages of the frame width and height respectively.
The following are the settings for the coordinates of the four corners of the film:
# perspectiveX1 = horizontal top left (def. 0)
# perspectiveY1 = vertical top left (def. 0)
# perspectiveX2 = horizontal top right (def. 100)
# perspectiveY2 = vertical top right (def. 0)
# perspectiveX3 = horizontal bottom left (def. 0)
# perspectiveY3 = vertical bottom left (def. 100)
# perspectiveX4 = horizontal bottom right (def. 100)
# perspectiveY4 = vertical bottom right (def. 100)
The following control various other settings:
# perspectiveInterpolation - Sets the interpolation method: 0: None / 1: Linear / 2: Cubic (def. 0)
# perspectiveIsSrc - "Source Rectangle" (on/off - 1/0)
# showPerspective= Haven't a clue (def. 1)
# halfPerspective = "Only right side" (on/off - 1/0)
# isPerspective = Filter on or off (on/off - 1/0)
# orderPerspective = Haven't a clue (def. 12)
# fullPerspective = Process whole image (on/off - 1/0)
And yes, you can also have the coordinates in a sane order although ffdshow exports the first three as the last when you save the presets:
Code:ffdshow(options="perspectiveX1=10,perspectiveY1=30, perspectiveX2=100,perspectiveY2=0,perspectiveX3=0, perspectiveY3=100,perspectiveX4=100,perspectiveY4=100, perspectiveInterpolation=2,perspectiveIsSrc=0,showPerspective=1, halfPerspective=1,isPerspective=1,orderPerspective=12,fullPerspective=0")
Similar Threads
-
avisynth
By sportflyer in forum Newbie / General discussionsReplies: 1Last Post: 16th Feb 2010, 04:36 -
Using avisynth
By bsuska in forum Video ConversionReplies: 8Last Post: 16th Jul 2009, 08:32 -
Different perspective?!
By B-Twien Bytes in forum Newbie / General discussionsReplies: 3Last Post: 9th Jan 2009, 04:30 -
AVIsynth help!
By helper in forum Newbie / General discussionsReplies: 11Last Post: 15th Oct 2008, 03:35 -
Avisynth 3.0
By nbi in forum LinuxReplies: 1Last Post: 30th Oct 2007, 16:50