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: Jun 04, 2007 09:19 Posts Comp View users profile Send private message Reply with quote

Thanks for your kind words smile.gif

Brinky
Member


Joined: 03 Jun 2007
Location: Netherlands

Post Posted: Jun 19, 2007 07:42 Posts Comp View users profile Send private message Reply with quote

Is it possible to get a AC3 file with a bitrate of 448kbps if i change this in mp3_to_ac3.bat?
from:
bepipe.exe --script "import(^upmix1.avs^)" - | aften.exe -acmod 7 -dnorm !char! -v 0 -b 384 - audio.ac3

To:
bepipe.exe --script "import(^upmix1.avs^)" - | aften.exe -acmod 7 -dnorm !char! -v 0 -b 448 - audio.ac3

Or do i get issues on that, or sound distortion?


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Jun 20, 2007 02:02 Posts Comp View users profile Send private message Reply with quote

That should work fine. smile.gif

I'm not happy with the sound of the mp3_to_ac3 script yet. It is OK, but I need to remove the maximizing and limiting which was designed for movie audio and not really music. Better if Chopin isn't IN YO FACE ! laugh.gif

So, go ahead BUT make sure your MP3 files have NO spaces in the name -

Bad: My Music File.mp3

Good: My_Music_file.mp3


I'll fix that in the next version, but until then, that is a limitation.


j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

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

lol that Chopin is classical music like The Beatles right? listen.gif

Guess that elevator type music would benefit from no normalization at all with perhaps
no/less frequency range cutting to atleast FL FR SL SR and generally a lower avg volume.
I mean you don't want a Triangle to sound like a Symbol due to frequency cuts to rear channels.
And 12th overture for example just has to be louder at the end without peaking 100 fullness dosn't it.


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Jul 17, 2007 01:18 Posts Comp View users profile Send private message Reply with quote

Update to v.06a -

- No More .NET requirements
- Spaces in File Name Support (I think...lemme know if there's a problem)
- Updated Aften encoder to v.07
- Mp3 audio to 5.1 AC3 encoding (and it's pretty fast, too!). File names can now have spaces.
- Upmixed file destination is the "Completed" folder. See instructions in first post.


j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Jul 17, 2007 03:29 Posts Comp View users profile Send private message Reply with quote

Spaces, dots and dashes in filenames working fine here.

With a 93 second sample wavi runs at 99% CPU for 2x 5 mins+ using the default Farina script. mix mix mix mix mix mix smile.gif

And only 2x 35 seconds with jagger script.


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Jul 17, 2007 03:40 Posts Comp View users profile Send private message Reply with quote

Coolness... thanks a ton for checking it, jagger smile.gif Lotsa changes in this one.

faramith
Member


Joined: 20 Jul 2006
Location: Puerto Rico

Post Posted: Jul 17, 2007 18:59 Posts Comp View users profile Send private message Reply with quote

Hi! ill try this tool later tonight thanks
Question, is it multi-core able?

Thanks!


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Jul 17, 2007 19:44 Posts Comp View users profile Send private message Reply with quote

Yes, but the Avisynth script would require some tweaking using the plugin MT().

http://www.avisynth.org/tsp/MT_07.zip

http://avisynth.org/mediawiki/MT_support_page

It'll take some testing. If you decide to try it, lemme know how it goes.



The Aften encoder can be immediately multithreaded.

Download http://prdownloads.sourceforge.net/win32builds/aften-0.07-win32-bin.zip?download

and replace the aften.exe file in the upmixer folder with the aften.exe found in the zip file above - this folder:





I wish that was the bottleneck. The slow part of this process is the automatic volume level analysis so the new 5.1 AC3 doesn't distort. It works so well, we need to keep it in, even at the expense of the batch processing taking a longer time.


--- Note -- A 1 Hr long AVI took 7 minutes to process on an 8 Core Mac pro, 40 minutes on a 2.4Ghz P4, both running XP


j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Jul 24, 2007 04:33 Posts Comp View users profile Send private message Reply with quote

Done a bit more tweaking to allow AVI with AC3 2.0 to be upmixed
with this batch, script and nicaudio.dll AVISynth plugin.

I also knocked that LFE down to standard 120Hz @ Gain 1.5, 480Hz @ 2.0 was still too much.

AVI_AC3_Upmix.bat
Code:
@echo off

rem AVI AC3 2.0 - AVI AC3 5.1 Upmixer v0.6

if exist v1deo.avi del v1deo.avi
if exist avilist.txt del avilist.txt

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

:process

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

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

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

cls
@echo.
@echo.
ctext.exe "{0x1B}      Demuxing the AC3 Audio from AVI...             {\n}"
ctext.exe "{0x07}.{\n}"
@echo.
@echo.
mmcl --unpack --always-write "%cfile%" "c-%cfile%"
mencoder -O  "x-%cfile%" -forceidx -oac copy -ovc copy "c-%cfile%"
del "c-%1"
mencoder "x-%cfile%" -ovc copy -nosound -o video.avi
ffmpeg -i "x-%cfile%" -vn -acodec copy -y audio.ac3
del "x-%cfile%"
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

cd..
copy upmixer\upmixed_audio.ac3 /y

cls
@echo.
@echo.
ctext.exe "{0x1B}      Now Creating UpMixed File...                      {\n}"
ctext.exe "{0x07}.{\n}"
@echo.
@echo.

divxmux -o "completed\Upmixed-%cfile%" -v  "video.avi" -a o-0 "upmixed_audio.ac3"

if exist upmixer\upmixed_audio.ac3 del upmixer\upmixed_audio.ac3
del video.avi
del "c-%cfile%"
del currfile.bat
del mlist.txt
del slist.txt

ren audio.ac3 "original-%sfile%.ac3" & mmove "%orig-sfile%.ac3" completed
ren upmixed_audio.ac3 "upmixed-%sfile%.ac3" & mmove "upmixed-%sfile%.ac3" 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



upmixac3.avs script
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.5")
      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)
       }


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

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

How do i change the setting of the scripts.?
Now i change it with wordpad and save it.
When i restart my pc it is back to the old settings ?

Are there any updates to this great program ?

Thanks


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

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

Hi dirkenlek- What script modifications did you make ?

dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

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

i try to adjust the output volume LFE to 0.5 because 1.5 is to loud for me.
Its in the Jagger Script.
When i change it in upmix1 and save it with notepad its ok.
But the next day or so its back to its old settings and i have to change it back.


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

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

The file you need to modify is UPMIX.AVS


Upmix1 gets modified every time you run the program - that's why it changes. wink.gif


So make your changes to UPMIX.AVS and you'll be good to go


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

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

I will try that.....

dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

Post Posted: Aug 23, 2007 07:59 Posts Comp View users profile Send private message Reply with quote

That works..
I did encode a moviefile .
When i play the movie file theres no audio after 3 min 25 ?

I play the original file and the audio sounds ok.

Could that be a problem in the original file and how can i fix that ?

Sorry for my bad english... i live in Belgium and speak normally Dutch.


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Aug 23, 2007 08:13 Posts Comp View users profile Send private message Reply with quote

1) Run your AVI through Avi_Gain_Regular.bat

http://forum.videohelp.com/topic314909.html

2) Play the new Norm-yourfile.avi and see if it plays properly.

3) If it works, use the Norm-yourfile.avi for the 2.0-5.1 Upmix program.

Good luck. If the original file is damaged, it might be difficult to make it work properly.


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

Post Posted: Aug 23, 2007 10:48 Posts Comp View users profile Send private message Reply with quote

it did not work...
The extracted mp3 audio looks fine and sound good.
The ac3 file is only 10mb long and stops after 3 min 25

The avi with the new audio sounds good but after converting to 5.1 the audio stops at 3 min 25.

Thanks for the help ...


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

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

Hello,

I want to upmix ac3 2.0 audio to 5.1 but i cannot get your script to work.

I try the one you posted .

I made a bat file... avs script for ac3 ...

I don't understand why it is not working... it just stops ??



Please help.

Your mp3 to 5.1 works Fine... thanks a lot for that...
Are there no scripts available for Action or Adventure movies.

Greetz

D


j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Aug 30, 2007 07:53 Posts Comp View users profile Send private message Reply with quote

Those scripts also require the nicaudio.dll AVISynth plugin present in the upmixer folder.

Last edited by j4gg3rr on Aug 31, 2007 02:36, edited 1 time in total


dirkenlek
Member


Joined: 18 Aug 2007
Location: Belgium

Post Posted: Aug 30, 2007 08:58 Posts Comp View users profile Send private message Reply with quote

I made a bat file and replaced the other run upmix (from the mp3 upmix) with it.
I placed an nicaudio.dll in the upmixer folder.

It works now ..

Are they scripts available for Action...Adventure movies...
Are there websides where i can find some scripts ?

I tryed your Jagger script... it sounds very good but i adjusted the LFE freq to 90...

It sounds a lot better than for me.....

Greetz to the people downunder......


winifreid
Member


Joined: 20 Sep 2003
Location: United States

Post Posted: Aug 30, 2007 18:10 Posts Comp View users profile Send private message Reply with quote

I was interested in trying to upmix an mp3 music file to ac3 5.1 using your system. First off, it this possible? I am not quite sure what files I need and where to put them.
Thank You


Soopafresh
Craptastic


Joined: 01 Jan 2004
Location: United States

Post Posted: Aug 30, 2007 18:24 Posts Comp View users profile Send private message Reply with quote

Hi winifreid smile.gif

Look on the first page of this thread for instructions and download info. Change your .MPA extension to .MP3 and run it through Z_Run_mp3_to_ac3.bat . Lemme know if you run into problems. We'll get it working for you.



j4gg3rr
Member


Joined: 10 Nov 2005
Location: Australia

Post Posted: Aug 31, 2007 06:57 Posts