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 18th February 2015, 11:53   #1  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
TimeStretch tempo on Multi-channel audio

Hi, I am using TimeStretch tempo on a Quicktime file which has multichannel audio (10 channels) but am having some issues.

Source file is a Quicktime Prores, 1920x1080, 23.98, 10 channels of 24 bit PCM. So I am converting from 23.98 HD to 25 SD keeping the audio pitch.
This is the avs script I am using:

Code:
QTInput("Prores_10_Channel_Audio.mov", quality=100, audio=2)
ColorMatrix(mode="Rec.709->Rec.601", clamp=0)
Spline64Resize(720, 576)
TimeStretch(tempo = 25.0/(24000.0/1001.0)*100.0)
AssumeFPS(25, 1)
The output file has lots of 'phasing' between the channels, for example, if I just listen, and look, at the Stereo left and right, there is a slight difference where the TimeStretch tempo has 'cut n shut' the audio, this is understandable, but not a nice effect. Is there a way to apply TimeStretch tempo to all channels as a whole, not individually, thus hopefully eliminating the 'phasing' effect?
Or is there a better way to 'stretch' the audio, with a different plugin maybe?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 18th February 2015, 19:30   #2  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
The output file has lots of 'phasing' between the channels, for example, if I just listen, and look, at the Stereo left and right, there is a slight difference where the TimeStretch tempo has 'cut n shut' the audio, this is understandable, but not a nice effect. Is there a way to apply TimeStretch tempo to all channels as a whole, not individually, thus hopefully eliminating the 'phasing' effect?
No there isn't. You will get this problem with multichannel audio (just stereo should work fine). See: http://forum.doom9.org/showthread.php?t=71632
I think the current sources are based on SoundTouch 1.4.0. There are a lot of improvements since that time, so it will be worthwhile to update the library. However in the changelog of the library I see nothing about multichannel, so i can't tell whether they fixed it or not.

You can always ask them and report back to us

edit: sounds like that added it a year ago. Will try to update the library when I have some time ...

Last edited by Wilbert; 18th February 2015 at 19:39.
Wilbert is offline   Reply With Quote
Old 18th February 2015, 21:22   #3  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Thanks for your reply, nice to know it has been fixed. Is there anyway I can use the latest version of SoundTouch now with Avisynth? I see they have a SoundTouch DLL library 1.8.1 for Windows, can I put the SoundTouch.dll in the Avisynth plugins folder and use?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 19th February 2015, 21:39   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
No, that won't work. It links statically with soundtouch.lib. So i need to update the library and header file and recompile AviSynth. Perhaps it is better to make a plugin out of it.
Wilbert is offline   Reply With Quote
Old 19th February 2015, 21:47   #5  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Hi Wilbert, thanks for your reply. Sorry to ask, but would you be updating the library and header file and recompiling AviSynth soon? Im itching to try out this with my avisynth scripts?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 22nd February 2015, 00:05   #6  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Please try and report your findings: http://www.wilbertdijkhof.com/avisyn...ouch_1.8.0.zip
Wilbert is offline   Reply With Quote
Old 22nd February 2015, 02:31   #7  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
I tried the new Avisynth with a few samples and listened to the TimeStretched version after downmixing to mono on playback, and aside from the speed difference I can't pick the timestretched version from the original. I don't have a very good sound system but so far the obvious phasing seems to be gone. Thank you.

The only downside for me is MeGUI uses Avisynth+ by default and that requires a separate TimeStretch.dll plugin. Is Avisynth+ still being developed or is it pretty much dead?

Now I wonder if someone will update the foobar2000 SoundTouch plugin. The current version only works with stereo audio (for obvious reasons) but it's also only accurate to two decimal places (time stretching specified as a percentage) and even then I don't think it's particularly accurate anyway. I guess I can only dream......
hello_hello is offline   Reply With Quote
Old 22nd February 2015, 08:52   #8  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
Please try and report your findings: http://www.wilbertdijkhof.com/avisyn...ouch_1.8.0.zip
Wilbert, you're a star! Many thanks for taking the time to do this.
I will report back once I've run some tests.

Kind regards.
speedyrazor is offline   Reply With Quote
Old 22nd February 2015, 10:57   #9  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Anyone know how SoX handles the multi-channel scenario?
sneaker_ger is offline   Reply With Quote
Old 28th February 2015, 15:37   #10  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
Please try and report your findings: http://www.wilbertdijkhof.com/avisyn...ouch_1.8.0.zip
Hi Wilbert, it works a treat! Many thanks for taking the time to re-compile this. I don't suspect it is, but thought I would ask, is this the MT version?

Kind regards.

Last edited by speedyrazor; 28th February 2015 at 15:48.
speedyrazor is offline   Reply With Quote
Old 28th February 2015, 16:43   #11  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
That's great to hear!
Quote:
I don't suspect it is, but thought I would ask, is this the MT version?
No it isn't. It's based on the regular RC1. I will include the modified sources tomorrow.
Wilbert is offline   Reply With Quote
Old 28th February 2015, 17:28   #12  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Hi Wilbert, will this be in the official RC2?
speedyrazor is offline   Reply With Quote
Old 11th March 2015, 07:35   #13  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
That's great to hear!

No it isn't. It's based on the regular RC1. I will include the modified sources tomorrow.
Hi Wilbert, any news on this, you did an excellent job, your dll works a treat on multichannel audio. Can this be 'plugged' into the next official release?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 29th April 2015, 21:46   #14  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Hi, any news on the SoundTouch Library 1.8 getting into the main 2.6 and MT versions please?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 29th April 2015, 22:04   #15  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
http://forum.doom9.org/showthread.ph...12#post1719412
Wilbert is offline   Reply With Quote
Old 29th April 2015, 22:12   #16  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
Wilbert, that would be amazing to get a plugin to do this, I can't wait.
sorry to ask, but is this something you're planning on doing soon?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 29th April 2015, 22:19   #17  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
I hope to get a version within a few weeks.
Wilbert is offline   Reply With Quote
Old 29th April 2015, 22:21   #18  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
I hope to get a version within a few weeks.
Great, I will keep an eye out for it.
speedyrazor is offline   Reply With Quote
Old 10th May 2015, 14:49   #19  |  Link
speedyrazor
Registered User
 
Join Date: Mar 2003
Posts: 194
Quote:
Originally Posted by Wilbert View Post
I hope to get a version within a few weeks.
Hi Wilbert, hows it going with the plugin?

Kind regards.
speedyrazor is offline   Reply With Quote
Old 16th May 2015, 17:02   #20  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
link: http://www.wilbertdijkhof.com/TimeStretch_v258.zip

license: gpl

documentation: http://avisynth.nl/index.php/TimeStretch

changelog:
* version: 2.5.8.0 (requires at least AviSynth v2.58)
* filter is named to TimeStretchPlugin
* multichannel support
* updated SoundTouch library to 1.8.0

usage:
Code:
LoadPlugin("D:\AviSynth\Plugins\TimeStretch\Release\TimeStretch.dll")
v = BlankClip()
a = NicMPG123Source("D:\AviSynth\Plugins\TimeStretch\sample_orig.mp3", false)
c = audiodub(v,a)
c.TimeStretchPlugin(pitch=100*pow(2.0, 3.0/12.0))
Let me know if you find something. I cleaned the code up a bit, but it should behave the same (except that it will return an error if there is no audio in the clip).
Wilbert 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 06:48.


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