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.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 30 of 54
Thread
-
-
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 -
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? -
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 -
-
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) -
For AC3 import use
LoadPlugin("C:\Program Files\AviSynth25\plugins\NicAudio.dll")
B = NicAC3Source("D:\audio.AC3") -
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? -
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. -
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.
-
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.
-
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. -
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)
Code:filter1() filter2() filter3()
Code:last = filter1(last) last = filter2(last) last = filter3(last)
-
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... -
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.
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. -
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. -
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. -
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. -
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. -
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)
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)
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)
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)
BTW: None of these are accounting for the -96ms delay. I assume your actual file reports 0ms delay. -
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? -
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()
-
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 -
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.
Similar Threads
-
avisynth: is there an alternative function to the SmoothFPS2
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 1st Nov 2014, 11:03 -
is there an avisynth plugin or function for trimming video ?
By vhelp in forum EditingReplies: 5Last Post: 8th Dec 2013, 14:02 -
crop function for avisynth
By vhelp in forum EditingReplies: 5Last Post: 14th Oct 2013, 23:43 -
AVISynth function to darken an area
By kinglerch in forum EditingReplies: 13Last Post: 9th Apr 2012, 17:26 -
Avisynth function to TBC old VHS video?
By Asterra in forum CapturingReplies: 4Last Post: 4th Sep 2011, 02:35