VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. 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)
    Quote Quote  
  2. 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)
    }
    Or this is how MeGUI does it. The LFE channel is included (I normally don't include it when downmixing but it's up to you).

    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)
    }
    So I guess you'd do something like:

    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.
    Quote Quote  
  3. 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.
    Quote Quote  
  4. 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)
    Quote Quote  
  5. 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.
    Quote Quote  
  6. Originally Posted by smike View Post
    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)
    Quote Quote  
  7. That worked, thanks so much!
    Last edited by smike; 12th Sep 2020 at 14:29. Reason: Found solution
    Quote Quote  



Similar Threads