View Full Version : Audio analyse
tin3tin
30th June 2007, 13:12
I've added support for avisynth post effects to DVD slideshow GUI. And through avisynth support for Free Frame plugins.
Now I wonder is there a way to analyse the audio in avisynth-script in a way that the current frame can be manipulated through the values of the current volume/frequency ect.?
tin3tin
1st July 2007, 09:50
[Double post - sorry - please delete this post]
tin3tin
1st July 2007, 09:51
This is what I have come up with so far:
I guess that a combination of FrameEvaluate and a new Runtime Function could be the best way to value/volume ect. return values into ex. a Free Frame plugin. Unfortunately I don't know how to code this kind of stuff...
Alternatively another way could be to get sox (http://sox.sourceforge.net/) to analyse a wav file and export to a .dat file. I have to figure out if it is possible to export a value pr. frame, matching the framerate and then use ConditionalReader to read the .dat file into a variable which can be used in ex. a the Free Frame plugin.
Any other idears or ways to get sound to manipulate images?
tin3tin
2nd July 2007, 11:27
Hmm I just came across the audiograph (http://avisynth.org.ru/docs/english/externalfilters/audiograph.htm) plugin. If I just knew a bit about this c stuff... I guess it wouldn't be that hard to make it return a max value of the waveform of the current frame instead of a clip...
Can anyone help me with this?
Wilbert
2nd July 2007, 17:14
Histogram(mode="audiolevels") returns the maximal value on a frame. So the math is already there. It doesn't look that hard to add this to conditional_functions.cpp, but i have no time for it coming two weeks.
Matrixbob
7th July 2007, 14:54
Interesting link:
I need to realize 1 "cut audio"! (http://forum.doom9.org/showthread.php?t=126139)
Wilbert
10th July 2007, 14:13
Hmm I just came across the audiograph plugin. If I just knew a bit about this c stuff... I guess it wouldn't be that hard to make it return a max value of the waveform of the current frame instead of a clip...
Can anyone help me with this?
If you are still interested, try this avisynth.dll (http://www.geocities.com/wilbertdijkhof/avisynth.dll):
Syntax:
AudioMax(channel) # maximal volume in channel (framewise)
AudioMin(channel) # minimal volume in channel (framewise)
AudioRMS(channel) # root mean square volume in channel (framewise)
# channel = 0 means that the max/min/rms is taken over all samples in all channels (framewise)
Usage:
v = BlankClip(pixel_type="YV12")
a = Tone(type="Triangle", frequency=2, level=0.4)
w = AudioDub(v,a) #.Histogram(mode="audiolevels")
w = ScriptClip(w, "Subtitle(String(AudioMax(1)))")
#w = ScriptClip(w, "Subtitle(String(AudioRMS(0)))")
#w = ScriptClip(w, "Subtitle(String(AudioMin(1)))")
w = w #.ConvertToRGB32.AudioGraph(20)
return w
Note that the values are given in decibels (see also histogram docs for an explanation).
tin3tin
11th July 2007, 10:31
Thank you! It works very well with your scripted example, however when I import som music it gives me an "CAVIStreamSynth: System exception - Access violation at 0x0, reading from 0x0" error.
I'll have to check if this is the case with AudioGraph as well... it might be.
Wilbert
11th July 2007, 10:46
Could you upload the audio somewhere that causes problems?
tin3tin
11th July 2007, 12:20
It's properly not avisynth which is causing the problem. It's Media Player Classic(even the latest builds). It' doesn't matter if I throw audiograph, histogram or your new functions at it, then it gives me the access violation error mentioned above. And also with your tone instead of music there's the error.
But AvsP is showing the script without problems(with the slider). Quenc render without problems.
So in my eyes must this be Media Player Classic related and no problems with your new functions. Thanks alot!!!
I guess I'll have to find another player as external player for AvsP now...
tin3tin
13th July 2007, 09:25
Will these functions be added to the next avisynth version? :-)
Btw. does anyone else get these errors in MPC(or is it something with my set-up(ffshow - whatever)))?
Wilbert
13th July 2007, 22:10
It's properly not avisynth which is causing the problem. It's Media Player Classic(even the latest builds). It' doesn't matter if I throw audiograph, histogram or your new functions at it, then it gives me the access violation error mentioned above.
I forgot to ask. Does this also happen with older versions of AviSynth, or only the latest official alpha?
tin3tin
15th July 2007, 13:35
Yes it seems so. Histogram actually works, but normalize doesn't.
But I'm affraid it might be something in my set-up. Resently Directshowsource doesn't load mp3 anymore properly. FFshow doesn't fix it.
But is it only here these errors with MPC happen?
tin3tin
15th July 2007, 18:06
Here's some crazy stuff I did with your new functions, DVD slideshow GUI, freeframe.dll and the freeframeplugin: Petebloom.dll. :)
Audio effects in FLV player (http://download.videohelp.com/tin2tin/DsG_music_bloom.html)
Still haven't found the reason why MPC crashes, when using those sound functions...
Wilbert
23rd August 2007, 20:45
@tin3tin,
I created a plugin out of it:
http://www.geocities.com/wilbertdijkhof/MinMaxAudio_v01.zip
The reason that it will not be included in the core (for now) is stability, but IanB is able to explain that better.
tin3tin
4th September 2007, 17:26
Great I'll give it a try.
Hmmm. I can't load it with LoadPlugin...
Wilbert
4th September 2007, 21:37
Great I'll give it a try.
Hmmm. I can't load it with LoadPlugin...
I forgot to export it as a dll :) I will post a new version tomorrow.
Wilbert
9th September 2007, 12:53
New version: http://www.wilbertdijkhof.com/MinMaxAudio_v02.zip
Gavino
18th October 2008, 22:26
A slight confusion in the documentation of MinMaxAudio
Computes the root mean square, maximal or minimal value over all samples in all channels, or just over all samples in channel, and outputs the value (in decibels) as a string.
Actually the functions return a float.
tin3tin
13th March 2009, 09:18
Wilbert, your site (http://www.geocities.com/wilbertdijkhof/) links to version 01(not working) and not the 02 from above(working). :)
buzzqw
13th March 2009, 10:40
check here http://www.64k.it/andres/dettaglio.php?sez=avisynth
BHH
tebasuna51
13th March 2009, 14:26
check here http://www.64k.it/andres/dettaglio.php?sez=avisynth
Warning with BassAudio_Pack in http://www.64k.it/andres/dettaglio.php?sez=avisynth is very outdated and buggy.
Is your site?
buzzqw
13th March 2009, 14:31
yes
feel free to link me a new pack, i will glady update my site
BHH
Wilbert
13th March 2009, 18:31
Wilbert, your site links to version 01(not working) and not the 02 from above(working).
Thanks! I corrected the link :)
tebasuna51
13th March 2009, 23:06
feel free to link me a new pack, i will glady update my site
Here is the last version BassAudio2423.7z (http://www.sendspace.com/file/aphik2)
Also some info about NicAudio with confuse names:
NicAudio_25_dll_20060314.zip Version 1.5 (Dimzon) 2006-03-14
NicAudio_alpha3.zip Version 1.8? (Nic) 2006-09-01
NicAudio17.zip Version 1.82 (Nic) 2007-08-13
NicAudio_20070821.zip Version 1.83 (IanB) 2007-08-21
NicAudio_r201.7z Version 2.01 (Tebasuna) 2008-04-09
NicAudio_r202.7z Version 2.02 (Tebasuna) 2008-09-24
Edit: And RaWav.dll included in NicAudio since 2.00
buzzqw
14th March 2009, 10:32
thanks, added last pack and added version to file name
BHH
tin3tin
24th March 2012, 11:12
It seems that the audio related bugs has been solved in Avisynth 2.6, so I've been playing around with Wilbert's minmaxaudio plugin. It works quite well, however once in a while the resulting value drops out of the 0 to -100 DB range and gives a value like -791 and that causes problems because I need values between 0 and 1. I've been using AudioRMS function. Is this a bug?
Wilbert
24th March 2012, 14:50
It works quite well, however once in a while the resulting value drops out of the 0 to -100 DB range and gives a value like -791 and that causes problems because I need values between 0 and 1. I've been using AudioRMS function. Is this a bug?
Sounds a bug to me. You got a sample clip and script for me?
tin3tin
24th March 2012, 15:35
Here's my code:
loadplugin("C:\Users\tin2tin\Desktop\Avisynth\FFmpegSource\FFMS2.dll")
import("C:\Users\tin2tin\Desktop\Avisynth\FFmpegSource\FFMS2.avs")
ffmpegsource2("C:\Users\tin2tin\.DVDslideshowGUI\PartyNow.mp4",atrack=-1).BilinearResize(320,240)
LoadPlugin("MinMaxAudio.dll")
ScriptClip("Subtitle(String(Audiorms(0)))")
Go to the last frame of this clip (http://download.videohelp.com/tin2tin/PartyNow.mp4) to see the low value (http://download.videohelp.com/tin2tin/MinMaxAudioValue.png).
Wilbert
6th April 2012, 16:19
Go to the last frame of this clip to see the low value.
The last frame seems to have no audio (at least AviSynth doesn't get audio from FFmpegSource for the last frame). So the audio samples are zero and -791 is returned (which is 20*log10(FLT_MIN/tot) but that's not important).
zenny
25th January 2013, 16:51
Hi:
Even after more than 100 views when I didn't get any reply to the thread at http://forum.doom9.org/showthread.php?t=167011 in which I explained what I wanted to achieve in compositing with two sources of video with a common audio source, alternating the video source either durationwise and/or on detection of the audio pause.
New to avisynth, so could MinMaxAudio help to achieve what I am indending to? I read a bit here, but seems either it is only for animations or is going above my head! And if the latter, all fault is mine. ;-)
Appreciate it if somebody can guide me. Thanks!
Best regards
zenny
Guest
25th January 2013, 19:59
I answered in your other thread. You did not mention duration-wise over there. Can you clarify it over there?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.