I'm trying to mix the Audio between 3 different clips but one of them is a much higher quality so I get this message. I'm getting the option to use either MergeChannel or ConvertToMono with MixAudio but I don't know how to go about it. Here's what I have.
S9=S9.Trim(18978,19023)+S5.Trim(37875,37900)
S1.Trim(100090,100245)
MixAudio(S1,S9,1,1)
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 7 of 7
Thread
-
-
It's probably because one is 5.1ch and the other is 2ch.
You could downmix the 5.1ch audio to stereo before joining or mixing them. There's a bunch of downmixing functions here, but for a standard 5.1ch downmix:
Code:function Dmix6Stereo(clip a) { flr = GetChannel(a, 1, 2) fcc = GetChannel(a, 3, 3) lrc = MixAudio(flr, fcc, 0.3694, 0.2612) blr = GetChannel(a, 5, 6) return MixAudio(lrc, blr, 1.0, 0.3694) }
Code:function c6_stereo(clip a) { fl = GetChannel(a, 1) fr = GetChannel(a, 2) fc = GetChannel(a, 3) lf = GetChannel(a, 4) sl = GetChannel(a, 5) sr = GetChannel(a, 6) fl_sl = MixAudio(fl, sl, 0.2929, 0.2929) fr_sr = MixAudio(fr, sr, 0.2929, 0.2929) fc_lf = MixAudio(fc, lf, 0.2071, 0.2071) l = MixAudio(fl_sl, fc_lf, 1.0, 1.0) r = MixAudio(fr_sr, fc_lf, 1.0, 1.0) return MergeChannels(l, r) }
S9=S9.Trim(18978,19023) ++ S5.Trim(37875,37900)
S1.Trim(100090,100245).Dmix6Stereo()
MixAudio(S1,S9,1,1)
Assuming the S1 audio is 5.1ch.
When you have it working, you might want to normalize each if them, as downmixing might cause clipping, but it's a two pass process so get it working first.
S9=S9.Trim(18978,19023).Normalize() ++ S5.Trim(37875,37900).Normalize()
S1.Trim(100090,100245).Dmix6Stereo().Normalize()
MixAudio(S1,S9,1,1)
I've been guessing, but that seems like it'd be the most likely cause.Last edited by hello_hello; 25th Jun 2020 at 05:26.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
It's an AC3 file with one channel.
The other 2 files have 2 channels.
The DMixStereo doesn't work for me though, unless there's a plugin somewhere.Last edited by smike; 25th Jun 2020 at 23:29.
-
I think you can convert the mono audio to 2 channel this way. I haven't tested it, but it should work.
Audio = whatever
A = GetChannel(Audio, 1)
MergeChannels(A, A)Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
I never could get that method to work. I started trying to use the ResampleAudio and MergeChannels function too:
S1=S1.Trim(100090,100245).ResampleAudio(48000, 1)
S9.Trim(18978,19023)+S5.Trim(37875,37900).MergeCha nnels(S1,S9)
MixAudio(S1,S9,1,1)
Now it's telling me that the number of audio channels do not match. Was hoping I was on the right path. -
That usually only happens when the number of audio channels don't match.
I can only guess from your script, but, you've connected MergeChannels with a dot, so if the previous filter outputs audio, it'll use it for the clip1 input, you've specified two clips, so that's a total of three. I suspect you just need to unchain MergeChannels.
S1=S1.Trim(100090,100245).ResampleAudio(48000, 1)
S9.Trim(18978,19023)++S5.Trim(37875,37900)
MergeChannels(S1,S9)
MixAudio(S1,S9,1,1)
Although S9 hasn't been redefined there, so it won't have a new value. You probably should update it or create a new variable, or replace it with "last" for MergeChannels.
S1=S1.Trim(100090,100245).ResampleAudio(48000, 1)
S9.Trim(18978,19023)++S5.Trim(37875,37900) # "last" should be updated to become the output after this line
MergeChannels(S1,last)
MixAudio(S1,last,1,1)Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
That worked, thanks so much!
Last edited by smike; 12th Sep 2020 at 14:29. Reason: Found solution
Similar Threads
-
How to put two video clips side by side with VirtualDub and AviSynth?
By qingfeng in forum EditingReplies: 10Last Post: 1st Jun 2023, 08:57 -
Trying to combine audio clips in AviSynth
By smike in forum EditingReplies: 2Last Post: 1st Jun 2020, 14:29 -
Concatenate clips with as little code as possible in AviSynth+
By miguelmorin in forum EditingReplies: 7Last Post: 22nd Feb 2020, 07:12 -
AviSynth editing multiple clips
By jseo13579 in forum EditingReplies: 12Last Post: 21st Sep 2019, 22:20 -
Splice: The number of audio channels doesn't match
By pooksahib in forum EditingReplies: 8Last Post: 5th Jun 2018, 15:27