pc_speak
10th May 2007, 02:28
Hello again journstyx.
When you install Excel, .xls files are associated with Excel automatically.
When you install Adobe Reader, .pdf files are associated with Adobe Reader automatically.
When you install Avisynth, .avs files are associated with Avisynth automatically.
Avisynth is a frameserver. Avisynth serves up 1 frame at a time to the program (Aften.exe)for processing. The work done by Avisynth is all done in the background. Nothing shows on the screen. Avisynth reads the .avs script and performs the commands contained therein. It then passes the output to the relevant program.
Example: You create, in notepad, fixsize.avs script with the following lines.
--------------------------------------------------------------------------------
AVISource("d:\work\video.avi") # This is the input file.
lanczosresize(680,440) # Please resize the first frame to this size.
addborders(20,20,20,20) # Add some black borders. I want the frame letterboxed.
info() # Show me the details of the video stream
--------------------------------------------------------------------------------
The frame is then passed to aften.exe for further processing.
Avisynth then process the second frame.
lanczosresize(680,440) # Please resize the second frame to this size.
addborders(20,20,20,20) # Add some black borders. I want the frame letterboxed.
info() # Show me the details of the video stream
The frame is then passed to aften.exe for further processing.
Avisynth then process the third frame.
etc. etc. etc until the the end of the input file is reached.
There is no outward sign of the actual processing.
If you want to get a better idea, create the script file above. Make sure the path to the AVIsource points to an avi video file on your PC.
Download and install VirtualDub-1.6.17.zip (http://prdownloads.sourceforge.net/virtualdub/VirtualDub-1.6.17.zip?download).
Do a File/Open in virtualdub and open the script file. You will see the changes to your video.
Remove the line: info() from the script file and reopen it. Now no details on the AVI stream are shown.
journstyx
10th May 2007, 08:09
Hi PC Speak, Tebasuna 51,
OK, I'm now getting a slightly better idea of how this works.
Now, please bare with me as I seem to be slowly learning this.
So when I launch bepipe.exe I get a quick black box apperance and that's it.
How do I get my created avisynth script "imported" in there as described by Tebasuna 51 below?
Then it automatically passes the output to Aften?
Where is the file eventually located and how do I then listen to it and create a CD out of this?
Again I appreciate your patience and guidance here. I would really like to know how this works and youe help is greatly appreciated.
Best regards,
Journstyx
tebasuna51
10th May 2007, 13:29
How do I get my created avisynth script "imported" in there as described by Tebasuna 51 below?
Then it automatically passes the output to Aften?
Where is the file eventually located and how do I then listen to it and create a CD out of this?
Maybe there are two concepts here to understand:
1) AviSynth like frameserver, explained by pc_speak.
2) 'Pipe' commands provided by the Operating System.
I think the better way to explain it is with examples:
A easy sample, when execute:
bepipe --script "NicAc3Source(^your.ac3^)" > decoded.wav
AviSynth is called only to execute a decoder over the file "your.ac3" and the decompressed audio is send to STDOUT, a buffer provided by the SO, then the pipe command '>' take the STDOUT buffer and write a file decoded.wav.
One more complex:
bepipe --script "NicAc3Source(^your.ac3^)" | Lame -b 128 - recoded.mp3
Here the pipe command '|' take the STDOUT buffer and send the info to the STDIN buffer of the next program: Lame.
Lame, instructed by the parameter '-', take the input from STDIN instead from a regular file. We can recode from ac3 to mp3 without intermediate big decompressed wav files.
Next more complex:
bepipe --script "NicAc3Source(^your.ac3^).Normalize()" | Lame -b 128 - recoded.mp3
We can put many AviSynth commands inside the --script parameter, but if we need a more complex command sequence is more clear use the AviSynth command Import("your.avs"). And we have:
bepipe --script "Import(^your.avs^)" | Lame -b 128 - recoded.mp3
You can see the Bepipe syntax replacing the " with ^ inside the --script parameter.
Now we have a folder with:
Aften.exe
Bepipe.exe
stereo.ac3
your.avs
and your.avs is:
a = NicAc3Source("stereo.ac3")
la = GetLeftChannel(a)
ra = GetRightChannel(a)
back = a.soxfilter("filter 100-7000")
fl = mixaudio(la, ra, 1.0, -0.1875)
fr = mixaudio(la, ra, -0.1875, 1.0)
cc = mixaudio(la, ra, 0.375,0.375)
lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.5")
sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.668,-0.668)
sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.668,-0.668)
sl = DelayAudio(sl,0.02)
sr = DelayAudio(sr,0.02)
MergeChannels( fl, fr, cc, lfe, sl, sr)
Normalize()
When you execute:
bepipe --script "Import(^your.avs^)" | aften.exe - stereo-Upmixed.ac3
You must obtain a new 5.1 ac3 file named stereo-Upmixed.ac3
What ac3upmix.cmd do?: make an avs file for each ac3 in folder and execute bepipe to obtain a xxx-Upmixed.ac3. After execute ac3upmix you can delete all .avs and move the .ac3 to others folders before execute another time ac3upmix.cmd
journstyx
21st May 2007, 00:41
Hi guys,
Well, guess what? Using PC speak's earlier zip file I created an
ac3 upmix, installed Media Classic Player, adjusted the settings of the player and was able to listen to the track in 5.1.
The only thing now left is how to change the settings for each
channel.
PC Speak mentioned adjusting them in notepad? Correct? I need to figure out how to do that, as I seem to be getting the same output from LS and RS as FL and FR.
Thanks
Journstyx
dannybz
14th December 2009, 01:44
Surround Left, Surround Right For Adobe Audition (Recommended)
Open your Stereo file, and go to Effects, Filters, Center Channel Extractor
For the Surrounds I use this setting (http://members.aol.com/surroundfiles/images/c2.jpg)
This not only removes the center channel but it also gives you a stereo reproduction in the sound which isn't possible with Cool Edit's "Vocal Cut" Preset. This also makes it much easier to single out any certain sounds you may want to be portrayed in your mix. You can then adjust the levels using the amplitude function to decide how loud or low you want the surrounds in the mix. After this you simply use the same method used to produce the Front Left and Front Right Channels (Explained Above)
Can you please explain the settings for the surrounds. The page is not longer available. Thanks
dannybz
15th December 2009, 03:31
Thanks for the post raquete. I will give it a try. Im trying to encode an avi with surround sound... Does this mean the sound will be close to 5.1 Dolby Digital??
My past encodings have all been stereo and the programs I have are Adobe Audition, BeLight, BeSweet, GraphEdit, Hypercube Trascoder, CCE Encoder, AviSynth and Spruce DVD Maestro. I am not expert in using them but I know quite the basics of each. I am hoping to find a very straight forward guide to converting stereo to surround, converting to AC3 then encoding to DVD.... without the hassle of buying subsidiary programs.
Jenyok
8th April 2013, 06:27
Algorithm to convert stereo to 5.1 audio.
.
#
# Algorithm to convert real stereo audio clip to 5.1 audio clip
#
# Input audio clip must be minimum 96 kHz / 24 bits integer real stereo audio clip
#
# All Temporary variables of audio clip in algorithm must be 32 bits integer stereo or mono audio clip
#
# All Output audio clips must be 24 bits integer mono audio clips
#
Input # Input must be stereo audio signal 96 kHz / 24 bits
Input = Normalize(Input, 1.0) # Normalize audio signal Input to +0dB
LR = Normalize(Input, 0.251) # Normalize audio signal LR to -12dB, stereo
LR = ConvertAudioTo32bit(LR) # Resolution LR 32bits, -12dB, stereo
LRm = FFT_HighPass_Filter(LR, 200) # FAST FOURIER TRANSFORM High Pass Filter "/----" 200Hz to LRm, -12dB, stereo
LRm = ConvertAudioTo32bit(LRm) # Resolution LRm 32 bits, -12dB, stereo
# Subwoofer channel
#
LFE = MixAudio(LR, LRm, 1.0, -1.0) # LFE = LR - LRm, 32 bits, stereo
# or maybe so or together two lines
#LFE = FFT_LowPass_Filter(LR, 200) # FAST FOURIER TRANSFORM Low Pass Filter "----\" 200Hz to LFE, -12dB, stereo
LFE = ConvertAudioTo32bit(LFE) # Resolution LFE 32 bits, -12dB, stereo
LFE = AmplifyDB(LFE, +9) # Amplify relative audio signal LFE on +9dB (-12dB +9dB), 32 bits, stereo
LFEl = GetChannels(LFE, 1) # Get left audio channel from audio signal LFE, 32 bits, stereo
LFEl = ConvertToMono(LFEl) # Convert audio signal LFEl, 32 bits, mono
LFEr = GetChannels(LFE, 2) # Get right audio channel from audio signal LFE, 32 bits, stereo
LFEr = ConvertToMono(LFEr) # Convert audio signal LFEr, 32 bits, mono
LFE = MixAudio(LFEl, LFEr, 0.5, 0.5) # LFE = LFEl + LFEr, 32 bits, stereo
LFE = ConvertToMono(LFE) # Convert audio signal LFE, 32 bits, mono
LFE = SHIFTPHASE(LFE, +90, 200) # Shift LFE phase audio signal to +90 grad, frequency 200Hz, 32 bits, mono
LFE = ConvertAudioTo24bit(LFE) # Resolution LFE 24 bits, mono
# Central channel
#
C = Normalize(LRm, 0.707) # Normalize audio signal C to -3dB, 32 bits, stereo
C = ConvertAudioTo32bit(C) # Resolution C 32 bits, -3dB, stereo
Cl = GetChhanel(C, 1) # Get left audio channel from audio signal C, 32 bits, stereo
Cl = ConvertToMono(Cl) # Convert audio signal Cl, 32 bits, mono
Cr = GetChhanel(C, 2) # Get right audio channel from audio signal C, 32 bits, stereo
Cr = ConvertToMono(Cr) # Convert audio signal Cr, 32 bits, mono
C = MixAudio(Cl, Cr, 0.5, 0.5) # C = 0.707 * Cl + 0.707 * Cr, 32 bits, mono
C = ConvertToMono(C) # Convert audio signal C, 32 bits, mono
C = AmplifyDB(C, +3) # Amplify relative audio signal C on +3dB, 32 bits, mono
C = ConvertAudioTo24bit(C) # Resolution C 24 bits, mono
# Front channels preliminary
#
Lc = GetChhanel(LRm, 1) # Get left audio channel from audio signal LRm, -12dB, 32 bits, stereo
Lc = ConvertToMono(Lc) # Convert audio signal Lc, -12dB, 32 bits, mono
Rc = GetChhanel(LRm, 2) # Get right audio channel from audio signal LRm, -12dB, 32 bits, stereo
Rc = ConvertToMono(Rc) # Convert audio signal Rc, -12dB, 32 bits, mono
NLc1 = MixAudio(Lc, Rc, 0.99, -0.33) # NLc1 = 1.5 * Lc - 0.5 * Rc, 32 bits, mono
NRc1 = MixAudio(Rc, Lc, 0.99, -0.33) # NRc1 = 1.5 * Rc - 0.5 * Lc, 32 bits, mono
LfRf = MergeChannels(NLc1, NRc1) # Merge channels NLc1, NRc1 to stereo singal LfRf, 32 bits, stereo
LfRf = ConvertAudioTo32bit(LfRf) # Resolution LfRf 32 bits, -3dB, stereo
LfRf = AmplifyDB(LfRf, +3.61) # Amplify relative audio signal LfRf on +3.61dB, 32 bits, stereo
# Rear channels
#
LRm_reverb = REVERB(LRm, "Concert Hall Light") # Reverberation "Concert Hall Light, No combine source Left and Right", 32 bits stereo
LRm_reverb = ConvertAudioTo32bit(LRm_reverb) # Resolution LRm_reverb 32 bits, stereo
LRm_reverb = MixAudio(LRm_reverb, LRm, 1.0, -1.0) # LRm_reverb = LRm_reverb - LRm, 32 bits, stereo
LRm_reverb = AmplifyDB(LRm_reverb, +6) # Amplify relative audio signal LRm_reverb on +6dB, 32 bits, stereo
Ls = GetChhanel(LRm_reverb, 1) # Get left audio channel from audio signal LRm_reverb, 32 bits, stereo
Ls = ConvertToMono(Ls) # Convert audio signal Ls, 32 bits, mono
Ls = ConvertAudioTo24bit(Ls) # Resolution Ls 24 bits, mono
Rs = GetChhanel(LRm_reverb, 2) # Get right audio channel from audio signal LRm_reverb, 32 bits, stereo
Rs = ConvertToMono(Rs) # Convert audio signal Rs, 32 bits, mono
Rs = ConvertAudioTo24bit(Rs) # Resolution Rs 24 bits, mono
# Front channels
#
LfRf = MixAudio(LfRf, LRm_reverb, 1.0, -1.0) # LfRf = LfRf - LRm_reverb, 32 bits, stereo
Lf = GetChhanel(LfRf, 1) # Get left audio channel from audio signal LfRf, 32 bits, stereo
Lf = ConvertToMono(Lf) # Convert audio signal Lf, 32 bits, mono
Lf = ConvertAudioTo24bit(Lf) # Resolution Lf 24 bits, mono
Rf = GetChhanel(LfRf, 2) # Get right audio channel from audio signal LfRf, 32 bits, stereo
Rf = ConvertToMono(Rf) # Convert audio signal Rf, 32 bits, mono
Rf = ConvertAudioTo24bit(Rf) # Resolution Rf 24 bits, mono
# Output audio clip 5.1
#
Sound51 = MergeChannels(Lf, Rf, C, LFE, Ls, Rs) # 5.1 audio clip LPCM, MLP, 24 bits
# In case of standard coefficients of Downmix matrix from the channels Lf, Rf, C, LFE, Ls, Rs received here,
# initial stereo signal shall be recovered with a margin error less than 1%, and
# this 1% percent has nothing in common with non-linear distortions, and
# represents only crosstalk attenuations between channels (in the terms DIN 45500).
.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.