Log in

View Full Version : How to include .mpa audio w/ .d2v video?


lbecque
2nd June 2005, 19:38
I have taken an mpeg2 file and processed it with dgindex and demuxed the audio into a .mpa file. I'm then using an avisynth script to process the video but I can't figure out how to dub the audio back in. Help!

My script looks like:
loadplugin("...DGDecode.dll")
# following upconv=true To convert to YUY2 for virtualdub
mpeg2source("D:\movies\resize battlestar.d2v", upConv=true)
# if interlaced use folowing group of lines
SeparateFields()
Lanczos4Resize(720,240,0,29,720,180).Weave()

I tried adding the following lines but can't get any of it to work:
# can't get following lines to work
video = Lanczos4Resize(720,240,0,29,720,180).Weave()
audio = WavSource("D:\movies\resize battlestar MPA T01 DELAY 17ms.mpa")
AudioDub(video, audio)

Wilbert
2nd June 2005, 20:19
Use NicMPASource or MPASource and don't forget about the possible delay.

acrespo
2nd June 2005, 20:49
Or convert .MPA file to .WAV. I recommend this conversion because MPA file need to decode in real time by the plugins and CPU need more time to do this step.

lbecque
2nd June 2005, 22:41
Use NicMPASource or MPASource and don't forget about the possible delay.

I need some education here. What do you mean by not forgetting about the delay???

Wilbert
2nd June 2005, 23:16
If you look at the name of the mpa file you will see it has a delay of 17ms. Thus your script becomes

loadplugin("...DGDecode.dll")
# following upconv=true To convert to YUY2 for virtualdub
mpeg2source("D:\movies\resize battlestar.d2v", upConv=true)
# if interlaced use folowing group of lines
video = last.SeparateFields().Lanczos4Resize(720,240,0,29,720,180).Weave()
audio = MPASource("D:\movies\resize battlestar MPA T01 DELAY 17ms.mpa")
AudioDub(video,audio)
DelayAudio(0.017)

lbecque
3rd June 2005, 00:28
Thanks Wilbert and thanks again for straightening out that one line I was having trouble with
video = last.SeparateFields().Lanczos4Resize(720,240,0,29,720,180).Weave()

I was a little puzzled at first with this line but I found some explanations on the avisynth site and I think I get it now.
Last is a special variable representing the clip from the previous statements.
and the '.' is the same as putting it inside the next function i.e.
separatefileds(last)