Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
13th August 2015, 03:12 | #1 | Link | ||
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
How to replicate in Avisynth: multiple movies at once using "Lighter Color blending"
Hi again,
I found another project on youtube that just blew me away and would love to know how to replicate it in avisynth. It's real messy to watch, but it just tickles my inner nerd. Watching with ChromaDepth 3D glasses is a real brain twister. The link: I selected the comment where the uploader responded to someone asking him how he did it. The question and his response should be top of the list of comments. Star Wars Wars: All 6 Films At Once (720p HD) https://www.youtube.com/watch?v=HTHT...yeoymu5pjsxc0k The (Imgur) Gallery: https://imgur.com/a/8gS2O?gallery The Response: " Thanks for the question! Pretty good guess +Curtis Dominguez. It's actually pretty simple. It is accomplished using the Lighter Color blending mode (also known as Max or Lighter depending on your composting software). It mathematically selects the brightest pixel of all layers of video. This is why a brighter landscape, like Hoth, will totally dominate the frame, and lightsabers and blasters will always show up. I added my own level of contrast to each layer equally to make increase the falloff into darkness of each video (increasing overlay potential), and keeping it from just looking all grey/muddy. I'm working on a how to video but not quite finished. " So it seems he used a NLE like Adobe Premiere or other. But I want to do this via Avisynth. I would love to do this to a nice boxset one of these decades. Maybe the theatrical Alien Quadrilogy. Maybe Pirates of the Caribbean trilogy. The Plea: Help me, Obi-Wan Doom9'ers. You're my only hope. EDIT: The solutions: Quote:
Quote:
Code:
Function maxY (clip1, clip2) { Dif = mt_makediff (mt_logic (clip1.converttoy8 (), clip2.converttoy8 (), "max"), clip1.converttoy8 ()) Mask = mt_lut (Dif, "x 128 == 0 255 ?").Blur (1) mt_merge (clip1, clip2, Mask, luma=true, U=3, V=3) }
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Last edited by Sparktank; 20th July 2016 at 02:49. |
||
13th August 2015, 05:23 | #3 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
Interesting!
Buffy season 2 (didn't do detelecine/deinterlace). Code:
SetMemoryMax(512) LoadPlugin("C:\AVS\dgdecnv2049\DGDecodeNV.dll") clip1 = DGSource("E:\MakeMKV\BUFFY_SEASON2_DISC3\09- What's My Line - Part 1.dgi").AssumeFPS(29.97) clip2 = DGSource("E:\MakeMKV\BUFFY_SEASON2_DISC3\10- What's My Line - Part 2.dgi").AssumeFPS(29.97) clip3 = DGSource("E:\MakeMKV\BUFFY_SEASON2_DISC3\11- Ted.dgi") max = mt_logic (clip1,clip2, "max").mt_logic (clip3, "max") return max Except clip1 is the only one with colors. Clip 1: http://i.imgur.com/AMKm41Y.png Clip 2: http://i.imgur.com/06bJkdZ.png Clip 3: http://i.imgur.com/nLyX4JZ.png
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
13th August 2015, 05:41 | #4 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
chroma stuff should get guided by luma
Function maxY (clip1, clip2) { Y = mt_logic (clip1.converttoy8 (), clip2.converttoy8 (), "max") Dif = mt_makediff (Y, clip1.converttoy8 ()) Mask = mt_lut (Dif, "x 128 == 0 255 ?") U = mt_merge (clip1.utoy8 (), clip2.utoy8 (), Mask) V = mt_merge (clip1.vtoy8 (), clip2.vtoy8 (), Mask) YtoUV (U, V, Y) } clip1=clip1.ConvertToYV24 () clip2=clip2.ConvertToYV24 () clip3=clip3.ConvertToYV24 () ... clipn=clipn.ConvertToYV24 () max = maxY (clip1, clip2).maxY (clip3)...maxY (clipn) return max |
13th August 2015, 05:57 | #5 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
and here we go!
Code:
clip1=clip1.converttoyv24 () clip2=clip2.converttoyv24 () Function maxY (clip1, clip2) { Y = mt_logic (clip1.converttoy8 (), clip2.converttoy8 (), "max") Dif = mt_makediff (Y, clip1.converttoy8 ()) Mask = mt_lut (Dif, "x 128 == 0 255 ?") U = mt_merge (clip1.utoy8 (), clip2.utoy8 (), Mask) V = mt_merge (clip1.vtoy8 (), clip2.vtoy8 (), Mask) YtoUV (U, V, Y) } maxY (clip1,clip2) dunno if it's the kinda stuff u want tho |
13th August 2015, 06:03 | #6 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
EDIT: using post #4 (i do things slowly)
i LOVE this! 13446 03175 57603 Thanks a lot! One caveat is to expect clips 1&2 to take precedence over proceeding clips in the event that clips 1&2 end sooner than any other clips? Some creepy stuff to do to: Code:
fill_clip = blankclip(3,720,480,"YV12",fps=29.97).killaudio() clip1 = DGSource("E:\MakeMKV\BUFFY_SEASON2_DISC3\09- What's My Line - Part 1.dgi").AssumeFPS(29.97) clip2 = fill_clip+clip1
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Last edited by Sparktank; 13th August 2015 at 06:11. |
13th August 2015, 06:21 | #9 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
Thanks a bunch! This is perfect!
In the event that clips are shorter than others, I'll just add a blank clip to the end so they all match same runtime. The results will be much better with HD sources (or properly handled SD sources). This will provide endless hours of fun.
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
13th August 2015, 06:47 | #10 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Code:
Function maxY (clip1, clip2) { Dif = mt_makediff (mt_logic (clip1.converttoy8 (), clip2.converttoy8 (), "max"), clip1.converttoy8 ()) Mask = mt_lut (Dif, "x 128 == 0 255 ?").Blur (1) Y = mt_merge (clip1.converttoy8 (), clip2.converttoy8 (), Mask) U = mt_merge (clip1.utoy8 (), clip2.utoy8 (), Mask) V = mt_merge (clip1.vtoy8 (), clip2.vtoy8 (), Mask) YtoUV (U, V, Y) } |
13th August 2015, 07:10 | #11 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
soft blend (post #10):
Used an HD source for clarity. Frame #164560 Code:
SetMemoryMax(512) LoadPlugin("C:\AVS\dgdecnv2049\DGDecodeNV.dll") fill_clip = blankclip(3,1280, 534,"YV24",fps=23.976).killaudio() clip1 = DGSource("F:\MakeMKV\V For Vendetta.dgi", crop_t=140, crop_b=148, crop_l=0, crop_r=0).AssumeFPS(23.976) clip1 = clip1.ConvertToYV24(matrix="Rec709").Spline36Resize(1280, 534) clip2 = fill_clip+clip1 Function maxY (clip1, clip2) { Dif = mt_makediff (mt_logic (clip1.converttoy8 (), clip2.converttoy8 (), "max"), clip1.converttoy8 ()) Mask = mt_lut (Dif, "x 128 == 0 255 ?").Blur (1) Y = mt_merge (clip1.converttoy8 (), clip2.converttoy8 (), Mask) U = mt_merge (clip1.utoy8 (), clip2.utoy8 (), Mask) V = mt_merge (clip1.vtoy8 (), clip2.vtoy8 (), Mask) YtoUV (U, V, Y) } max = maxY (clip1, clip2) return max Would make a really fun addition to 'fan made trailers'. That shot where the camera tilts up to V, it's perfect for this weird effect! Trim it down, weird it out, add it main project. Thanks again for this!
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
13th August 2015, 07:22 | #12 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
Here's very short sample of that shot/scene.
Resized to 500xHeight (for browser/gif), lossless then uploaded to gycat. (interesting they support UtVideo codec for conversion) Original clip: HTML5 video: http://gfycat.com/PoshUnacceptableDogwoodtwigborer GIF: http://zippy.gfycat.com/PoshUnaccept...dtwigborer.gif Edited clip (with "ripple effect" / delay_3frames): HTML5 video: http://gfycat.com/EmptyUncommonBustard GIF: http://zippy.gfycat.com/EmptyUncommonBustard.gif
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Last edited by Sparktank; 13th August 2015 at 07:47. |
13th August 2015, 16:08 | #15 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
There are only 3 Star Wars films.
Anyway, back on topic, SparkTank, can I suggest that you try, after overlaying all the movies, overlaying the results over itself, but flipped horizontally? And then also flipped vertically, if you like. The result can be pretty trippy. |
14th August 2015, 00:26 | #17 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
I should do this to the animated How the Grinch Stole Christmas!
(There is only one of those!) Since we're still in GD, I find with current releases, fan projects aside (of which there a millions of builds), there are Zero Star Wars. Until Disney decides to create a DeSpecialized OT release, I only have the boxset because it was 60% off during the Christmas sales. Though, PT has its visual qualities. This whole thing can really help with new animated avatars (where supported). And I think it's time to give my tumblr a nice revamp. Tumblr people love this kind of stuff. Just add pretty hues for a border, throw in some glittery text and Twilight will live again.
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
14th August 2015, 08:17 | #18 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
Code:
mt_merge (clip1, clip2, Mask, luma=true, U=3, V=3) |
|
14th August 2015, 11:04 | #19 | Link |
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
Neat to see how things can work differently. One day I just may learn something lol.
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
Tags |
avisynth, expirement, project, research |
Thread Tools | Search this Thread |
Display Modes | |
|
|