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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th October 2008, 21:23   #1  |  Link
octavarium
Registered User
 
octavarium's Avatar
 
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)
any suggestions would be greatly appreciated.

Last edited by octavarium; 29th October 2008 at 21:27.
octavarium is offline   Reply With Quote
Old 29th October 2008, 21:34   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,385
You are not using the Overlay in the result of your script.
You want
Code:
clip1 = Overlay(clip1, clip2, mode="blend", opacity=0.5)
Gavino is offline   Reply With Quote
Old 30th October 2008, 03:42   #3  |  Link
octavarium
Registered User
 
octavarium's Avatar
 
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?
octavarium is offline   Reply With Quote
Old 30th October 2008, 05:35   #4  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
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
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 30th October 2008, 08:18   #5  |  Link
octavarium
Registered User
 
octavarium's Avatar
 
Join Date: Jan 2008
Posts: 5
Yes, that's exactly what i was trying to do. Thank you Kemuri-_9. Now that i know what needs to be done, i can get this working on my other scripts with ease.
octavarium is offline   Reply With Quote
Old 30th October 2008, 11:20   #6  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,385
Quote:
Originally Posted by octavarium View Post
thank you for replying so quickly ...
... 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.
Gavino is offline   Reply With Quote
Old 30th October 2008, 14:30   #7  |  Link
octavarium
Registered User
 
octavarium's Avatar
 
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)
octavarium is offline   Reply With Quote
Reply

Tags
avisynth usage, overlay

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:47.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.