Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th June 2007, 13:12   #1  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
Audio analyse

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.?
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 1st July 2007, 09:50   #2  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
[Double post - sorry - please delete this post]
__________________
DVD slideshow GUI(Freeware).

Last edited by tin3tin; 1st July 2007 at 10:01.
tin3tin is offline   Reply With Quote
Old 1st July 2007, 09:51   #3  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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 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?
__________________
DVD slideshow GUI(Freeware).

Last edited by tin3tin; 1st July 2007 at 09:53.
tin3tin is offline   Reply With Quote
Old 2nd July 2007, 11:27   #4  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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?
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 2nd July 2007, 17:14   #5  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
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.
Wilbert is offline   Reply With Quote
Old 7th July 2007, 14:54   #6  |  Link
Matrixbob
Registered User
 
Matrixbob's Avatar
 
Join Date: Apr 2007
Location: Italy
Posts: 35
Interesting link:
I need to realize 1 "cut audio"!
__________________
Aiuta la ricerca col tuo PC: >>Calcolo distribuito BOINC.Italy: unisciti anche tu<<
Pių largo č il sorriso, pių affilato č il coltello.
Matrixbob is offline   Reply With Quote
Old 10th July 2007, 14:13   #7  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Quote:
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:

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:
Code:
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).
Wilbert is offline   Reply With Quote
Old 11th July 2007, 10:31   #8  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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.
__________________
DVD slideshow GUI(Freeware).

Last edited by tin3tin; 11th July 2007 at 11:48.
tin3tin is offline   Reply With Quote
Old 11th July 2007, 10:46   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Could you upload the audio somewhere that causes problems?
Wilbert is offline   Reply With Quote
Old 11th July 2007, 12:20   #10  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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...
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 13th July 2007, 09:25   #11  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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)))?
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 13th July 2007, 22:10   #12  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Quote:
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?
Wilbert is offline   Reply With Quote
Old 15th July 2007, 13:35   #13  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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?
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 15th July 2007, 18:06   #14  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
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

Still haven't found the reason why MPC crashes, when using those sound functions...
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Old 23rd August 2007, 20:45   #15  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
@tin3tin,

I created a plugin out of it:

http://www.geocities.com/wilbertdijk...xAudio_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.
Wilbert is offline   Reply With Quote
Old 4th September 2007, 17:26   #16  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
Great I'll give it a try.

Hmmm. I can't load it with LoadPlugin...
__________________
DVD slideshow GUI(Freeware).

Last edited by tin3tin; 4th September 2007 at 17:31.
tin3tin is offline   Reply With Quote
Old 4th September 2007, 21:37   #17  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
Quote:
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 is offline   Reply With Quote
Old 9th September 2007, 12:53   #18  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
New version: http://www.wilbertdijkhof.com/MinMaxAudio_v02.zip

Last edited by Wilbert; 8th September 2015 at 15:02. Reason: corrected url
Wilbert is offline   Reply With Quote
Old 18th October 2008, 22:26   #19  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,374
A slight confusion in the documentation of MinMaxAudio
Quote:
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.

Last edited by Gavino; 18th October 2008 at 22:29.
Gavino is offline   Reply With Quote
Old 13th March 2009, 09:18   #20  |  Link
tin3tin
Registered User
 
tin3tin's Avatar
 
Join Date: Mar 2005
Posts: 365
Wilbert, your site links to version 01(not working) and not the 02 from above(working).
__________________
DVD slideshow GUI(Freeware).
tin3tin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.