Log in

View Full Version : Combining multiple inputs a pixel at a time


krick
23rd August 2015, 17:13
Instead of blending pixels, is there a way to select a specific pixel from each source following a pattern?

The idea is that each movie actually gets 1/6th of the total pixels per frame.

My initial thought was to select an entire row of pixels from each movie like this. Kind of like a weird interlacing...

line 1 = episode 1
line 2 = episode 2
line 3 = episode 3
line 4 = episode 4
line 5 = episode 5
line 6 = episode 6
line 7 = episode 1
etc...

But then I thought you could do the same thing on each line and follow a pattern like this...

123456123456...
234561234561...
345612345612...
456123456123...
561234561234...
612345612345...
etc...

...or this...

123456123456...
456123456123...
etc...

...or this...

123456123456...
654321654321...
etc...

colours
25th August 2015, 06:03
You could use mt_lutspa to create masks for each clip (e.g. mt_lutspa(mode="absolute",expr="x 3 % 0 = x 2 % 0 = & 255 0 ?")) and blend them together.

Alternatively, you could also use Interleave(clip1,clip2,clip3,clip4,clip5,clip6).WeaveColumns(3).WeaveRows(2), which is a lot more concise but also less flexible.

The real question is: why would you even want to do this?

krick
26th August 2015, 06:01
I originally posted in another thread, but an admin moved it...
http://forum.doom9.org/showthread.php?t=172475

Basically, someone blended all 6 Star Wars movies together so they play simultaneously...

https://www.youtube.com/watch?v=HTHTEKwaYdI

However, I think the result looks really bad and I was wondering if instead of blending there was a way to combine all 6 movies so that each one gets 1/6th of the pixels and what that might look like.

creaothceann
26th August 2015, 16:39
I was wondering if instead of blending there was a way to combine all 6 movies so that each one gets 1/6th of the pixels and what that might look like.

Sure.

v1 = DSS2("ep01.mp4").BilinearResize(640, 540)
v2 = DSS2("ep02.mp4").BilinearResize(640, 540)
v3 = DSS2("ep03.mp4").BilinearResize(640, 540)
v4 = DSS2("ep04.mp4").BilinearResize(640, 540)
v5 = DSS2("ep05.mp4").BilinearResize(640, 540)
v6 = DSS2("ep06.mp4").BilinearResize(640, 540)

StackVertical(
\ StackHorizontal(v1, v2, v3),
\ StackHorizontal(v4, v5, v6)
\)

wonkey_monkey
26th August 2015, 17:47
There was me thinking my new, unfinished plugin could do this, when creaothceann's post inspired me to realise that one of my old plugins can do it.

You will need: xyremap (http://horman.net/avisynth/downloads/xyremap0.4beta.zip)


# all clips should be the same width and height
stackhorizontal(clip1, clip2, clip3, clip4, clip5, clip 6)
converttorgb32

xyremap(x="x y 2 * + 6 % floor w * x +", w=clip1.width, draft=true, static=true)

# draft=true because it's pixel-to-pixel remapping with no interpolation required
# static=true because the remapping doesn't change over time


Try changing the "2" between "y" and "*" to shift the interleaving.

Bear in mind that converting back to YV12 will lose a lot of colour information (that in itself might look quite interesting, though), and it won't compress well at all.

Edit: it also doesn't actually look that interesting, once you see it. I like this though:

xyremap(x="x n 4 * + 6 w / * floor 6 % w * x +", w=clip1.width, draft=true) # "4" is the speed of the vertical bands