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 12th April 2024, 13:28   #1  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,903
Multichannel 5.1 speed up + pitch adjustment

Hi there,
I have a 24p movie that I'm trying to speed up by 4% and pitch adjust so that it's gonna be 25p.
This is not something new as I've been doing it other times for stereo contents by using TimeStretch().

For stereo contents, to avoid having the left and right channels go out of phase and generate flanger effect (i.e the audio oscillating constantly from left to right) I use MergeChannels() before calling TimeStretch() so that both channels are processed together and timestretch is aware of it so that it doesn't make them out of phase.

In other words:

Code:
#Indexing 24p video & audio
video=LWLibavVideoSource("M11340.m2v")
Left=WAVSource("M11340_Left.wav")
Right=WAVSource("M11340_Right.wav")
audio=MergeChannels(Left, Right)
AudioDub(video, audio)

#Speed up + pitch adjustment 4% 48000Hz
ConvertAudioToFloat()
AssumeFPS(25, 1, false)
TimeStretch(tempo=100.0*25.0/(24000.0/1000.0))
SSRC(48000)
ConvertAudioTo24bit()

So far so good, but the question is: what happens with 5.1?
Can I just do:

Code:
#Indexing 24p video & audio
video=LWLibavVideoSource("M11340.m2v")
FL=WAVSource("M11340_01.wav")
FR=WAVSource("M11340_02.wav")
CC=WAVSource("M11340_03.wav")
LFE=WAVSource("M11340_04.wav")
LS=WAVSource("M11340_05.wav")
RS=WAVSource("M11340_06.wav")
audio=MergeChannels(FL, FR, CC, LFE, LS, RS)
AudioDub(video, audio)

#Speed up + pitch adjustment 4% 48000Hz
ConvertAudioToFloat()
AssumeFPS(25, 1, false)
TimeStretch(tempo=100.0*25.0/(24000.0/1000.0))
SSRC(48000)
ConvertAudioTo24bit()
and call it a day?
And if so, what is TimeStretch() actually doing with the 5.1? Do I have to specify the audio layout in the frame properties? Is it gonna know that it's a 5.1 or is it only gonna process the stream as 3 stereo pairs (i.e FL FR // CC, LFE // LS, RS)?

Last but not least, given that the output PCM 24bit 48000Hz audio file muxed as RF64 .wav is gonna be fed to a DolbyE encoder (Dolby DP600) which needs the 5.1+2.0, do I have to filter them separately 'cause otherwise TimeStretch() is gonna make a boo boo or can I just do something like:


Code:
#Indexing 24p video & audio
video=LWLibavVideoSource("M11340.m2v")
FL=WAVSource("M11340_01.wav")
FR=WAVSource("M11340_02.wav")
CC=WAVSource("M11340_03.wav")
LFE=WAVSource("M11340_04.wav")
LS=WAVSource("M11340_05.wav")
RS=WAVSource("M11340_06.wav")
Left=WAVSource("M11340_Left.wav")
Right=WAVSource("M11340_Right.wav")
audio=MergeChannels(FL, FR, CC, LFE, LS, RS, Left, Right)
AudioDub(video, audio)

#Speed up + pitch adjustment 4% 48000Hz
ConvertAudioToFloat()
AssumeFPS(25, 1, false)
TimeStretch(tempo=100.0*25.0/(24000.0/1000.0))
SSRC(48000)
ConvertAudioTo24bit()


Thank you in advance.
I'm currently trying to test stuff but I don't really trust my ears, you know...
FranceBB is offline   Reply With Quote
Old 12th April 2024, 16:50   #2  |  Link
coolgit
Registered User
 
Join Date: Apr 2019
Posts: 223
Try Audacity as other people have said it will speed up properly without pitch blah blah.
coolgit is offline   Reply With Quote
Old 12th April 2024, 19:26   #3  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,903
To be fair, the point isn't to try other things manually but rather to know whether I should correct my AVS Script or not, 'cause most of the time those would be part of a completely automatized workflow in FFAStrans, so... yeah... I kinda need to know.
Also, I'm extremely curious about the inner working of TimeStretch() and the SoundTouch library.
FranceBB is offline   Reply With Quote
Old 13th April 2024, 09:38   #4  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
I thought the TimeStretch multichannel issues had been fixed. Is there still a phasing problem?
https://forum.doom9.org/showpost.php...2&postcount=20

The SoundTouch changelog says multichannel support was added to version 1.8.0, which was a fair while ago.
http://www.surina.net/soundtouch/README.html
hello_hello is offline   Reply With Quote
Old 13th April 2024, 10:36   #5  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
In the readme of Avs+:
- Updated: TimeStretch plugin with SoundTouch 2.1.3 (as of 07.Jan 2019)

But I don't know if work fine with 5.1+2.0
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 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 01:33.


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