VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 54
Thread
  1. Hi. As well as converting my vid, I'm trying to lower the volume. According to this:
    http://avisynth.nl/index.php/Amplify
    I need to use a number less than 1 so I've put 'amplify(0.5)' at the end of the script. The resulting vid is louder! I've played around with different numbers but with no success. Could someone tell me exactly how my script should read? Thank you.
    Quote Quote  
  2. Member
    Join Date
    Jan 2007
    Location
    United States
    Search Comp PM
    try a - minus number

    and i think, it should be in the same cmd line as the audio encoding
    to be reduced when the audio is processed,
    NOT at the end of the script

    also audio is logarithmic -3 aka 3db reduction is 1/2 the sound electrical energy on a meter, but NOT on the human ear
    Quote Quote  
  3. Hello and thanks. Negative number, still louder...

    I don't have a command line for the audio encoding. I use MeGUI which gives a script like this:

    LoadPlugin("E:\Free Portables, Drivers, Linux etc\MeGUI port\tools\dgindex\DGDecode.dll")
    DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    #crop
    #resize
    #denoise

    The only place I can put 'amplify(0.5)' is at the end, no?
    Quote Quote  
  4. Mountains of gear vaporeon800's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Your script, as posted, doesn't load audio at all. I think MeGUI usually processes audio outside of Avisynth and muxes it into the encode, but I don't use it.
    Quote Quote  
  5. Member
    Join Date
    Jan 2007
    Location
    United States
    Search Comp PM
    IDK
    i don't use MeGui and I think ive only reduced a sound track volume ONE time

    for that i used aviDemux

    take your current finished file that too loud
    open in aviDemux, use copy video, chose sound codec type, load filters for sound
    choose dummy mux, or mux as same file type
    you should be able to reduce the sound level
    and remux to the same file with out touching the video
    Quote Quote  
  6. Thanks. avidemux can't go below -10 which is still a tad loud. I'm sure I'll find a way...
    Quote Quote  
  7. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    If you have your audio extracted, you can do it quitly in LameXP

    Or you can do it in Virtualdub

    Bernix
    Last edited by Bernix; 15th May 2016 at 01:38.
    Quote Quote  
  8. Member
    Join Date
    Jan 2007
    Location
    United States
    Search Comp PM
    or Audacity

    you can also, just run it through avidemux again
    using the new file
    you aren't doing anything to the video, so a second pass will only reduce the audio some more

    unless this is going in a compilation with other videos, i would have left the audio as is
    Quote Quote  
  9. LoadPlugin("E:\Free Portables, Drivers, Linux etc\MeGUI port\tools\dgindex\DGDecode.dll")
    A=DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    ColorMatrix(hints=true, threads=0)
    #deinterlace
    #crop
    #resize
    #denoise

    B=WAVSource("Movie.wav")
    B=B.Amplify(0.5)###Cuts volume in half (I think)
    AudioDub(A,B)
    Quote Quote  
  10. Thanks again. Manono, my vid has 'AC-3 (DVD-Video)' audio. Are you saying I need to get it converted to WAV first? I was hoping avisynth could convert/reduce the audio without me having to do anything else...
    Quote Quote  
  11. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    For AC3 import use
    LoadPlugin("C:\Program Files\AviSynth25\plugins\NicAudio.dll")
    B = NicAC3Source("D:\audio.AC3")
    Quote Quote  
  12. Thanks again. Assuming I've understood you, here's my script (via MeGUI):

    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    A=DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    ColorMatrix(hints=true, threads=0)
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3")
    B=B.Amplify(0.5)
    AudioDub(A,B)

    Line 6, that's the file created by File Indexer.
    After trying to run Queue, I got an error message 'Invalid arguments to ColorMatrix'. Any idea why e.g. it's position in the script?
    I deleted ColorMatrix and ran the script. New file had louder audio...

    Should there really be 2 lines beginning 'B='?
    Should there or should there not be spaces before and after the '='? Or does it not matter?
    Quote Quote  
  13. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    MeGUI does process audio via AviSynth. But it does not do that in the AviSynth script created for video conversion. It does that in a separate script created specifically for audio conversion.

    You may handle both audio and video in the same script, but you don't have to. If you do that, you have to use this AviSynth script file also as source in the audio processing group of the main window.

    But you may prefer checking which AviSynth script the audio job would generate, and edit that. This may require not using a quick processing mode, but manually selecting the inputs in both video and audio groups of the main window and manually inserting jobs into the queue. In this case, you will probably see a dialog where you can in fact change the audio volume.
    Quote Quote  
  14. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Or if you have ffmpeg installed you can try
    ffmpeg -i inputfile -vcodec copy -af "volume=-20dB" outputfile

    Bernix
    Quote Quote  
  15. Amplify() works exactly as it's supposed to. Values between 0 and 1.0 decrease the volume, values over 1.0 increase the volume. Values below zero invert the waveform but otherwise work the same as the positive values. If you're not getting that it's because your editor isn't using the audio from AviSynth.
    Quote Quote  
  16. I've managed to get a working script with MeGUI:

    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    A=DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    B=NicAC3source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3")
    C=B.Amplify(0.1)
    AudioDub(A,C)

    As you can see, I've changed the second 'B=' to 'C='. Having two 'B=' just didn't seem right.
    However, the script does not include this usual command:

    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    ColorMatrix(hints=true, threads=0)

    As mentioned above, I'm getting error warnings about it. This only began when I started loading the NicAudio dll. Can anyone suggest cause and cure? Is Colour Correction essential?

    Meantime, thanks for all the bits of info that helped me put the above script together.

    EDIT: Forget it, just used the same script on a similar file and the audio is back to being louder. I'm just going to change the audio with WavePad and mux it to the video with Avidemux.
    Last edited by pooksahib; 15th May 2016 at 14:03. Reason: Giving up.
    Quote Quote  
  17. Using this exact script on a Lagarith AVI made from a DVD source, along with the original AC3 audio:

    A=AVISource("Movie.avi")
    B=NicAC3source("Movie.ac3")
    B=B.Amplify(0.2)
    AudioDub(A,B)


    produced audio barely audible where without the Amplify command it was much louder. I used WAVSource in my earlier reply because that's what I usually work with and what I had around. I don't know why it doesn't work for you in MeGUI but opening your script with audio in a player such as MPC-HC should clearly demonstrate that it works as it's supposed to.

    You don't need the ColorMatrix stuff in your script.
    Quote Quote  
  18. Originally Posted by pooksahib View Post
    As you can see, I've changed the second 'B=' to 'C='. Having two 'B=' just didn't seem right.
    There's nothing wrong with re-using a stream name like:

    Code:
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3")
    B = B.Amplify(0.5)
    In fact, you're implicitly doing so every time you run a sequence of filters like:

    Code:
    filter1()
    filter2()
    filter3()
    Because AviSynth defaults to the name "last" whenever you doen't specify the input and output streams. So the above sequence is the same as:

    Code:
    last = filter1(last)
    last = filter2(last)
    last = filter3(last)
    But this has nothing to do with your Amplify() problem. It's likely that Megui isn't processing the audio via the AviSynth script. You can quickly test this by importing a completely different audio file in the script. If you don't get that alternate audio then Megui isn't using it.
    Quote Quote  
  19. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    People, once again:

    MeGUI uses AviSynth for audio processing. But you have to use a custom AviSynth script as audio source in the manual processing, not rely on quick features like a "One Click Encoder" or similar.

    Blaming MeGUI for not working as intended is useless if you don't use it as required for your intention.

    To know if you used MeGUI correctly or not, we would need to know step-by-step what you did, from starting MeGUI on, each menu click, each button click...
    Quote Quote  
  20. Originally Posted by jagabo View Post
    It's likely that megui isn't processing the audio via the AviSynth script. You can quickly test this by importing a completely different audio file in the script. If you don't get that alternate audio then Megui isn't using it.
    Hi jagabo – it passed the test with flying colours.

    The 'working' script I referred to in post #16 has since failed/worked/failed. I don't understand it. As requested by LigH.de, here's my method:

    Setup is MeGui. I also have AviSynth installed which does NOT have NicAudio within it's plugins.
    My test file is AmpTest.mpg taken from a DVD via avidemux in copy mode. The audio is “AC-3(DVD-Video)”.

    Launch MeGUI, click Tools/File Indexer, load AmpTest, run Queue.
    I now possess a d2v file and an ac3 file.
    In 'megui avisynth script creator' I load NicAudio.dll and remove the Colour Correction plugin (knowing that there'll be an error message about it later).
    I add 'A=' at the start of 'DGDecode_mpeg2source("E:\AmpTest.d2v")'
    I insert these commands:
    B=NicAC3source("E:\AmpTest T80 2_0ch 192Kbps DELAY -96ms.ac3")
    B=B.Amplify(0.1)
    AudioDub(A,B)
    I save the script. The main window still shows the audio that was loaded after File Indexer i.e. Input – ac3, Output – mp3 (mp3 is my preset encoding method).***
    I click Autoencode/Queue/Start and let it run. The new file is a fail – audio is louder than original.

    ***I repeated the exercise with the audio section of the main window 'cleared', my thinking being that the audio input is now in the script (B=). However, I merely got a vid with no audio.

    The wiki says about Amplify: “8bit and 24bit audio is converted to float; the other audio formats are kept as they are.” My AmpTest file is 16 bits so, if I ever get Amplify working, I'd expect a lower-volume ac3 file, yes? When I had that successful Amplify, the audio was mp3 i.e. the original ac3 had been converted and reduced.

    Originally Posted by LigH.de View Post
    But you have to use a custom AviSynth script as audio source in the manual processing, not rely on quick features like a "One Click Encoder" or similar.
    I've tried looking for a way to do this without using AutoEncode but haven't found one...


    If anyone can point me in the right direction with this, I'd be mighty pleased. Thanks to you all for your time and patience.
    Quote Quote  
  21. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    The "AVS Script Creator" of MeGUI only loads a video input and lets you select an output file name for the converted video stream. It does not handle audio at all.

    In the main window of MeGUI, in the "Input" tab, there is an upper half for the video and a lower half for the audio. Here you have to select the AC3 file as "Audio Input" in the "Track 1" tab in the "Audio" group. Select the desired target audio format in "Encoder settings" and select a matching preset containing "... *scratchpad*". Did I find out correctly that your desired target audio format is MP3? Then select "LAME MP3: *scratchpad*". Now press the button "Config".

    Here you don't have a control available to simply adjust the volume by a factor, but you can select a normalization target (means, the loudest sample is calculated so that its volume will be the given percentage of the available range).

    When done configuring the encoder, click "New" and store your new custom LAME MP3 preset (OK).

    Add the job to the queue by clicking "Queue" in the lower right.

    Switch to the "Queue" tab in the upper left and run the job.

    In the log, you can now see that an AviSynth file has been created, which contains a lot of downmixing functions for the case that they might be required... Unfortunately, you don't read there where this AviSynth file had been stored, so you cannot simply edit it and change it to your preference.

    To process a custom AviSynth script as audio source, instead of the raw audio file, you would open the *.avs file as "Audio Input" instead of the *.ac3 file, in the lower half of the MeGUI main window.
    Quote Quote  
  22. Hi LigH.de. Well, that's moved us on – I've just done two successful tests! Thank you so much. All that you said concerning mp3 was already taken care of – there's no need for me to “select the AC3 file as "Audio Input" in the "Track 1" tab in the "Audio" group” as that is done automatically after running File Indexer.

    All I did, in fact, was the same as I described above except that, before clicking Autoencode/Queue/Start, I went to the Audio Input section of the main window and deleted the ac3 file and added the avs file. (perhaps I did that 'by mistake' when I had my first success...)

    Anyway, it seems I can now use MeGUI to reduce the volume as well as convert the video. But that still leaves me with what I said about the wiki (“8bit and 24bit audio is converted to float; the other audio formats are kept as they are”). Instead of having my reduced audio in mp3, can't I have it in the original format (in this case, ac3)?

    Danke once again for your kind help.
    Quote Quote  
  23. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    If you have a WAV (or raw sample) file with 8 bit or 24 bit precision, it will be converted so that most audio encoders can handle it, to either float audio or 16 bit integer audio (the two most commonly supported sample formats).

    But if you have an AC3 audio as input, it is decoded to either 16 bit integer or float anyway, depending on the AviSynth audio decoder.
    __

    I would indeed recommend not to convert the original AC3 audio stream, but to convert the video only and then multiplex it into the final container. But you cannot change the volume this way. If you convert it, no matter whether the same target format (AC3 output encoded by ffmpeg) or a different, you will always lose some quality.

    There are only a few audio formats where you can change internal amplification factors without actually reencoding the content completely. Such software is usually called "...Gain". So look out for a tool named AC3Gain and try if you can lower the volume losslessly with it. But if it requires an additional encoder (like Aften), it will recode with loss.
    Quote Quote  
  24. Hi all. Up to now, I've been trying to 'Amplify()' a small test file and I can now run a working script. It's a little frustrating not knowing why the inclusion of NicAudio causes the Color Correction filter to generate an error message but manono tells me that filter's not essential. Also strange is the wiki saying that Amplify will leave my audio in the same format but you get what you choose in Audio Encoder Settings. Nevermind, I was prepared to accept all that.

    The DVD I want to use Amplify on also requires me to use Crop, QTGMC and SRestore so I worked my way through MeGUI until I came to the final bit as taught to me by LigH.de – deleting the ac3 file from the Audio Input section of the main window and replacing it with the avs file. I got a popup saying “This file cannot be processed”.

    Damn. I redid my 'test' (worked fine), tried the DVD again, still “...cannot be processed”. I re-launched MeGUI and loaded the avs directly – the 'crop' function is now giving me the 'invalid argument' warning!

    Dearie me... I said last night I would use WavePad and Avidemux. After this latest setback, that's exactly what I'm going to do. Of course, I'll listen to any further suggestions you may have but, for now, my sincere thanks to you all for the tips and advice.
    Quote Quote  
  25. Mountains of gear vaporeon800's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Originally Posted by pooksahib View Post
    It's a little frustrating not knowing why the inclusion of NicAudio causes the Color Correction filter to generate an error message
    It's just because you're not following Avisynth syntax.

    Code:
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    A=DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    ColorMatrix(hints=true, threads=0)
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3") 
    B=B.Amplify(0.5)
    AudioDub(A,B)
    jagabo alluded to Avisynth's usage of last. ColorMatrix(hints=true, threads=0) is the same as ColorMatrix(last,hints=true, threads=0) and because your input filter has been manually assigned to A instead of automatically being assigned to last, there is no value for last.

    Solution 1:
    Code:
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    A = DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    A = A.ColorMatrix(hints=true, threads=0)
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3") 
    B = B.Amplify(0.5)
    AudioDub(A,B)
    Solution 2:
    Code:
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    A = DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3).ColorMatrix(hints=true, threads=0)
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3") 
    B = B.Amplify(0.5)
    AudioDub(A,B)
    Solution 3:
    Code:
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    A = DGDecode_mpeg2source("E:\AudTest orig.d2v", info=3)
    B = NicAC3Source("E:\AudTest orig T80 2_0ch 192Kbps DELAY -96ms.ac3") 
    B = B.Amplify(0.5)
    AudioDub(A,B)
    ColorMatrix(hints=true, threads=0)
    I suspect your issue with Crop is the same.

    BTW: None of these are accounting for the -96ms delay. I assume your actual file reports 0ms delay.
    Quote Quote  
  26. Brilliant. Absolutely brilliant, thank you so much, you're a star.

    Regarding the 96ms delay, I've left it all to MeGUI. Is there some specific action I should be taking?

    This is the script I used which has everything I need in it – crop, deinterlace, blend repair, colour adjustment and audio reduction. Does it matter what order I have the commands in or would you guys suggest I change the order (and for what reason)?

    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    # Set DAR in encoder to 4 : 3. The following line is for automatic signalling
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    A=DGDecode_mpeg2source("E:\Test.d2v", info=3)
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    A=A.ColorMatrix(hints=true, threads=0)
    A=A.crop(6, 0, -12, 0)
    A=A.ColorYUV(off_u=26, off_v=-4)
    A=A.QTGMC()
    A=A.SRestore()
    B=NicAC3Source("E:\Test T80 2_0ch 192Kbps DELAY -96ms.ac3")
    B=B.Amplify(0.1)
    AudioDub(A,B)

    Finally (I hope), when trying to find solutions for myself I usually end up on a page like this which I presume is the 'official' avisynth 'wiki':
    http://avisynth.nl/index.php/Amplify
    I find such pages very unclear on how to actually use the commands – in this example, there's nothing about having to load NicAudio or allocating a prefix letter to the command. Is there a better, more comprehensive, tutorial anywhere?
    Quote Quote  
  27. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Just to turn everything upside-down ... you can also have one clip containing both video and audio, and applying either video filter or audio filter to the same clip. You can dub early and rely on "last" for the rest of the script. Like this (code sources look nice in a "CODE" bbCode block):

    Code:
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    # Set DAR in encoder to 4 : 3. The following line is for automatic signalling
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    
    video = DGDecode_mpeg2source("E:\Test.d2v", info=3)
    audio = NicAC3Source("E:\Test T80 2_0ch 192Kbps DELAY -96ms.ac3") 
    AudioDub(video,audio)
    
    Amplify(0.1)
    DelayAudio(-96/1000.0) # here you can synchronize the audio stream according to the delay reported in the file name
    
    ColorMatrix(hints=true, threads=0)
    Crop(6, 0, -12, 0)
    ColorYUV(off_u=26, off_v=-4)
    QTGMC()
    SRestore()
    Of course, you will not find generic AviSynth syntax tutorials in pages about specific functions. You already have to know how to deal with clips containing audio in general before learning details of function parameters. So start with the AviSynth wiki main page, especially the chapter "New to AviSynth – Start Here" where you can find a few links with bold titles (e.g. "Your first script" and "Getting started" and "Grammar"...). This is your start. And it is quite good.
    Quote Quote  
  28. Danke, LigH.de, that's a much nicer looking script.
    Quote Quote  
  29. Sorry guys, I need your help again. For this encode, I'm not doing the whole DVD in one go but as a collection of scenes. After creating the script, I launched AVS Cutter. I created a 'Cuts File' and put it in the Cuts section of the Audio Input. The resultant file is silent although both mediainfo and avidemux tell me there's mp3 audio. Very odd. I tried again without loading the cuts file and there IS now audio but it's from another part of the DVD.

    I suspect I need to reword the 'film=last' section. Can anyone assist? Thanks again.

    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\NicAudio.dll")
    # Set DAR in encoder to 4 : 3. The following line is for automatic signalling
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    LoadPlugin("E:\MeGUI port\tools\dgindex\DGDecode.dll")
    LoadPlugin("E:\MeGUI port\tools\avisynth_plugin\ColorMatrix.dll")
    video = DGDecode_mpeg2source("E:\tommy.d2v", info=3)
    audio = NicAC3Source("E:\tommy\VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3")
    AudioDub(video,audio)
    Amplify(0.15)
    ColorMatrix(hints=true, threads=0)
    crop(6, 0, -12, 0)
    ColorYUV(off_u=26, off_v=-4)
    QTGMC()
    SRestore()

    __film = last
    __t0 = __film.trim(42593, 47278)
    __t0
    Quote Quote  
  30. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    You did not understand the recommendation about the "CODE" block to display your source code prominently...

    The script appears to be correct for me (one could reduce it, but it seems to work as intended). The reason why it seems to be "silent" must be that the audio volume is so low that you don't hear anything, despite having an audio stream in your cut.

    I really wonder why you reduce the volume so much that the result is hardly audible.
    Quote Quote  



Similar Threads