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. |
29th October 2008, 21:23 | #1 | Link |
Registered User
Join Date: Jan 2008
Posts: 5
|
Using overlay() on trimmed clips
I feel like i've worked myself into a corner, and i need help getting this script to add an overlay. I've trimmed out sections to do different processing to save time and since the opening is a regular movie and the rest is anime, i'd like to keep it this way if possible. All that i have tried seems to fail, and the only way i've been able to get the overlay added is by commenting out everything except the clip1/clip2 variables. I'm trying to add the overlay to trimmed section 'a'. Here's what i have to work with.
Code:
clip1 = DGDecode_mpeg2source("E:\Projects\DesertPunk\v1.d2v", info=3) clip2 = avisource("E:\Downloads\DesertPunkOP.avi") Overlay(clip1, clip2, mode="blend", opacity=0.5) a = trim(clip1,45,2742) b = trim(clip1,2743,43499) c = a.ColorMatrix(hints=true).ConvertToYV12().tfm(order=1).tdecimate(hybrid=1).Crop(4,4,-2,-4).Spline64Resize(640,480).Convolution3D( "MovieLQ" ).Tweak(hue=0.12,sat=1.3,cont=1.14,bright=-5.62) d = b.ColorMatrix(hints=true).ConvertToYV12().tfm(order=1).tdecimate(hybrid=1).antialiasing(order=1).Crop(4,4,-2,-4).Spline64Resize(640,480).degrainmedian(4,6,1,false,false).HQDN3D(2.6,4.2,1,3.8).fastlinedarken(102,212,224,1).WarpSharp().Tweak(hue=0.12,sat=1.3,cont=1.14,bright=-5.62) e = c+d return(e) Last edited by octavarium; 29th October 2008 at 21:27. |
30th October 2008, 03:42 | #3 | Link |
Registered User
Join Date: Jan 2008
Posts: 5
|
thank you for replying so quickly, i had fabricated this post very quickly only a couple of minutes before work, and i have tried your suggestion, but it does not seem to help. I want to add the after effects to trimmed section 'a' and this will only overlay from the start of clip1. I'm very much novice as far as scripting is concerned. Is there any way i could set this overlay to run just on this trimmed section?
|
30th October 2008, 05:35 | #4 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
so you're trying to get 'clip2' overlayed onto 'a' right?
then after the a = trim(...) line you should be able to do a = Overlay(a, clip2, mode="blend", opacity=0.5) before the c = a.ColorMatrix()... line so it'll be changed in time for c |
30th October 2008, 11:20 | #6 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
... So quickly that I failed to spot that you wanted the overlay applied only to section 'a'.
Anyway, the point to note is that Overlay(c1, c2, ...) does not change the variable c1 - only an assignment (c1 = ...) can do that. If there is no explicit assignment, Avisynth assigns the result to the special variable called 'last'. Another point on your script: ColorMatrix(hints=true) needs to come directly after the mpeg2source filter that produces the hints. So you should change the first line to clip1 = DGDecode_mpeg2source( ... , info=3).ColorMatrix(hints=true) and remove the later uses of ColorMatrix. |
30th October 2008, 14:30 | #7 | Link |
Registered User
Join Date: Jan 2008
Posts: 5
|
thank you. avisynth was throwing me errors so i already re-wrote the script. This is working quite well
Code:
clip1 = DGDecode_mpeg2source("E:\Projects\DesertPunk\v1.d2v", info=3).ColorMatrix(hints=true).ConvertToYV12().tfm(order=1).tdecimate(hybrid=1) a = trim(clip1,36,289) b = trim(clip1,290,2194) c = trim(clip1,2195,34799) clip2 = avisource("E:\Downloads\DesertPunkOP.avi") d = a.Crop(4,4,-2,-4).Spline64Resize(640,480).Convolution3D( "MovieLQ" ).Tweak(hue=0.12,sat=1.3,cont=1.14,bright=-5.62) e = b.Crop(4,4,-2,-4).Spline64Resize(640,480).Convolution3D( "MovieLQ" ).Tweak(hue=0.12,sat=1.3,cont=1.14,bright=-5.62) f = c.antialiasing(order=1).Crop(4,4,-2,-4).Spline64Resize(640,480).degrainmedian(4,6,1,false,false).HQDN3D(2.6,4.2,1,3.8).fastlinedarken(102,212,224,1).WarpSharp().Tweak(hue=0.12,sat=1.3,cont=1.14,bright=-5.62) e = Overlay(e, clip2, mode="blend", opacity=0.5) g = d+e+f return(g) |
Tags |
avisynth usage, overlay |
|
|