Mr_Odwin
24th June 2006, 18:30
I'm using Avisynth 2.56a
I have a clip with no audio and I normally use an avsi file that I've written to create a blank soundtrack (or to downmix to stereo if the file requires).
Here is my avsi file:
Function FAVCStereo(clip Video, clip Audio) {
Dubbed = Video
Chan0 = (AudioChannels(Audio)==0) ? AudioDub(Video, BlankClip(Video, audio_rate=48000, stereo=true)) : nop()
Dubbed = (AudioChannels(Audio)==0) ? Chan0 : Dubbed
Audio = (AudioChannels(Audio)>=1) ? ConvertAudioToFloat(Audio) : nop()
Chan1 = (AudioChannels(Audio)==1) ? Audiodub(Video, GetChannel(Audio, 1, 1)) : nop()
Dubbed = (AudioChannels(Audio)==1) ? Chan1 : Dubbed
Chan2 = (AudioChannels(Audio)==2) ? Audiodub(Video, Audio) : nop()
Dubbed = (AudioChannels(Audio)==2) ? Chan2 : Dubbed
FrontLeft = (AudioChannels(Audio)==3) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.5, 0.5) : nop()
FrontRight = (AudioChannels(Audio)==3) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.5, 0.5) : nop()
Chan3 = (AudioChannels(Audio)==3) ? Audiodub(Video, MergeChannels(FrontLeft, FrontRight)) : nop()
Dubbed = (AudioChannels(Audio)==3) ? Chan3 : Dubbed
TotalLeft = (AudioChannels(Audio)==4) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.5, 0.5) : nop()
TotalRight = (AudioChannels(Audio)==4) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 4), 0.5, 0.5) : nop()
Chan4 = (AudioChannels(Audio)==4) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)==4) ? Chan4 : Dubbed
FrontLeft = (AudioChannels(Audio)==5) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.3694, 0.2612) : nop()
FrontRight = (AudioChannels(Audio)==5) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.3694, 0.2612) : nop()
TotalLeft = (AudioChannels(Audio)==5) ? MixAudio(FrontLeft, GetChannel(Audio, 4), 1, 0.3694) : nop()
TotalRight = (AudioChannels(Audio)==5) ? MixAudio(FrontRight, GetChannel(Audio, 5), 1, 0.3694) : nop()
Chan5 = (AudioChannels(Audio)==5) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)==5) ? Chan5 : Dubbed
#The following works with DirectShowSource and NicAudio
BackLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 5), GetChannel(Audio, 4), 0.2698, 0.2698) : nop()
BackRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 6), GetChannel(Audio, 4), 0.2698, 0.2698) : nop()
FrontLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.2698, 0.1906) : nop()
FrontRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.2698, 0.1906) : nop()
TotalLeft = (AudioChannels(Audio)>=6) ? MixAudio(FrontLeft, BackLeft, 1, 1) : nop()
TotalRight = (AudioChannels(Audio)>=6) ? MixAudio(FrontRight, BackRight, 1, 1) : nop()
Chan6 = (AudioChannels(Audio)>=6) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)>=6) ? Chan6 : Dubbed
Dubbed = (AudioChannels(Audio)>=1) ? Normalize(Dubbed) : nop()
Dubbed = (AudioChannels(Audio)>=1) ? SSRC(Dubbed, 48000) : nop()
Dubbed = (AudioChannels(Audio)>=1) ? ConvertAudioTo16bit(Dubbed) : nop()
return(Dubbed)
}
Here is my script:
Import("C:\Documents and Settings\James\My Documents\FAVC\Avisynth Plugins\FAVCStereo.avsi")
AVISource("C:\Documents and Settings\James\My Documents\FAVC\To Do\RS_NoAudio.avi").EnsureVBRMP3Sync
FAVCStereo(Last,Last)
Here is the resulting error:
http://homepages.nildram.co.uk/~pike/FS_Error.jpg
Line 10 of the avsi? Is that not weird?
Here is the video clip (http://homepages.nildram.co.uk/~pike/RS_NoAudio.avi) if anyone cares to test it out. But I've tried this with other clips that have no audio and it also doesn't work. The avsi file works great for clips that have audio. No errors at all.
If anyone can shed some light on this I'd much appreciate it. Some of you may be thinking "well just omit the line in the avs script and all will be well", but this script is produced as part of an automated process and knowing where the avsi file is going wrong would help me a lot.
I have a clip with no audio and I normally use an avsi file that I've written to create a blank soundtrack (or to downmix to stereo if the file requires).
Here is my avsi file:
Function FAVCStereo(clip Video, clip Audio) {
Dubbed = Video
Chan0 = (AudioChannels(Audio)==0) ? AudioDub(Video, BlankClip(Video, audio_rate=48000, stereo=true)) : nop()
Dubbed = (AudioChannels(Audio)==0) ? Chan0 : Dubbed
Audio = (AudioChannels(Audio)>=1) ? ConvertAudioToFloat(Audio) : nop()
Chan1 = (AudioChannels(Audio)==1) ? Audiodub(Video, GetChannel(Audio, 1, 1)) : nop()
Dubbed = (AudioChannels(Audio)==1) ? Chan1 : Dubbed
Chan2 = (AudioChannels(Audio)==2) ? Audiodub(Video, Audio) : nop()
Dubbed = (AudioChannels(Audio)==2) ? Chan2 : Dubbed
FrontLeft = (AudioChannels(Audio)==3) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.5, 0.5) : nop()
FrontRight = (AudioChannels(Audio)==3) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.5, 0.5) : nop()
Chan3 = (AudioChannels(Audio)==3) ? Audiodub(Video, MergeChannels(FrontLeft, FrontRight)) : nop()
Dubbed = (AudioChannels(Audio)==3) ? Chan3 : Dubbed
TotalLeft = (AudioChannels(Audio)==4) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.5, 0.5) : nop()
TotalRight = (AudioChannels(Audio)==4) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 4), 0.5, 0.5) : nop()
Chan4 = (AudioChannels(Audio)==4) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)==4) ? Chan4 : Dubbed
FrontLeft = (AudioChannels(Audio)==5) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.3694, 0.2612) : nop()
FrontRight = (AudioChannels(Audio)==5) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.3694, 0.2612) : nop()
TotalLeft = (AudioChannels(Audio)==5) ? MixAudio(FrontLeft, GetChannel(Audio, 4), 1, 0.3694) : nop()
TotalRight = (AudioChannels(Audio)==5) ? MixAudio(FrontRight, GetChannel(Audio, 5), 1, 0.3694) : nop()
Chan5 = (AudioChannels(Audio)==5) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)==5) ? Chan5 : Dubbed
#The following works with DirectShowSource and NicAudio
BackLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 5), GetChannel(Audio, 4), 0.2698, 0.2698) : nop()
BackRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 6), GetChannel(Audio, 4), 0.2698, 0.2698) : nop()
FrontLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 3), 0.2698, 0.1906) : nop()
FrontRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 2), GetChannel(Audio, 3), 0.2698, 0.1906) : nop()
TotalLeft = (AudioChannels(Audio)>=6) ? MixAudio(FrontLeft, BackLeft, 1, 1) : nop()
TotalRight = (AudioChannels(Audio)>=6) ? MixAudio(FrontRight, BackRight, 1, 1) : nop()
Chan6 = (AudioChannels(Audio)>=6) ? Audiodub(Video, MergeChannels(TotalLeft, TotalRight)) : nop()
Dubbed = (AudioChannels(Audio)>=6) ? Chan6 : Dubbed
Dubbed = (AudioChannels(Audio)>=1) ? Normalize(Dubbed) : nop()
Dubbed = (AudioChannels(Audio)>=1) ? SSRC(Dubbed, 48000) : nop()
Dubbed = (AudioChannels(Audio)>=1) ? ConvertAudioTo16bit(Dubbed) : nop()
return(Dubbed)
}
Here is my script:
Import("C:\Documents and Settings\James\My Documents\FAVC\Avisynth Plugins\FAVCStereo.avsi")
AVISource("C:\Documents and Settings\James\My Documents\FAVC\To Do\RS_NoAudio.avi").EnsureVBRMP3Sync
FAVCStereo(Last,Last)
Here is the resulting error:
http://homepages.nildram.co.uk/~pike/FS_Error.jpg
Line 10 of the avsi? Is that not weird?
Here is the video clip (http://homepages.nildram.co.uk/~pike/RS_NoAudio.avi) if anyone cares to test it out. But I've tried this with other clips that have no audio and it also doesn't work. The avsi file works great for clips that have audio. No errors at all.
If anyone can shed some light on this I'd much appreciate it. Some of you may be thinking "well just omit the line in the avs script and all will be well", but this script is produced as part of an automated process and knowing where the avsi file is going wrong would help me a lot.