INDEX  F.A.Q.  SEARCH  LATEST POSTS     Rules  Register  Profile  Private messages  Login


Search all forums or this forum: Advanced search
Yet Another Script - 2.0 to 5.1 Upmixer

Forum Index -> Video -> Audio Printer-friendly version
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Reply to topic
Author Message
Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Aug 31, 2007 11:25 Posts Comp View users profile Send private message Reply with quote

Turn off your Windows firewall for a moment. Here's a second copy, zipped instead of rared.

http://www.savefile.com/files/1018839


Last edited by Soopafresh on Aug 31, 2007 11:38, edited 1 time in total


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

Post Posted: Aug 31, 2007 11:32 Posts Comp View users profile Send private message Reply with quote

chrishallowell wrote:
Hi,
Where can I get my hands on the entire lastest version?

I tried every link in this thread and I keep getting CRC errors when trying to extract the files.

Thanks,
Chris



What does the trazode does ??


chrishallowell
Member


Joined: 22 Aug 2007
Location: United States

Post Posted: Aug 31, 2007 12:03 Posts Comp View users profile Send private message Reply with quote

Thanks Soopafresh! That one worked.

-Chris


chrishallowell
Member


Joined: 22 Aug 2007
Location: United States

Post Posted: Aug 31, 2007 12:17 Posts Comp View users profile Send private message Reply with quote

1 last question...

Can this handle AC3 or WAV input sound files or do they need to be mp3?
If they need to be mp3, then how do I convert wav(or AC3) to mp3?

Right now I have both a stereo AC3 and a stereo WAV. (I used audacity)
Thanks,
Chris


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Aug 31, 2007 12:22 Posts Comp View users profile Send private message Reply with quote

Start with renaming your .WAV file to .MP3 . Dunno if it'll work, but give it a shot. If that doesn't work, load the WAV back into audacity and "export as mp3", 320kbs

j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Aug 31, 2007 21:12 Posts Comp View users profile Send private message Reply with quote

chrishallowell wrote:
1 last question...

Can this handle AC3 or WAV input sound files or do they need to be mp3?
If they need to be mp3, then how do I convert wav(or AC3) to mp3?

Right now I have both a stereo AC3 and a stereo WAV. (I used audacity)
Thanks,
Chris


The last batch file I posted will do *.wav 2.0 to AC3 5.1.

The BassAudio v1.6 library used in the upmix.avs script dosn't support AC3 2.0 input and always
outputs 5.1 which the script refuses(bug).
My way around this is to use a custom batch and script with nicaudio.dll inplace of bassaudio.dll.

DirectShowSource requires decoders to always be set to 2.0 output to work properly so I'm trying to avoid just having the 1 set of scripts using DirectShowSource.

I have made custom scripts with nicaudio.dll to only handle *.ac3 2.0 to 5.1.
I can modify them for the default directory structure and post them later.


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Aug 31, 2007 21:32 Posts Comp View users profile Send private message Reply with quote

j4gg3rr - make sure you've got the latest version of Nicaudio.dll

http://nic.dnsalias.com/NicAudio.zip


j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Sep 01, 2007 05:02 Posts Comp View users profile Send private message Reply with quote

Soopafresh wrote:
j4gg3rr - make sure you've got the latest version of Nicaudio.dll

http://nic.dnsalias.com/NicAudio.zip


Done thanks!!
Anyone wanting to use these scripts for multiple *.ac3 2.0 to *.ac3 5.1 must also have nicaudio.dll located in the Upmixer folder.

Just like the main AVI scripts, this one will finish with the original *.ac3 and upmixed-*.ac3 files in the "completed" folder.

So here is a modified AC3 2.0 to AC3 5.1 Upmix.bat.
Put in the main folder.

Code:
@echo off

rem AC3 2.0 - AC3 5.1 Upmixer v0.6


for  %%a in ("*.ac3") do @echo "%%a">mlist.txt & call :process "%%a"
goto end

:process

type mlist.txt | lmod set cfile=[$1] >currfile.bat
call currfile.bat

if exist audio.ac3  del audio.ac3
if exist upmixer\audio.ac3 del upmixer\audio.ac3

for /f %%s in ('TIME /T') do set stime=%%s
@echo. >>upmix_log.txt
@echo %1 Processing Started at %stime% >>upmix_log.txt

copy "%cfile%" audio.ac3 /y
copy audio.ac3 upmixer /y
cd upmixer

cls
@echo.
@echo.
ctext.exe "{0x1B}      Encoding the 5.1 Audio Track...                      {\n}"
ctext.exe "{0x07}.{\n}"
@echo.
@echo.
wavi upmixac3.avs - | aften.exe -acmod 7 -pad 0 -readtoeof 1 -v 0 -b 448 - upmixed_audio.ac3 >nul

cls
@echo.
@echo.
ctext.exe "{0x1B}      Copy, Move and Delete Files...                       {\n}"
ctext.exe "{0x07}.{\n}"
@echo.
@echo.

cd..

copy upmixer\upmixed_audio.ac3
del audio.ac3
del upmixer\audio.ac3
del upmixer\upmixed_audio.ac3
del currfile.bat
del mlist.txt

mmove "%cfile%" completed
ren upmixed_audio.ac3 "upmixed-%cfile%" & mmove "upmixed-%cfile%" completed

for /f %%e in ('TIME /T') do set etime=%%e
@echo %1 Processing Ended at  %etime% >>upmix_log.txt
@echo. >>upmix_log.txt

:end


And the upmixac3.avs script it uses is the same as the one I posted for *.avi with AC3 file upmixing.
Put it in the Upmixer folder.

Code:
SetMemoryMax(512)

LoadPlugin("NicAudio.dll")
LoadPlugin("AudioLimiter.dll")
LoadPlugin("soxfilter.dll")

NicAC3Source("audio.ac3")

ConvertAudioToFloat().SSRC(48000)

#UpMixGeneral()
#UpmixSOS()
#UpMixMultisonic()
#UpMixGerzen()
#UpMixFarina()
UpMixJagger()
#UpMixHeadphones()

# Profile to use with audio sources that have a wide range of sound content. 20ms delay and -3db attenuation on surround
function UpMixGeneral( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
         front = a.soxfilter("filter 20-20000")
      back = a.soxfilter("filter 100-7000")
      fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.668,-0.668)
      fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),0.668,-0.668)
      cc = mixaudio(mixaudio(front.GetLeftChannel(),fl,1,-1),mixaudio(front.GetRightChannel(),fr,1,-1),0.398,0.398)
      lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol -0.447")
      sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.473,-0.473)
      sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.473,-0.473)
      sl = DelayAudio(sl,0.02)
      sr = DelayAudio(sr,0.02)
      return MergeChannels( fl, fr, cc, lfe, sl, sr)
       }

# Multisonic approach Profile modified with 20ms delay and some attenuation on surround
function UpMixMultisonic( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      front = a.soxfilter("filter 20-20000")
      back = a.soxfilter("filter 100-7000")
      fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),1,-0.5)
      fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),1,-0.5)
      cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.5,0.5)
      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)
            return MergeChannels( fl, fr, cc, lfe, sl, sr)
       }

# SOS approach Profile with 20ms delay and some attenuation on surround
function UpMixSOS( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      back = a.soxfilter("filter 100-7000")
      fl = a.GetLeftChannel()
      fr = a.GetRightChannel()
      cc = mixaudio(a.GetRightChannel(),a.GetLeftChannel,0.5,0.5)
      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)
      return MergeChannels( fl, fr, cc, lfe, sl, sr)
       }

# Gerzen approach Profile modified with 20ms delay and some attenuation on surround
function UpMixGerzen( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      front = a.soxfilter("filter 20-20000")
      back = a.soxfilter("filter 100-7000")
      fl = mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.685,-0.115)
      fr = mixaudio(front.GetRightChannel(),front.GetLeftChannel(),0.685,-0.115)
      cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.4511,0.4511)
      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)
      return MergeChannels( fl, fr, cc, lfe, sl, sr)
       }

# Farina/Sursound approach Profile M=L+R, S=L-R, c=0.75, L' = (1-c/4)*M+(1+c/4)*S, C' = c*M, R' = (1-c/4)*M-(1+c/4)*S
# also added with 20ms delay and some attenuation on surround
function UpMixFarina( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      front = a.soxfilter("filter 20-20000")
      back = a.soxfilter("filter 100-7000")
      fl = mixaudio(mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.300,0.300),mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.300,-0.300),0.7125,1.2875)
      fr = mixaudio(mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.300,0.300),mixaudio(front.GetLeftChannel(),front.GetRightChannel(),0.300,-0.300),0.7125,-1.2875)
      cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.465,0.465).wavgainlimiter(0.9)
      lfe = ConvertToMono(a).SoxFilter("lowpass 90","vol 0.9")
      sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.475,-0.475).wavgainlimiter(1.2)
      sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.475,-0.475).wavgainlimiter(1.2)
      sl = DelayAudio(sl,0.02)
      sr = DelayAudio(sr,0.02)
           return MergeChannels( fl, fr, cc, lfe, sl, sr)
       }

#Profile made by jagger to emulate levels outputed by AC3Filter.
function UpMixJagger( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      back = a.soxfilter("filter 100-7000")
      fl = a.GetLeftChannel()
      fr = a.GetRightChannel()
      cc = mixaudio(a.GetRightChannel(),a.GetLeftChannel,0.707,0.707)
      lfe = ConvertToMono(a).SoxFilter("lowpass 120","vol 1.2")
      sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.5,-0.5)
      sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.5,-0.5)
      return MergeChannels( fl, fr, cc, lfe, sl, sr).wavgainlimiter(1.0)
       }

#Profile made by jagger designed for 5.1 through headphones.
function UpMixHeadphones( clip a )
{
  Assert( a.AudioChannels == 2, "This clip must have 2 audio channels" )
      front = a.soxfilter("filter 500-10000")
      back = a.soxfilter("filter 100-7000")
      fl = a.GetLeftChannel()
      fr = a.GetRightChannel()
      cc = mixaudio(front.GetRightChannel(),front.GetLeftChannel,0.707,0.707)
      lfe = ConvertToMono(a).SoxFilter("filter 20-3000","vol 1.3")
      sl = mixaudio(back.GetLeftChannel(),back.GetRightChannel(),0.5,-0.5)
      sr = mixaudio(back.GetRightChannel(),back.GetLeftChannel(),0.5,-0.5)
      return MergeChannels( fl, fr, cc, lfe, sl, sr).wavgainlimiter(1.0)
       }


EDIT:
Just simplified batch to always use %cfile% and remove all %sfile% and slist.txt usage.

EDIT2:
Another small modification to batch file.
1. Delete a temporary audio.ac3 file left in Upmixer folder.
2. Added another message after encoding for Copy Move delete.
3. Put >nul back on end of wavi command line. Is this needed for anything Soopafresh? I can't see any difference with it there or not.


Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 05, 2007 22:49 Posts Comp View users profile Send private message Reply with quote

Hey Soopafresh can you show me how i can convert .mpg files into .mpg but with 5.1 sound.

the original mpg only has stereo.

Thanks if you can help smile.gif


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 05, 2007 22:58 Posts Comp View users profile Send private message Reply with quote

What's the audio - Ac3 2.0, MP2, or PCM/WAV ? Post a Gspot screen cap

Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 05, 2007 23:11 Posts Comp View users profile Send private message Reply with quote

huh? i have no clue.

i have the video and audio in the same file and the file extension is .mpg


redwudz
Mod Neophyte


Joined: 07 Sep 2002
Location: AZ, USA

Post Posted: Sep 05, 2007 23:19 Posts Comp View users profile Send private message Reply with quote

Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 05, 2007 23:37 Posts Comp View users profile Send private message Reply with quote

oh thanks i didnt know i could just screenshot the current window with alt

heres an attached picture of Gspot with my .mpg

testing.bmp


redwudz
Mod Neophyte


Joined: 07 Sep 2002
Location: AZ, USA

Post Posted: Sep 05, 2007 23:52 Posts Comp View users profile Send private message Reply with quote

You can also post it directly: ( I converted to JPEG to make it smaller.)



That appears to have MPEG-1 Layer2 audio, fairly common for DVDs, especially in PAL countries. But you do have a NTSC (US, etc.) format.


Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 06, 2007 00:07 Posts Comp View users profile Send private message Reply with quote

oh cool thanks. but when i try converting it it doesnt work it only works like avi files.

Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 06, 2007 01:03 Posts Comp View users profile Send private message Reply with quote

Okay, MP2 format. Check back in a bit...

Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 06, 2007 02:18 Posts Comp View users profile Send private message Reply with quote

Here you go. This version will only work with mpa or mp2 audio in Mpeg files.

Same requirements - Avisynth 2.57 or later

See the first post in the thread for instructions. Instead of your output being in AVI format, it'll be Mpeg

http://www.savefile.com/files/1033933


Delta2
Member


Joined: 20 Jun 2005
Location: Portugal

Post Posted: Sep 06, 2007 07:05 Posts Comp View users profile Send private message Reply with quote

I wonder, doesn't a 2 channel audio sound a little crappy when upmixed to 5.1 channels ? does it worth it ?

Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 06, 2007 13:58 Posts Comp View users profile Send private message Reply with quote

Wow thanks! biggrin.gif

Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 06, 2007 14:01 Posts Comp View users profile Send private message Reply with quote

Delta2 - Listen to the examples on the first page.

Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 06, 2007 16:59 Posts Comp View users profile Send private message Reply with quote

Soopafresh wrote:
Here you go. This version will only work with mpa or mp2 audio in Mpeg files.

Same requirements - Avisynth 2.57 or later

See the first post in the thread for instructions. Instead of your output being in AVI format, it'll be Mpeg

http://www.savefile.com/files/1033933


I tried it and the output was ac3, with only audio sad.gif


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 06, 2007 18:22 Posts Comp View users profile Send private message Reply with quote

If you look in the "Completed" folder, there should be an AC3 file, plus there should be an MPG file that has the 5.1 AC3 already multiplexed inside. You can verify it by Gspot analysis.

Aaron187
Member


Joined: 03 Sep 2007
Location: Canada

Post Posted: Sep 06, 2007 18:53 Posts Comp View users profile Send private message Reply with quote

in the completed folder there is only a ac3 file no mpg file

Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Sep 06, 2007 19:31 Posts Comp View users profile Send private message Reply with quote

Hmmm... Try shortening the name of your source MPG file. if it is called "My File.mpg", change it to "MyFile.mpg"

I'll check out the script later if that doesn't work. Not to worry, we'll get it working smile.gif


Aaron187
Member


Joined: 03 Sep 2007