Log in

View Full Version : Processing in the correct order, to return a final movie?


RjBeals
5th September 2008, 17:06
What I want to do is:
1) Load several clips of the same movie.
2) Add a background track in addition to the video's audio. (I can't figure out how to reduce the volume of that background track?)
3) Degrain the interlaced video
4) Deinterlace it
5) Then final resize it to 320x240

What am I doing wrong here?



LoadPlugin("C:\mvtools.dll")
LoadPlugin("C:\TDeint.DLL")


A = AVISource("C:\Documents and Settings\bealr0sp\Desktop\Downloads\capture_30sec.avi").trim(200,300)
B = AVISource("C:\Documents and Settings\bealr0sp\Desktop\Downloads\capture_30sec.avi").trim(700,800)

Soundtrack = WAVSource("C:\Documents and Settings\bealr0sp\Desktop\Downloads\LittleStar.wav")
Source = Dissolve(A, B, 30)


#------------------AUDIO-----------------------
AudioDub(Source, Soundtrack)



#-----------------DeGrain---------------------

source=source.AssumeTFF()
source=source.SeparateFields()#now field 720x240
backward_vec2 = source.MVAnalyse(isb = true, delta = 4, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 4, pel = 2, overlap=4, sharp=1, idx = 1)
source=source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)
source.Weave()#Now frame 720x480


#------------------DeInterlace------------------
TDeint(mode=1)


#------------TWEEK------------------------------
FadeIO2(30)
Crop(8, 8, -8, -8)
Lanczos4Resize(320,240)
Tweak(hue=-5.1, sat=1.1, bright=-26, cont=1.1, coring=true, sse=false)
ConvertAudioTo16bit()

Gavino
5th September 2008, 18:32
You don't say what is going wrong, but I expect you are missing the audio?

This line
AudioDub(Source, Soundtrack)
should be
Source = AudioDub(Source, Soundtrack)
Use Amplify (http://avisynth.org/mediawiki/Amplify) (or AmplifyDB) to alter the audio volume.

BTW There's no need to have two instances of AVISource to repeat the video. Just do
Source = Dissolve(A, A, 30)

RjBeals
5th September 2008, 18:53
Ahh... almost got it.
Is there an example of how to use the amplify filter correctly?
As in..

Soundtrack = Amplify (Sountrack,-1)

Also - it seems as though the original video audio is now replaced with this new soundtrack. I wanted to "mux" them together.

Gavino
5th September 2008, 19:06
For example:Soundtrack = Amplify (Soundtrack, 0.5) would reduce the volume to 50%.

But it sounds like in fact you really want MixAudio (http://avisynth.org/mediawiki/MixAudio) - see that page for examples of its use.

RjBeals
5th September 2008, 19:15
Yes I looked at that mixaudio, but it doesn't appear I can mix the avisource as an audio track. ? Unless I pull in the avi as wavesource as well as an avi source?

Thanks for the help so far.

Comatose
5th September 2008, 19:44
You can remove the video from the clip with something like "blah = A.killvideo()"

RjBeals
5th September 2008, 19:49
You can remove the video from the clip with something like "blah = A.killvideo()"

But I don't want to kill the audio. I want the audio, but want to mix a background song in with it.

Gavino
5th September 2008, 20:19
Yes I looked at that mixaudio, but it doesn't appear I can mix the avisource as an audio track. ?
Have you tried simply replacing AudioDub(Source, Soundtrack) byMixAudio(Source, Soundtrack, ...)
I haven't tried it, but I would expect this to retain the video from Source.

RjBeals
5th September 2008, 21:04
Got it..
Here's what I did.
Basically forgot to audiodub.

sourcex = AVISource("C:\Documents and Settings\...\capture_30sec.avi")
sourcex = ConvertToMono(Sourcex)

Soundtrack = WAVSource("C:\Documents and Settings\...\LittleStar.wav")
Soundtrack = ResampleAudio(Soundtrack,48000)
Soundtrack = ConvertToMono(Soundtrack)


A = Trim(sourcex,150,250)
B = Trim(sourcex,500,700)

sourcex = Dissolve(A,B,30)
Audio = MixAudio(Soundtrack, sourcex, 0.75)
source = AudioDub(sourcex, audio)

Gavino
5th September 2008, 21:18
Glad to see you got there in the end.

Basically forgot to audiodub.
...
Audio = MixAudio(Soundtrack, sourcex, 0.75)
source = AudioDub(sourcex, audio)
Can't you just combine these into
source = MixAudio(sourcex, SoundTrack, 0.25)
or does this lose the video?

Comatose
5th September 2008, 22:19
But I don't want to kill the audio. I want the audio, but want to mix a background song in with it.
I was saying you could create another clip with only the audio (separate the video and the audio) for mixing/audiodubbing purposes.

Blue_MiSfit
5th September 2008, 23:57
A note - if you're going from SD to 320xwhatever, there's no reason to deinterlace, just use Reduceby2() :)

~MiSfit

RjBeals
8th September 2008, 14:31
A note - if you're going from SD to 320xwhatever, there's no reason to deinterlace, just use Reduceby2() :)

~MiSfit

This is what I also thought - but testing the 2, the deinterlace looked better. Doesn't make sense to me, but the images speak for themselves.

Gavino
8th September 2008, 23:41
A note - if you're going from SD to 320xwhatever, there's no reason to deinterlace, just use Reduceby2()This is what I also thought - but testing the 2, the deinterlace looked better. Doesn't make sense to me, but the images speak for themselves.
I believe [Vertical]ReduceBy2() in effect blends the two fields together, so will give a qualitatively different result to field-separated deinterlacing.