VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Simple batch script to downmix 5.1 AC3 and DTS files to normalized 2.0 AC3, MP3, and iTunes Standard LC M4A audio files. Included are the newest free encoders available. Will also encode M4A with the (Considered Best Sounding) Nero AAC/M4A encoders, but license restrictions prevent me from including them in the zip file. Download: http://www.nero.com/nerodigital/eng/Nero_Digital_Audio.html

    5.1AC3 - 2.0 AC3 - Aften.exe
    5.1AC3 - 2.0 MP3 - Lame.exe
    5.1AC3 - 2.0 MP2 - Twolame.exe
    5.1AC3 - 2.0 M4A - Faac.exe
    5.1AC3 - 2.0 M4A - NeroAacEnc_SSE2.exe

    Requirements:
    Avisynth 2.55 or greater
    .Net 2.0 Runtimes

    Download:
    5_1_downmixer.rar

    Sample 5.1 Ac3 Input file (800k)
    input.ac3

    Instructions:
    1) RENAME your 5.1 AC3 file to INPUT.AC3 or 5.1 DTS to INPUT.DTS

    2) Place in same folder as the script files

    3) Double Click on _AC3_Downmix.Bat (or _DTS_Downmix.bat)

    Notes:
    You'll notice the output files have more "oomph" and are louder than the input AC3s. The dynamic range limiting is quite transparent and natural sounding. When the script begins to run, it appears like it is stuck at 0% progress. That's the normalizing algo searching through the source file for volume levels. Don't worry, it'll start

    MP2 output isn't the greatest, as noted below. If you're making audio for DVD, use the Aften Ac3 app.

    Comparison of Frequency Response: Aften is quite accurate to the source. Twolame's Mp2 has artifacts past the 10K mark, as noted by the arrow. Both M4A encoders have sharp cutoffs at 10K. My ears like the sound of the lame mp3 encode.
    Quote Quote  
  2. Thanks for the links! Can you post a url that gives more information about the software you used to make those dB vs. frequency graphs? I can't really make out the name of it in the title bar... looks like Magellan but I can't find much googling for "Magellan frequency analysis." They are pretty cool!a
    Quote Quote  
  3. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Sure, it was Audacity and I took a screen capture of each graph Using Fasstone Capture (google it and download the portable version as it doesn't write anything to the registry). Such a great little program with annotation and drawing capabilities. I opened all of the screen caps with a 2-pane explorer/navigator app and screen capped the whole thing.



    Quote Quote  
  4. Wow... does your version of Audacity read ac3 files? Mine imports them as mp3 files and they sound like high pitched noise I'm guess it doesn't do ac3.
    Quote Quote  
  5. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Nope (I wish). Had to decode the resulting tracks back to WAV to measure.
    Quote Quote  
  6. I tried your batch files now that I have some time... they worked (ac3 downmix to nero acc). However, the resulting acc file is too loud, which parameters in the avs can be tweaked to cut the boost? I'm assuming the amplify(1.2) in the A1 and A2 lines get get dropped to say, 1.1 ??

    Thanks!
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  7. Also, how can I get the output to go to wav so I can analyze it in audcity (which can't read aac).

    I'd like to convert two files to wav:

    1) original ac3 (untouched normalization for comparison purposes).
    2) the "gained" output from the aften step

    How are these tasks best accomplished?

    Thanks man!
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  8. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    ffmpeg -i your_ac3file.ac3 -vn -y your_wave.wav
    Quote Quote  
  9. Cool, thanks! I'll give that a shot. What about:
    Which parameters in the avs can be tweaked to cut the col. boost? I'm assuming the amplify(1.2) in the A1 and A2 lines get get dropped to say, 1.1 ??
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  10. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    The highlighted sections all influence the audio volume.



    If the overall volume is too loud, I would tweak this line:

    A=MergeChannels( A1, A2 ).normalize().WavGainLimiter(1.3)


    Normalize(0.90) will normalize the overall mix to 90% , lowering the volume

    WavGainLimiter is the setting that provides the "oomph", making the quieter sections of the audio louder, yet keeping the loud sections untouched. Read the AudioLimiter docs in the \sources folder for additional types of limiters.
    -----------------------------------------------------------------------------------------------------------
    If you want to create a straight 2 channel WAV mix, download Sox

    http://ftp.uni-koeln.de/pc/win32/mmedia/sox13.zip

    Add the following to the .BAT file:

    bepipe.exe --script "import(^AC3_downmix.avs^)" - | sox.exe -t wav - WAV_16BIT_OUT.WAV


    Add this to the end of the script to decode the files back to .WAVs

    ffmpeg -i AFTEN_AC3_OUT.ac3 -vn -y AFTEN_AC3_OUT.WAV
    ffmpeg -i LAME_MP3_OUT.mp3 -vn -y LAME_MP3_OUT.WAV
    ffmpeg -i 2LAME_MP2_OUT.mp2 -vn -y 2LAME_MP2_OUT.WAV
    ffmpeg -i FAAC_M4A_OUT.m4a -vn -y FAAC_M4A_OUT.WAV
    ffmpeg -i NERO_M4A_OUT.m4a -vn -y NERO_M4A_OUT.WAV


    * Note: You'll need a fairly recent build of ffmpeg.exe to decode the M4A files.
    Quote Quote  
  11. Killer info. I'll try it out.

    Thanks again!
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  12. ...you ever try the 5.1 downmix DSP for foobar2000? It is very fast and doesn't require avisynth, batch files, etc. It also keep the vol. levels the same as the 5.1 file without any tweaks.
    http://encoding.n3.net <-- for all your DVD and CD backup needs!
    Quote Quote  
  13. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Absolutely. Use it every day. Foobar is my player of choice. It even has a plugin to accept Avisynth scripts and support for VST. I'd recommend it in a heartbeat, there's just a lot of steps to explain to the average user to download the app, download the AC3 plugin, configure the channel mappings, configure a command line output script with the latest version of your favorite audio encoder, etc. And then you have to deal with people complaining that iTunes isn't handling their MP3 files as the default player since Foobar was installed (even though that would be a good thing in my opinion)

    Of course, I wouldn't mind taking Avisynth out of the conversion procedure, but the problem then becomes having to create a temporary WAV file to send to your favorite audio converter. That's fine if we weren't dealing with 2+ hour long movies and the 2GB WAV file limit.

    And since I'm sure you've noticed, the most common legitimate complaint in the audio forums next to A/V sync is volume (lack of), my script kicks it up a notch by adding normalization and dynamic range compression. It isn't the most scientific way to accomplish the goal, but the settings worked on the various AC3 files I fed it.
    Quote Quote  
  14. all I'm getting when I try to output to 2.0 are 1 kb files that aren't really anything. Could this be a result of the .Net 2.0 runtimes or whatever that was? I kind of ignored that step. figured I had it, maybe not. Sorry, bit a of newb with this stuff.

    ***installed .Net 2.0 runtimes, didn't help.
    Quote Quote  
  15. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Couple of things -

    Are you sure your AC3 files are 5.1 ?

    Try with this test Ac3 file.

    input.rar
    Quote Quote  
  16. Yup, 5.1 alright. the input.ac3 sample worked and I tried another 5.1 file and it also worked (barely, took a while and gave me errors <object reference not set to an instance of an object.>) so it must be my ac3 files that are the problem. hmm. bummer. oh well, thanks for the script.
    Quote Quote  
  17. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Just download this downmix.avs file and replace the one in that folder. It will support your 2 channel AC3 files.



    downmix.zip
    Quote Quote  
  18. Member
    Join Date
    Mar 2007
    Location
    Sweden
    Search Comp PM
    Hi im a real noob with sounds, i have a DTS wave file that i want to convert to a normal MP3 so it can work on normal players as windows media player. I've tried different programs like foobar and Autogk but nothing works for me. Same shitsounds everytime i open the file with mediaplayer. So can someone help me?
    Quote Quote  
  19. Member
    Join Date
    Aug 2011
    Location
    Surrey UK
    Search Comp PM
    Elegant script Soopafresh. How long does it take for the normalize routine to work? I have a modern system, Windows 7 x64, 2-core AMD Phenom 555 3.2 Ghz with 4GB of memory, and with a 2 hour 5.1 AC3 input, the job is still running after 4 hours! The script works OK for short AC3 files, 12 minutes to process a 7min file, but it seems to loose the plot when it comes to processing a full length movie sound track.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!