Log in

View Full Version : How shift video with avisynth?


ipnt
17th December 2003, 16:46
Is there a way how to shift clip in avisynth script? Something what Siwalters VDUB filter ShiftWrap http://www.geocities.com/siwalters_uk/shiftwrap.html do? Thanks

Wilbert
17th December 2003, 17:08
Just crop it off and add it (or a black clip) to the other side with stackhorizontal / stackvertical.

Si
18th December 2003, 10:12
What do you use it for and more importantly - what colourspace do you want to work in? - I could port it to Avisynth as long as you could put up with some restrictions in YUY2.

regards
Simon

ipnt
18th December 2003, 17:40
RGB24 is enough for my needs. I want to create a synthetic clips from my "test patterns" bitmaps for testing smoothness of video playback. I created some clips with your vdub filter, but avisynth is more usefull for this.
PS: Watching my test clips, I find visible artefacts with some combinations of players+codecs and I want to test this more accurate.
Can be filter more configurable? It will be nice to have parameter for starting offset = shiftwrap start after first "variable" frames and for shiftwrap every "variable" frames? Thanks

stickboy
18th December 2003, 18:12
Originally posted by ipnt
RGB24 is enough for my needs.In that case, you can use the VirtualDub filter in AviSynth. You can download the VirtualDub Filters Import script (http://www.neuron2.net/hosted.html) from Donald Graft's site.
Can be filter more configurable? It will be nice to have parameter for starting offset = shiftwrap start after first "variable" frames and for shiftwrap every "variable" frames?You can use Animate (http://www.avisynth.org/index.php?page=Animate).

Si
18th December 2003, 23:34
Although stickboy is right, I know its a bit of a pain to use the import facility - so I'll have a go tomorrow at porting it to RGB.

regards
Simon

Si
20th December 2003, 04:17
Sorry - there'll be a delay beacause my system is refusing to work in RGB colourspace again :(
regards
Simon

bobsobol
25th December 2005, 18:55
Hi I've just been hunting all over for a YV12 version of this (YUY2 would do) because it really slows down processing doing conditionals in VDub and I only want to shift every other frame up 1 pixel (to smooth interlace jitter afer progressive conversion). The Crop and AddBorders method needs to be Even numbers, 2 pixels is as bad as 0 pixels but the other way around. Unless I work in RGB... and I think then I may as well use VDub I don't know.

I may be being silly, maybe I need to use RGB because YV12 only works in 2x2 blocks or so, but if it could be done with any more effeciency than converting to RGB and back, it would be appreciated. In fact, for my case just shifting the Luma by one and leaving the chroma where it is may do. It's only one pixel against plane that isn't 1 pixel accurate anyway.

TIA. bobsobol

scharfis_brain
25th December 2005, 20:03
there is absolutely no need for an additional video shifter.
AVISynth's internal resizrs already can do that for you!

example:

xxxsource("blah.xxx")
x=3.4
y=2.7
last.bilinearresize(last.width,last.height,x,y,last.width,last.height)

where x and y define the amount of the shift. Even float numbered shifts are possible like in the example shown!
There are no restricions in colorspace.
Of course shifting amounts that do not fit the pixel grid (1 for RGB or 2 for YV12) will introduce some amount of blurring.

Mug Funky
26th December 2005, 03:13
@ scharfi: i can see a need for one that wraps to the other side of the screen... i tried this using animate, resizers and stackhorizontal, and it only lasted 89 frames or so...