Hello, it would be great if someone could help me. I'm trying to edit an avi file with AviSynth and VirtualDub. If I open the avi directly in VDub, everything is fine. But when I play the same video via AviSynth in VDub, there is no audio. However, if I save a portion of it as avi, that avi does have audio, so apparently there is something wrong with the preview function.
The problem occurs with a minimal script like
AviSource("video.avi")
and also if I save the audio as wav and put
vid=AviSource("video.avi")
aud=WAVSource("audio.wav")
AudioDub(vid,aud)
in the avs file. No audio in the VDub preview. Of course I could load the wav via VDub "Audio from other file", but this wouldn't help me because then the cutting I do in AviSynth would only affect the video. Can anyone help?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 21 of 21
Thread
-
Last edited by Sebastian2011; 11th Mar 2012 at 06:03.
-
In Vdub open the AVS and then do
File/File information and see what it says about the audio.
And also add info() to the script and see what Avisynth says.
How many channels?
Instead of Avisource, you can also use
FFmpegSource2("video.avi",atrack=-1,fpsnum=-1,fpsden=1)
or
DirectShowSource("video.avi")
These usually work if Avisource has a problem with audio. -
-
Info looks normal, uncompressed PCM.
And also add info() to the script and see what Avisynth says.
How many channels?
Instead of Avisource, you can also use
FFmpegSource2("video.avi",atrack=-1,fpsnum=-1,fpsden=1)
or
DirectShowSource("video.avi")
These usually work if Avisource has a problem with audio. -
testcutvdub.avi
Here is a test cut I did in VDub....outputted it to H264 and kept the original audio. -
Thanks for everybody's efforts. Yes, opening it directly in VDub works fine for me too, trouble begins with AviSynth.
Another strange observation: As I said, when I open that file with AviSynth (AviSource) and VDub, it doesn't play the audio. If I go ahead and replace the "AviSource" in my script by "DirectShowSource" and reload, the sound is there. If I change the script back to AviSource, it's still there! But only until I close and reopen VirtualDub, then it's silent again.
So never mind and thanks again, it's just some kind of bug. -
That's the issue; I think it's just VDub isn't set up for multichannel playing.
If you want to hear your clip, you can just do
Code:AVISource("test.avi") GetChannel(3)
When you have your script done you can comment out the GetChannel and save the output as multichannel, even if you don't hear it in VDub.
Or if you want to downmix 6 channels properly to stereo, use a function like
Code:function Dmix6Dpl(clip a) { flr = GetChannel(a, 1, 2) fcc = GetChannel(a, 3, 3) lrc = MixAudio(flr, fcc, 0.3205, 0.2265) bl = GetChannel(a, 5) br = GetChannel(a, 6) sl = MixAudio(bl, br, 0.2265, 0.2265) sr = MixAudio(bl, br, -0.2265, -0.2265) blr = MergeChannels(sl, sr) return MixAudio(lrc, blr, 1.0, 1.0) }
See
http://avisynth.org/mediawiki/GetChannel
and
http://forum.doom9.org/showthread.php?p=1243880#post1243880
DirectShowSource uses your usual Windows codecs to play it, probably ffdshow.
That will downmix it for you, if your PC is set up for stereo.Last edited by AlanHK; 11th Mar 2012 at 21:10.
-
-
-
Thanks a lot, that helped! Since the source is a DVD, I tried again to use .d2v and .ac3 out of DGIndex files via AviSynth, which resulted in the same problem. When I used GetChannel(3), I got audio, but the music was missing. So I downmixed the .ac3 to stereo .wav with BeLight and used that one. Now everything's shiny.
-
Simpler to downmix in Avisynth:
Best is to put the downmix functions on an avsi file in your Avisynth plugins folder, then you can call them like any built in function.
Otherwise, just put the function in the same file:
Code:AVISource("test.avi") Dmix6Dpl() #Downmix Dolby pro-logic 6 channels to stereo function Dmix6Dpl(clip a) { flr = GetChannel(a, 1, 2) fcc = GetChannel(a, 3, 3) lrc = MixAudio(flr, fcc, 0.3205, 0.2265) bl = GetChannel(a, 5) br = GetChannel(a, 6) sl = MixAudio(bl, br, 0.2265, 0.2265) sr = MixAudio(bl, br, -0.2265, -0.2265) blr = MergeChannels(sl, sr) return MixAudio(lrc, blr, 1.0, 1.0) }
-
Thanks a lot, it works fine and is indeed easier! Sorry for the late reply, I just didn't get around to it sooner. May I ask, is the function automatically applied to all clips if there are multiple ones? Is the "clip" in the function name a custom name or is it part of the syntax?
-
The function is not applied automatically, and has to be explicitly called in order to be applied to some clip.
Here the line Dmix6Dpl() is calling the function - since no clip is explicitly mentioned, the call is implicitly applied to the result of the previous operation (the source clip from AVISource()).
"clip" in the function definition is the type of the parameter 'a'.
For more details on Avisynth script functions, see
http://avisynth.org/mediawiki/User_defined_script_functions -
Similar Threads
-
Why WMP doesn't play DTS audio (MKV, M2TS files) ?
By mahogany in forum Software PlayingReplies: 2Last Post: 11th Dec 2010, 14:45 -
VirtualDub doesn't see x264 codec.
By olegk in forum Video ConversionReplies: 7Last Post: 9th Jun 2010, 02:10 -
Virtualdub - No Preview during Capture
By FatBoy123 in forum CapturingReplies: 5Last Post: 6th Jun 2010, 04:14 -
Unable to play asset in preview window
By gstewart in forum Newbie / General discussionsReplies: 2Last Post: 3rd May 2010, 19:04 -
Audio doesn't play in AVI files, although AC3 codec IS installed
By DVantrease in forum Software PlayingReplies: 2Last Post: 16th Jan 2009, 17:57