Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MixAudio() produces stitches #25

Open
keytouch opened this issue Feb 20, 2019 · 11 comments
Open

MixAudio() produces stitches #25

keytouch opened this issue Feb 20, 2019 · 11 comments

Comments

@keytouch
Copy link

keytouch commented Feb 20, 2019

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
Copy link
Author

keytouch commented Feb 20, 2019

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

@pinterf
Copy link
Owner

pinterf commented Feb 20, 2019

Hi, x86 or x64?

@keytouch
Copy link
Author

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

@keytouch
Copy link
Author

keytouch commented Feb 20, 2019

It's the same behaviour on x64.

@pinterf
Copy link
Owner

pinterf commented Feb 20, 2019

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

@keytouch
Copy link
Author

keytouch commented Feb 20, 2019

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
Copy link
Author

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

@keytouch
Copy link
Author

keytouch commented Feb 20, 2019

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
Copy link
Author

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

@keytouch
Copy link
Author

keytouch commented Feb 20, 2019

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
Copy link
Author

keytouch commented Feb 20, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants