Audio in Avisynth

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
User avatar
lynit
Joined: Thu Oct 21, 2004 12:59 pm
Location: Edmonton, Alberta
Org Profile

Audio in Avisynth

Post by lynit » Wed May 23, 2007 1:49 pm

Ok, I've got this weird problem. When I was trying to use Zarx264gui to convert my AMV to x.264, it mentioned to me that I did not have any audio selected (even though I imported some). Since it supposedly only imports avs files, I decided to take a look at my script.

Now I have a problem. I can't figure out how to add audio to my script using Avisynth. Supposedly it's 'AudioDub', but when I tried it, it didn't work. Here's my script.
avisource("C:\Documents and Settings\PC User\My Documents\death note amv-lagarith.avi")
ConvertToYV12()
deen("a3d")
temporalcleaner()
mftoon()
WAVSource("C:\Documents and Settings\PC User\My Documents\My Music\SP0000.wav")
AudioDub (WAVSource ("C:\Project Folder\SFIIVTest\SFIIVTest T01 2_0ch 192Kbps 48KHz.wav")(AVISource("C:\Documents and Settings\PC User\My Documents\death note amv-lagarith.avi")))
Does anyone know this problem?
<Stirspeare> Otohiko: You guys sure love dongs.

User avatar
JaddziaDax
Crazy Cat Lady!
Joined: Tue Mar 16, 2004 6:25 am
Status: I has a TRU Arceus
Location: somewhere i think O.o
Contact:
Org Profile

Post by JaddziaDax » Wed May 23, 2007 2:14 pm

you can import a wav file into it without the script fyi

User avatar
lynit
Joined: Thu Oct 21, 2004 12:59 pm
Location: Edmonton, Alberta
Org Profile

Post by lynit » Wed May 23, 2007 4:21 pm

JaddziaDax wrote:you can import a wav file into it without the script fyi
Yeah I know. However, they tell me that I don't have any audio selected, and when I save, the video's got no audio.
<Stirspeare> Otohiko: You guys sure love dongs.

User avatar
FinalResolve
Joined: Sun Apr 15, 2007 1:34 pm
Org Profile

Post by FinalResolve » Wed May 23, 2007 5:10 pm

Either go to Streams->Stream list in VDM and add it there and Zarx264gui will detect the audio automatically.

If you've exported the Video and Audio separately and it doesn't detect the audio, I've found having the extension in capital letters causes this (well, it did for me) for example, change .WAV to .wav at the end of the file name.

If that fails encode the .wav into .acc/.m4a/.mp3 using a different audio encoder than the one you used because sometimes it seems to accept some but not others.
Image

User avatar
lynit
Joined: Thu Oct 21, 2004 12:59 pm
Location: Edmonton, Alberta
Org Profile

Post by lynit » Wed May 23, 2007 7:40 pm

Actually I figured out how to add in the audio. Just have to do this
AudioDub (WAVSource ("blah.wav") AVISource("blah.avi"))
The audio's a few seconds off, but whatever.

Thanks :)
<Stirspeare> Otohiko: You guys sure love dongs.

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Audio in Avisynth

Post by Scintilla » Wed May 23, 2007 9:43 pm

`Eclipse wrote:avisource("C:\Documents and Settings\PC User\My Documents\death note amv-lagarith.avi")
ConvertToYV12()
deen("a3d")
temporalcleaner()
mftoon()
WAVSource("C:\Documents and Settings\PC User\My Documents\My Music\SP0000.wav")
Okay, here's the problem: Every line up until <b>mftoon()</b> returned a video. But then you called <b>WAVSource()</b>, which ignores everything you put before it and only returns audio. Your video is now gone.

What you need is something along the lines of:
<b><i>[first few lines go here]</i>
mftoon()
video=last
audio=WAVSource("C:\Documents and Settings\PC User\My Documents\My Music\SP0000.wav")</b>

Then use the variable names <b>video</b> and <b>audio</b> to refer to the video and the audio respectively. Usually, the next step would be <b>AudioDub(video,audio)</b>.
`Eclipse wrote:AudioDub (WAVSource ("C:\Project Folder\SFIIVTest\SFIIVTest T01 2_0ch 192Kbps 48KHz.wav")(AVISource("C:\Documents and Settings\PC User\My Documents\death note amv-lagarith.avi")))
There's three problems with this:
1) The arguments are in the wrong order. Video source goes first, audio source second.
2) You need a comma in between the two arguments. Your most recent post didn't fix this either.
3) The video source is straight from the file, without going through all that filtering you wanted to do. See above for the proper way to do it.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

User avatar
lynit
Joined: Thu Oct 21, 2004 12:59 pm
Location: Edmonton, Alberta
Org Profile

Post by lynit » Wed May 23, 2007 10:31 pm

Ahh..I asked around on the IRC channel a couple hours back, and was told the same thing (Mind you, I was asking about something else >.>)

Here's my new script
avisource("C:\Documents and Settings\PC User\My Documents\death note amv-lagarith.avi")
ConvertToYV12()
deen("a2d",5)
temporalcleaner()
mftoon()
AudioDub(last, WavSource("SP0000.wav"))
This all right?
<Stirspeare> Otohiko: You guys sure love dongs.

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Post by Scintilla » Thu May 24, 2007 4:26 pm

Only possible problem I see with it is lack of a full path to the WAV file. If it doesn't work, add the full path.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

Locked

Return to “AviSynth Help”