View Full Version : Dynamic shift of lines
ajp_anton
10th July 2022, 23:15
I'm trying to shift the lines of one video according to a mask (1-pixel wide, full height), but I can't seem to find any way to do this.
Going overkill, xyremap can shift any pixel anywhere, but it can't use information from another clip.
I almost got my hopes up when I found out that Expr has pixel addressing! But it turns out it only supports static coordinates, so no "x[y,0]" (where y is scaled to the width of x). Why is that? And is there another way to do this?
Reel.Deel
11th July 2022, 01:13
Maybe I'm missing something, but couldn't you shift a clip by adding borders and then overlaying that over the original clip using the mask you want?
poisondeathray
11th July 2022, 01:14
"Shift" in what way ? x,y translation only, or some other type of transform?
Maybe a displacement map approach ?
e.g
https://ffmpeg.org/ffmpeg-filters.html#displace
ajp_anton
11th July 2022, 20:08
Maybe I'm missing something, but couldn't you shift a clip by adding borders and then overlaying that over the original clip using the mask you want?
That would just blend two different shifts together, with no intermediate shift.
"Shift" in what way ? x,y translation only, or some other type of transform?
Maybe a displacement map approach ?
e.g
https://ffmpeg.org/ffmpeg-filters.html#displace
My current need is to have a unique horizontal translation for each line. A displacement map sounds like a generalization of what I need, and would be perfect. I failed to find anything for Avisynth though.
Frank62
12th July 2022, 11:48
Your mask is one pixel wide and full height. In which ways shall the line be shifted, when the mask (corresponding line/pixel) is 0, and when the mask is 255?
ajp_anton
12th July 2022, 23:54
Your mask is one pixel wide and full height. In which ways shall the line be shifted, when the mask (corresponding line/pixel) is 0, and when the mask is 255?
The shift will be linear, with the maximum amplitude being some value depending on how strong of an effect I want. So 0 would be no shift and 255 anything from 1 pixel to say 50. (Negative shifts can be ignored, as I could just pre-shift everything to the maximum negative shift position.)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.