Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd April 2023, 14:08   #1  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
Audio downmix

Can someone please write me some approximate correct lines for audio downmix to stereo for avisynth's audio mixer?

8 channel, 6 channel, 5 channel?, 4 channel, 3 channel?
I have this:
Code:
6 channel to 2:
flr = GetChannel(1, 2)
fcc = GetChannel(3, 3)
lrc = MixAudio(flr, fcc, 0.4, 0.4)
blr = GetChannel(5, 6)
MixAudio(lrc, blr, 1.0, 0.2)

4 channel to 2:
flr = GetChannel(1, 2)
blr = GetChannel(3, 4)
MixAudio(flr, blr, 0.5, 0.5)
__________________
Live and let live
gispos is offline   Reply With Quote
Old 23rd April 2023, 17:03   #2  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Here is the latest downmix script from AVStoDVD from 2019. It is based on Tebasuna`s script with a few minor additions. Download here:

https://files.videohelp.com/u/172211/A2D_Downmix.zip

AFAIK Tebasuna has newer versions of this script available, but this older one has always worked well...


Cheers
manolito

Last edited by manolito; 29th April 2023 at 19:40.
manolito is offline   Reply With Quote
Old 23rd April 2023, 20:11   #3  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
Thanks manolito
__________________
Live and let live
gispos is offline   Reply With Quote
Old 24th April 2023, 16:33   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This is what I usually use,

Favc.avsi
Code:
Function FAVCStereo(clip Video, clip Audio) {

    Dubbed = Video

    Chan0 = (HasAudio(Audio)==False) ? AudioDub(Video, BlankClip(Video, audio_rate=48000, stereo=true)) : nop()
    Dubbed = (HasAudio(Audio)==False) ? Chan0 : Dubbed

    Audio = (HasAudio(Audio)==True) ? ConvertAudioToFloat(Audio) : Audio

    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, 2), 0.5, 0.5) : nop()
    FrontRight = (AudioChannels(Audio)==3) ? MixAudio(GetChannel(Audio, 3), GetChannel(Audio, 2), 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, 2), 0.3694, 0.2612) : nop()
    FrontRight = (AudioChannels(Audio)==5) ? MixAudio(GetChannel(Audio, 3), GetChannel(Audio, 2), 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

    BackLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 4), GetChannel(Audio, 6), 0.2698, 0.2698) : nop()
    BackRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 5), GetChannel(Audio, 6), 0.2698, 0.2698) : nop()
    FrontLeft = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 1), GetChannel(Audio, 2), 0.2698, 0.1906) : nop()
    FrontRight = (AudioChannels(Audio)>=6) ? MixAudio(GetChannel(Audio, 3), GetChannel(Audio, 2), 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 = (HasAudio(Audio)==True) ? Normalize(Dubbed) : Dubbed
#    Dubbed = (HasAudio(Audio)==True) ? SSRC(Dubbed, 48000) : Dubbed
    Dubbed = (HasAudio(Audio)==True) ? ConvertAudioTo16bit(Dubbed) : Dubbed

    return(Dubbed)
}

Function FAVCStereoDSS(clip Video, clip Audio) {

    Dubbed = Video

    Chan0 = (HasAudio(Audio)==False) ? AudioDub(Video, BlankClip(Video, audio_rate=48000, stereo=true)) : nop()
    Dubbed = (HasAudio(Audio)==False) ? Chan0 : Dubbed

    Audio = (HasAudio(Audio)==True) ? ConvertAudioToFloat(Audio) : Audio

    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

    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 = (HasAudio(Audio)==True) ? Normalize(Dubbed) : Dubbed
#    Dubbed = (HasAudio(Audio)==True) ? SSRC(Dubbed, 48000) : Dubbed
    Dubbed = (HasAudio(Audio)==True) ? ConvertAudioTo16bit(Dubbed) : Dubbed

    return(Dubbed)
}
I think it came from on-site somewhere, dont know who wrote it.

EDIT: This seems to be first posting about Favc:- https://forum.doom9.org/showthread.p...26#post1011126

EDIT: And a partial script where I use it,
Code:
    if(HasAudio) { # SampleRate >  0
        RT_DebugF("Audio Channels = %d",AudioChannels)
        # WARNING Channels = 0 Means MONO ???
        if(G_CHANNELS == 0 && AudioChannels > 0) {
            RT_DebugF("Killing Audio",name=myName)
            DoLog(RT_String("Killaudio()"))
            KillAudio()
        } else if(G_CHANNELS == 1 && AudioChannels > 1) {
            RT_DebugF("Converting To MONO",name=myName)
            DoLog(RT_String("ConvertToMono()"))
            ConvertToMono()
        } else if(G_CHANNELS == 2 && AudioChannels ==1) {
            RT_DebugF("Converting To DUEL Channel MONO",name=myName)
            DoLog(RT_String("AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Matching to required output, 2 audio channels"))
            AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1)))
        } Else if (G_CHANNELS == 2 &&  AudioChannels != 2) {
            RT_DebugF("Converting To Stereo",name=myName)
            DoLog(RT_string("FAVCStereo(Last,Last) # Converting audio output to Stereo"))
            FAVCStereo(Last,Last)
        }
        RT_DebugF("Channels = %d",AudioChannels)
        if(HasAudio() && G_BITS != AudioBits) {
            if(G_BITS==8)       {
                DoLog(RT_String("ConvertAudioTo8bit() # Matching to required AudioBits"))
                ConvertAudioTo8bit()
            } else if(G_BITS==16) {
                DoLog(RT_String("ConvertAudioTo16bit() # Matching to required AudioBits"))
                ConvertAudioTo16bit()
            } else if(G_BITS==24) {
                DoLog(RT_String("ConvertAudioTo24bit() # Matching to required AudioBits"))
                ConvertAudioTo24bit()
            } else if(G_BITS==32) {
                DoLog(RT_String("ConvertAudioTo32bit() # Matching to required AudioBits"))
                ConvertAudioTo32bit()
            }
        }
        if(HasAudio() && G_SAMPLERATE != AudioRate) {
            DoLog(RT_String("ResampleAudio(%d) # Match to required Audio SampleRate",G_SAMPLERATE))
            ResampleAudio(G_SAMPLERATE)
        }
        if(HasAudio() && G_NORMALIZE && !IsSilent) {
            DoLog(RT_String("Normalize(0.98)"))
            Normalize(0.98)
            RT_DebugF("NORMALIZING AUDIO",name=myName)
        }
    } Else {
        RT_DebugF("Has No Audio",name=myName)
    }
I usually only bother with stereo, and have had no problems that I'm aware of.

EDIT: It may have come from VideoHelp forum.

EDIT: Was added before Avs+ native logging thingy.
Code:
Function DoLog(string s) { G_LOGNAME!="" ? RT_WriteFile(G_LOGNAME,"%s",s,Append=True) : NOP }
EDIT: From Wiki, http://avisynth.nl/index.php/SSRC
Quote:
Unlike ResampleAudio, SSRC doesn't work for arbitrary sample rate ratios. If it cannot handle resampling between the two sample rates, an error is raised.
IanB once said something like, "ResampleAudio was refactored and is now almost as good as SSRC()."
I dont bother with SSRC() due to above IanB remark, and avoid the occasional SSRC() problem. (I guess a first try/catch on SSRC() might be better)
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 24th April 2023 at 17:04.
StainlessS is offline   Reply With Quote
Old 25th April 2023, 19:42   #5  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
Thanks to you too StainlessS. The things that manolito has posted meet my needs. Small and handy.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 26th April 2023, 01:51   #6  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Here i got from Megui
Code:
---[NoImage] c6_stereo(ConvertAudioToFloat(last))
---[NoImage] Normalize()
---[NoImage] return last
---[NoImage] # 5.1 Channels L,R,C,LFE,SL,SR -> stereo + LFE
---[NoImage] function c6_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      lf = GetChannel(a, 4)
---[NoImage]      sl = GetChannel(a, 5)
---[NoImage]      sr = GetChannel(a, 6)
---[NoImage]      fl_sl = MixAudio(fl, sl, 0.2929, 0.2929)
---[NoImage]      fr_sr = MixAudio(fr, sr, 0.2929, 0.2929)
---[NoImage]      fc_lf = MixAudio(fc, lf, 0.2071, 0.2071)
---[NoImage]      l = MixAudio(fl_sl, fc_lf, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_sr, fc_lf, 1.0, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,C,SL,SR or L,R,LFE,SL,SR-> Stereo
---[NoImage] function c5_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      sl = GetChannel(a, 4)
---[NoImage]      sr = GetChannel(a, 5)
---[NoImage]      fl_sl = MixAudio(fl, sl, 0.3694, 0.3694)
---[NoImage]      fr_sr = MixAudio(fr, sr, 0.3694, 0.3694)
---[NoImage]      l = MixAudio(fl_sl, fc, 1.0, 0.2612)
---[NoImage]      r = MixAudio(fr_sr, fc, 1.0, 0.2612)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,C,LFE,S -> Stereo
---[NoImage] function c52_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      lf = GetChannel(a, 4)
---[NoImage]      bc = GetChannel(a, 5)
---[NoImage]      fl_bc = MixAudio(fl, bc, 0.3205, 0.2265)
---[NoImage]      fr_bc = MixAudio(fr, bc, 0.3205, 0.2265)
---[NoImage]      fc_lf = MixAudio(fc, lf, 0.2265, 0.2265)
---[NoImage]      l = MixAudio(fl_bc, fc_lf, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_bc, fc_lf, 1.0, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels Quadro L,R,SL,SR -> Stereo
---[NoImage] function c4_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      sl = GetChannel(a, 3)
---[NoImage]      sr = GetChannel(a, 4)
---[NoImage]      l = MixAudio(fl, sl, 0.5, 0.5)
---[NoImage]      r = MixAudio(fr, sr, 0.5, 0.5)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels L,R,C,LFE or L,R,S,LFE or L,R,C,S -> Stereo
---[NoImage] function c42_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      lf = GetChannel(a, 4)
---[NoImage]      fc_lf = MixAudio(fc, lf, 0.2929, 0.2929)
---[NoImage]      l = MixAudio(fl, fc_lf, 0.4142, 1.0)
---[NoImage]      r = MixAudio(fr, fc_lf, 0.4142, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 3 Channels L,R,C or L,R,S or L,R,LFE -> Stereo
---[NoImage] function c3_stereo(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      l = MixAudio(fl, fc, 0.5858, 0.4142)
---[NoImage]      r = MixAudio(fr, fc, 0.5858, 0.4142)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5.1 Channels L,R,C,LFE,SL,SR -> Dolby ProLogic
---[NoImage] function c6_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      sl = GetChannel(a, 5)
---[NoImage]      sr = GetChannel(a, 6)
---[NoImage]      bc = MixAudio(sl, sr, 0.2265, 0.2265)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.3205, 0.2265)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.3205, 0.2265)
---[NoImage]      l = MixAudio(fl_fc, bc, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_fc, bc, 1.0, -1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,C,SL,SR -> Dolby ProLogic
---[NoImage] function c5_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      sl = GetChannel(a, 4)
---[NoImage]      sr = GetChannel(a, 5)
---[NoImage]      bc = MixAudio(sl, sr, 0.2265, 0.2265)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.3205, 0.2265)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.3205, 0.2265)
---[NoImage]      l = MixAudio(fl_fc, bc, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_fc, bc, 1.0, -1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,LFE,SL,SR -> Dolby ProLogic
---[NoImage] function c52_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      sl = GetChannel(a, 4)
---[NoImage]      sr = GetChannel(a, 5)
---[NoImage]      bc = MixAudio(sl, sr, 0.2929, 0.2929)
---[NoImage]      l = MixAudio(fl, bc, 0.4142, 1.0)
---[NoImage]      r = MixAudio(fr, bc, 0.4142, -1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,C,LFE,S -> Dolby ProLogic
---[NoImage] function c53_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      bc = GetChannel(a, 5)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.4142, 0.2929)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.4142, 0.2929)
---[NoImage]      l = MixAudio(fl_fc, bc, 1.0, 0.2929)
---[NoImage]      r = MixAudio(fr_fc, bc, 1.0, -0.2929)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels Quadro L,R,SL,SR -> Dolby ProLogic
---[NoImage] function c4_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      sl = GetChannel(a, 3)
---[NoImage]      sr = GetChannel(a, 4)
---[NoImage]      bc = MixAudio(sl, sr, 0.2929, 0.2929)
---[NoImage]      l = MixAudio(fl, bc, 0.4142, 1.0)
---[NoImage]      r = MixAudio(fr, bc, 0.4142, -1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels L,R,LFE,S  -> Dolby ProLogic
---[NoImage] function c42_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      bc = GetChannel(a, 4)
---[NoImage]      l = MixAudio(fl, bc, 0.5858, 0.4142)
---[NoImage]      r = MixAudio(fr, bc, 0.5858, -0.4142)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels L,R,C,S -> Dolby ProLogic
---[NoImage] function c43_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      bc = GetChannel(a, 4)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.4142, 0.2929)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.4142, 0.2929)
---[NoImage]      l = MixAudio(fl_fc, bc, 1.0, 0.2929)
---[NoImage]      r = MixAudio(fr_fc, bc, 1.0, -0.2929)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 3 Channels L,R,S  -> Dolby ProLogic
---[NoImage] function c3_dpl(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      bc = GetChannel(a, 3)
---[NoImage]      l = MixAudio(fl, bc, 0.5858, 0.4142)
---[NoImage]      r = MixAudio(fr, bc, 0.5858, -0.4142)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5.1 Channels L,R,C,LFE,SL,SR -> Dolby ProLogic II
---[NoImage] function c6_dpl2(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      sl = GetChannel(a, 5)
---[NoImage]      sr = GetChannel(a, 6)
---[NoImage]      ssl = MixAudio(sl, sr, 0.2818, 0.1627)
---[NoImage]      ssr = MixAudio(sl, sr, -0.1627, -0.2818)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.3254, 0.2301)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.3254, 0.2301)
---[NoImage]      l = MixAudio(fl_fc, ssl, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_fc, ssr, 1.0, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,C,SL,SR -> Dolby ProLogic II
---[NoImage] function c5_dpl2(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      fc = GetChannel(a, 3)
---[NoImage]      sl = GetChannel(a, 4)
---[NoImage]      sr = GetChannel(a, 5)
---[NoImage]      ssl = MixAudio(sl, sr, 0.2818, 0.1627)
---[NoImage]      ssr = MixAudio(sl, sr, -0.1627, -0.2818)
---[NoImage]      fl_fc = MixAudio(fl, fc, 0.3254, 0.2301)
---[NoImage]      fr_fc = MixAudio(fr, fc, 0.3254, 0.2301)
---[NoImage]      l = MixAudio(fl_fc, ssl, 1.0, 1.0)
---[NoImage]      r = MixAudio(fr_fc, ssr, 1.0, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 5 Channels L,R,LFE,SL,SR -> Dolby ProLogic II
---[NoImage] function c52_dpl2(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      sl = GetChannel(a, 4)
---[NoImage]      sr = GetChannel(a, 5)
---[NoImage]      ssl = MixAudio(sl, sr, 0.3714, 0.2144)
---[NoImage]      ssr = MixAudio(sl, sr, -0.2144, -0.3714)
---[NoImage]      l = MixAudio(fl, ssl, 0.4142, 1.0)
---[NoImage]      r = MixAudio(fr, ssr, 0.4142, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
---[NoImage] # 4 Channels Quadro L,R,SL,SR -> Dolby ProLogic II
---[NoImage] function c4_dpl2(clip a)
---[NoImage]   {
---[NoImage]      fl = GetChannel(a, 1)
---[NoImage]      fr = GetChannel(a, 2)
---[NoImage]      sl = GetChannel(a, 3)
---[NoImage]      sr = GetChannel(a, 4)
---[NoImage]      ssl = MixAudio(sl, sr, 0.3714, 0.2144)
---[NoImage]      ssr = MixAudio(sl, sr, -0.2144, -0.3714)
---[NoImage]      l = MixAudio(fl, ssl, 0.4142, 1.0)
---[NoImage]      r = MixAudio(fr, ssr, 0.4142, 1.0)
---[NoImage]      return MergeChannels(l, r)
---[NoImage]   }
kedautinh12 is offline   Reply With Quote
Old 26th April 2023, 02:09   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks to you too kedautinh12. The things that manolito has posted meet his needs. Small and handy.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th April 2023, 17:15   #8  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 223
Why not just use Audacity, its free?
coolgit is offline   Reply With Quote
Old 27th April 2023, 17:22   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by coolgit View Post
Why not just use Audacity, its free?
Methinks gispos intends to embed script function into AvsPMod.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 27th April 2023, 17:52   #10  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 271
Quote:
Originally Posted by coolgit View Post
Why not just use Audacity, its free?
Not at all, full of adware and spyware. No thanks.
richardpl is offline   Reply With Quote
Old 29th April 2023, 12:35   #11  |  Link
PoeBear
Registered User
 
Join Date: Jan 2017
Posts: 48
Quote:
Originally Posted by richardpl View Post
Not at all, full of adware and spyware. No thanks.
Lol, there are no ads in Audacity. And the only "spyware", is the check for updates feature, which you can literally disable on first run
PoeBear is offline   Reply With Quote
Old 29th April 2023, 18:18   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I've never seen any ads in Audacity, maybe you downloaded modded ver$ from bad (non author) site.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 29th April 2023, 23:02   #13  |  Link
writemaster
LoRD Encoder
 
Join Date: Jan 2015
Posts: 5
Do you also have a solution to make DD-EX audio with GetChannel?
writemaster is offline   Reply With Quote
Old 30th April 2023, 13:50   #14  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
I have a video with 8 channel audio and AvsPmod as well as VDub2 play channels that are firstly wrong and secondly not even selectable in PotPlayer.

I tried all indexes in LWLibavAudioSource, no index gives the right audio that the PotPlayer plays without any problems.

Enlighten me...
__________________
Live and let live
gispos is offline   Reply With Quote
Old 30th April 2023, 15:47   #15  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Can you upload a short sample?
manolito is offline   Reply With Quote
Old 30th April 2023, 18:33   #16  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
Quote:
Originally Posted by manolito View Post
Can you upload a short sample?
That is typical once again.
I tried two editing programs and MkvToolnix. After that I could play the clips with AvsPmod.

Apparently the video is not compliant enough and PotPlayer can handle it better.

But where does the channel come from that I can't select in PotPlayer but VDub2 and AvsPmod play.

Doesn't matter now, I will remux the video.

Edit:
What amazes me, I can play the video without audio dropouts with 'Resize Filter;Prefetch(1), VDub2 doesn't manage that without jerking.
Normally VDub2 is faster with 4K videos than AvsPmod.
Wrong world.
__________________
Live and let live

Last edited by gispos; 30th April 2023 at 18:47.
gispos is offline   Reply With Quote
Old 30th April 2023, 18:38   #17  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Hi @gispos, can AVSPmod only encode audio without video?? If had, how to do that?
kedautinh12 is offline   Reply With Quote
Old 30th April 2023, 18:49   #18  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
No, and I don't think that will come from my side. But never say never.
__________________
Live and let live
gispos is offline   Reply With Quote
Old 1st May 2023, 05:21   #19  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Ok, Megui have that, i still use Megui
kedautinh12 is offline   Reply With Quote
Old 1st May 2023, 10:07   #20  |  Link
gispos
Registered User
 
Join Date: Oct 2018
Location: Germany
Posts: 999
Then all is well. You are like a flag in the wind...
__________________
Live and let live
gispos is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.