Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > VirtualDub Filters and Filter Development > Moving Crop


Posted by: xcdb Dec 20 2011, 06:58 PM
Hi,
anybody knows how crop video, where the cropping area is the same size in time, but their position is changing in time?

e.g.
I have big frames sorted to timelapse video(3800x2500), and I wish to crop the video to 1920x1080. but for 1st frame I will set cropping 0px before the picture, and for last frame I will set cropping 1880px before picture (in X axis). So, the final croped area move on the source video..

Sure, I can use some comercial video editor, but I not prefer this way..

any idea? maybe is there some filter for this effect..

thanx
rosi

Posted by: IanB Dec 20 2011, 09:29 PM
Using http://www.avisynth.org/ you could use the http://avisynth.org/mediawiki/Animate filter.
CODE
....source

ConvertToYV24() # Format that can crop by 1 pixel.

Fc=Framecount()

Animate(0, Fc, "Crop",  0,1920,0,1080,  1880,1920,0,1080)

ConverttoYV12()

As Crop() cannot crop more finely than the chroma subsampling, you will need to first convert to a format that does not subsample the chroma, like RGB or YV24 (in 2.6 only).

And as Crop() only support integer crop values you will get unit stepping of the crop value depending how FrameCount relates to your 1880 value. If this is a problem you may use a resizer as a subpixel shifter.

To simplify parameter handling we will use a user function with Animate, i.e. :-
CODE
....source

Fc=Framecount()

Animate(0, Fc, "MoveIt", 0.0, 1880.0)

Function MoveIt(C Clip, M Float) {
 Return C.Spline16Resize(1920, 1080, M, 1920, 0, 1080)
}


Posted by: xcdb Dec 21 2011, 09:33 PM
thank you for your answer.
I try integer crop, then maybe comes other questions from me :-)

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)