Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Advanced Video Processing > Avisynth Dissolve Function


Posted by: rjisinspired Aug 27 2010, 06:31 PM
I'm going by this:
http://avisynth.org/mediawiki/Dissolve

In my case I will be dissolving more than 2 clips. So far I had been trying with three and haven't succeeded in getting it right.

My script:
a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
Dissolve(a, b, 30)
Dissolve(b, c, 30)

The first video ends up not showing, second video starts instead.

I've tried the "Last" parameter for the first video "A" but somehow the second video plays again.

Better yet, is there a script that will take say segmented video pieces and apply the dissolve at the joined parts?

Posted by: dloneranger Aug 27 2010, 07:10 PM
If you read your script as
QUOTE
My script:
a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
last=Dissolve(a, b, 30)
last=Dissolve(b, c, 30)
return(last)

You should see the problem
You're throwing away the first dissolve

(I hate that implicit 'last' and usually use variables instead)

How about
CODE

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")

d=Dissolve(a, b, 30)
e=Dissolve(b, c, 30)

f=Dissolve(d, e, 30)

return(f)

Posted by: rjisinspired Aug 27 2010, 07:59 PM
Here is an example with 6 videos:

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
d = DirectShowSource("Vid.04.mp4")
e = DirectShowSource("Vid.05.mp4")
f = DirectShowSource("Vid.06.mp4")

g = Dissolve(a, b, 30)
h = Dissolve(b, c, 30)
i = Dissolve(c, d, 30)
j = Dissolve(d, e, 30)
k = Dissolve(e, f, 30)

Return(g + h + i + j + k)

Seems to work but the videos between the first and last repeat twice. Getting close.
though.

Once I get this down all I need are the fade parts on the start and ends which I can use the "fadeio" in avisynth for.

Posted by: dloneranger Aug 27 2010, 09:07 PM
My mistake. The code I gave should have been
QUOTE

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")

d=Dissolve(a, b, 30)
e=Dissolve(d, c, 30)

return(e)


Your second one should be
QUOTE

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
d = DirectShowSource("Vid.04.mp4")
e = DirectShowSource("Vid.05.mp4")
f = DirectShowSource("Vid.06.mp4")

g = Dissolve(a, b, 30)
h = Dissolve(c, d, 30)
i = Dissolve(e, f, 30)

j = Dissolve(g, h, 30)
k = Dissolve(j, i, 30)

Return( k)


or (same result, just a different way of writing it)

QUOTE

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
d = DirectShowSource("Vid.04.mp4")
e = DirectShowSource("Vid.05.mp4")
f = DirectShowSource("Vid.06.mp4")

g = Dissolve(a, b, 30)
h = Dissolve(g, c, 30)
i = Dissolve(h, d, 30)
j = Dissolve(i, e, 30)
k = Dissolve(j, f, 30)

Return(k)



This....
CODE
g = Dissolve(a, b, 30)
h = Dissolve(b, c, 30)
i = Dissolve(c, d, 30)
j = Dissolve(d, e, 30)
k = Dissolve(e, f, 30)
Return(g + h + i + j + k)

gives you doubled parts because...
g= a + b
h = b + c
put them together and its a+b+b+c
and so on
until you get
return a+b+b+c+c+d+d+e+e+f

Posted by: dloneranger Aug 27 2010, 09:22 PM
Just looking at the wiki page you gave

According to the specs
Dissolve(clip clip1, clip clip2 [,...], int overlap)
You should be able to

CODE

a = DirectShowSource("Vid.01.mp4")
b = DirectShowSource("Vid.02.mp4")
c = DirectShowSource("Vid.03.mp4")
d = DirectShowSource("Vid.04.mp4")
e = DirectShowSource("Vid.05.mp4")
f = DirectShowSource("Vid.06.mp4")

g = Dissolve(a, b,c,d,e,f, 30)

Return( g)


That's normally what the [,...] means "repeat as required"

Posted by: rjisinspired Aug 27 2010, 10:37 PM
Thanks! Both of those examples worked. I like the simpler one which was the last one though.

Now all I need to do is use the fade in to black and fade out to black which should be easy.

Before anything else, I will need to convert the MP4 segments to some other format. Loading 72 avc segments and you get an "out of memory" error, guess I don't have enough memory to load that many through avisynth, lol.

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)