AviSynthPlus icon indicating copy to clipboard operation
AviSynthPlus copied to clipboard

MixAudio() produces stitches

Open keytouch opened this issue 6 years ago • 11 comments

MixAudio() produces stitches. When using MeGUI's downmix function

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) }

It produces stitches. Additionally, the process speed is much lower than using official avs2.6 when MixAudio() is engaged. Here's the file that can reproduce the issue without difficulty. test.zip When using official avs2.6, I tried to find anything wrong, but it works well.

keytouch avatar Feb 20 '19 10:02 keytouch

Besides, Output using megui's wrapper produces much more stitches than using avs2pipemod

keytouch avatar Feb 20 '19 11:02 keytouch

Hi, x86 or x64?

pinterf avatar Feb 20 '19 13:02 pinterf

It was on x86, I will have a test on x64 now.

keytouch avatar Feb 20 '19 13:02 keytouch

It's the same behaviour on x64.

keytouch avatar Feb 20 '19 13:02 keytouch

-what is the speed difference you encounter (cacheing - if any - I suppose is totally different between classic and avs+) -what's your avspipemod commandline (to test similarly) My script now: 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) }

a=FFAudioSource("original_dts-hd.dts") v=BlankClip(length=10000000) AudioDub(v,c6_stereo(a))#.Info()

pinterf avatar Feb 20 '19 13:02 pinterf

Weirder now, with,

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) } a=FFAudioSource("original_dts-hd.dts") v=BlankClip(length=10000000) AudioDub(v,c6_stereo(a))#.Info()

It's good, AND speed is normal. HOWEVER, with,

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) } a=LWLibavAudioSource("original_dts-hd.dts") v=BlankClip(length=10000000) AudioDub(v,c6_stereo(a))#.Info()

It comes again, with slow speed.

keytouch avatar Feb 20 '19 14:02 keytouch

I will first investigate a bit into bit comparison of ff and lsmash alone for sake of consistency.

keytouch avatar Feb 20 '19 14:02 keytouch

All tracks decoded fine, no differences found.

Comparing: "C:\Users\\Desktop\test_alone_ff.flac" "C:\Users\\Desktop\test_alone_lm.flac" Compared 3081216 samples. No differences in decoded data found. Channel peaks: 0.0781555 0.1070557 0.2019653 0.0453491 0.0375061 0.0741272

Total duration processed: 1:04.192 Time elapsed: 0:00.698 91.98x realtime

keytouch avatar Feb 20 '19 14:02 keytouch

The above result is performed without any mixdown or process other than source filter.

keytouch avatar Feb 20 '19 14:02 keytouch

avs2pipemod.exe -wav test.avs > testout.wav same behaviour as directly inputting avs in megui.

FFAudioSource() == LWLibavAudioSource() == GOOD FFAudioSource() + c6_stereo() != LWLibavAudioSource() + c6_stereo() FFAudioSource() + c6_stereo() == GOOD

keytouch avatar Feb 20 '19 14:02 keytouch

avs2pipemod test batch test1.zip ff_stereo.wav and lw_stereo.wav won't match. ff.wav and lw.wav match.

keytouch avatar Feb 20 '19 15:02 keytouch