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 13th August 2003, 10:21   #1  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
New Filter: AudioGraph

Richard Ling sent me this filter (2.0x), which will display the audio waveform on top of the video.

Give it a try.

http://www.avisynth.org/users/warpen...l_20030808.zip

(very well documented source included!)
WarpEnterprises is offline   Reply With Quote
Old 13th August 2003, 14:10   #2  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Nice filter - good for syncing sound!

I had a little time, so I made a AudGraph for AviSynth 2.5. My additional notes:


- No YV12 support.
- Should support multiple channels.
- YUY2 mode made a bit more eyepleasing, IMO.
- - It makes the graph a bit more blocky.
- - YUY2 mode is converted to greyscale.


Not that well tested - provided without any kind of warranty. Source is of course included.
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 27th August 2007 at 13:05.
sh0dan is offline   Reply With Quote
Old 14th August 2003, 15:34   #3  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Very nice! Could you adjust it, so that the channels are shown separately (for example, on top of each other)?
Wilbert is offline   Reply With Quote
Old 17th August 2003, 01:11   #4  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
I too would like to be able to see the channels separated.

In the meantime, though:
Code:
# AudioGraphWrapper
#
#   Wrapper function to AudioGraph.  Displays each channel separately
#   below the video.  Each channel is displayed below the preceding
#   channel.
#
# PARAMETERS:
#   frameRadius
#   channelHeight - the height to add to the bottom of the clip for each
#                     channel;
#                   (default: 100)
#
function AudioGraphWrapper(clip c, int frameRadius, int "channelHeight",
\                          int "curChannel")
{
    assert(c.AudioChannels() > 0, "AudioGraphWrapper: clip has no audio")

    channelHeight = default(channelHeight, 100)
    curChannel = default(curChannel, 1)

    bottom = AudioDub(c.BlankClip(height=channelHeight), c.GetChannel(curChannel))
    bottom = bottom.AudioGraph(frameRadius)

    c = StackVertical(c, bottom)

    return (curChannel == c.AudioChannels())
    \      ? c
    \      : c.AudioGraphWrapper(frameRadius, channelHeight,
    \                            curChannel=(curChannel + 1))
}

Last edited by stickboy; 17th August 2003 at 01:38.
stickboy is offline   Reply With Quote
Old 17th March 2004, 22:04   #5  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
When I try to use AudioGraph in conjunction with Tone, I get an access violation.
Code:
AudioDub(BlankClip(pixel_type="yuy2"), Tone())
AudioGraph(1)
leads to:
Quote:
Avisynth read error: caught an access violation at 0x01531159, attempting to write to 0x055d6000.
Some interesting quirks:
  • seems to happen only in YUY2
  • seems to happen only with Tone; if I use AVISource/WAVSource for the audio, it's fine. (I can even remove the AudioGraph line, save the audio track as a WAV file with VirtualDub, replace Tone() with that WAV file, and AudioGraph works fine again.)
Anyone have any idea what's going on here?
stickboy is offline   Reply With Quote
Old 18th March 2004, 08:31   #6  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
which AviSynth version? There are some recent changes in the audio handling...
WarpEnterprises is offline   Reply With Quote
Old 18th March 2004, 09:57   #7  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Oops. I should know better.

AviSynth 2.5.5 alpha (2004-03-14 build).
stickboy is offline   Reply With Quote
Old 18th March 2004, 11:23   #8  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Redownload the file - I fixed the filter.

Or use ConvertAudioTo16bit() before Audiograph. Bug was a simple underscore (_) too much.
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 18th March 2004 at 11:30.
sh0dan is offline   Reply With Quote
Old 18th March 2004, 20:57   #9  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Wow, that was really fast. Thanks!
stickboy is offline   Reply With Quote
Old 29th November 2004, 13:56   #10  |  Link
lark
Regular User
 
Join Date: May 2002
Location: Yes and No
Posts: 411
@ sh0dan

looks like an old thread, but does anyone have that fixed audgraph available?
i'd appreciate if it would be also changed in warpenterprises' collection...

regards
t
lark is offline   Reply With Quote
Old 29th November 2004, 14:06   #11  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
I have it. I will post it if my internet connection at home works again.
Wilbert is offline   Reply With Quote
Old 24th August 2007, 22:59   #12  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Just wanted to say that some japanese guy added YV12 support. It's based on the original version, thus not on Sh0dan's modifications: Viewaudio. Yes, it's from 2003

LoadPlugin("ViewAudio.dll")
ViewAudio(clip, int frames, int top, int height, bool fill, int channel)

frames : ‘OŒ‚•\ŽƒtƒŒ[ƒ€”‚Žw’ (default : 2)
top : •`‰ŠJŽn y •W (-1 ‚‚‚ clip ‚‰‚•\Ž, default : -1)
height : •`‰—ˆ‚̍‚‚ (default : 80)
fill : •`‰—ˆ‚“h‚‚‚‚‚? (default : true)
channel : •`‰‚‚‰ƒ`ƒƒƒ“ƒlƒ‹ (-1 ‚‚‚‘Sƒ`ƒƒƒ“ƒlƒ‹•\Ž, default : -1)

channel=-1 all channels are drawn, i think
Wilbert is offline   Reply With Quote
Old 23rd March 2008, 22:56   #13  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Posting in here, in order to follow advice from IanB. Deleted my original post from this thread http://forum.doom9.org/showthread.php?t=123195

Bug Found:
This code fails after 30 seconds of playback
Code:
colorbars()
BilinearResize(720,480)
AudioGraph(10)
AviSynth give me this
Quote:
CAVIStreamSynth: System exception - Access Violation at 0x0, reading from 0x0
How To Reproduce:
Open script MPC

VirtualDub doesn't fail, or maybe i didn't wait long enough; over 5 min worked.

AviSynth Version: 2.58 build sept 19 2007
MPC Version: 6.4.9.1


This code works in MPC
Code:
colorbars()
AudioGraph(10)


Computer Specs Below
mikeytown2 is offline   Reply With Quote
Old 15th May 2008, 19:53   #14  |  Link
mikeytown2
Resize Abuser
 
mikeytown2's Avatar
 
Join Date: Apr 2005
Location: Seattle, WA
Posts: 623
Feature Request:
Display Audio Spectrogram.
http://en.wikipedia.org/wiki/Spectrogram

My current way of doing this, which is not perfect at all.
Example Code
Code:
Global W = 640
Global H = 480
Global F = 29.97
Global D = 0
Global R = 48000
Global PicLen = Round(F*5)
Global Resizer = "BlackmanResize"
Global BlankPic = BlankClip(1, W, H, "RGB32", F, stereo=true, audio_rate=R).Loop()

NewTone()

Function NewTone()
{
	sound = WavSource("Before-After.wav").SSRC(R) #305 Frames
		
	pic = ImmaRead("spectrogram3300.jpg").AssumeFPS(F).ConvertToRGB32()
	a = pic.ZoomBox(-1, 0, 0, 0, W, H, IgnoreAR=1, ResizeMethod=Resizer).Subtitle("Before                 After",align=2, size=48).Loop(PicLen)
	a = a.AudioDub(BlankPic.Trim(0, a.Framecount()-1).KillVideo())
	b = pic.Loop(Round(PicLen/3)).KenBurnsEffect(-1, 0, 0, 0, -567, 200, 757, -95, W, H, 4, useZoomBox=2, ResizeMethod=Resizer, endPZframe=Round(PicLen/3)-Round(PicLen/4))
	b = b.AudioDub(BlankPic.Trim(0, b.Framecount()-1).KillVideo())
	c = pic.Loop(305).KenBurnsEffect(-567, 200, 757, -95, 2461, 200, 3927, -95,  W, H, 4, useZoomBox=2, ResizeMethod=Resizer)
	c = c.AudioDub(sound)
	d = pic.Loop(Round(PicLen/3)).KenBurnsEffect(2461, 200, 3927, -95, -1, 0, 0, 0,  W, H, 4, useZoomBox=2, ResizeMethod=Resizer, startPZframe=Round(PicLen/4))
	d = d.AudioDub(BlankPic.Trim(0, d.Framecount()-1).KillVideo())
	e = pic.ZoomBox(-1, 0, 0, 0, W, H, IgnoreAR=1, ResizeMethod=Resizer).Subtitle("Before                 After",align=2, size=48).Loop(PicLen*2)
	e = e.AudioDub(BlankPic.Trim(0, e.Framecount()-1).KillVideo())
	a+b+c+d+e
}


Also, does anyone have a better way to add the audio, other then blankclips with audiodub?

Last edited by mikeytown2; 16th May 2008 at 03:43. Reason: Use ZoomBox for static parts
mikeytown2 is offline   Reply With Quote
Old 28th January 2010, 00:57   #15  |  Link
AlanHK
Registered User
 
Join Date: May 2006
Posts: 237
Quote:
Originally Posted by Wilbert View Post
Just wanted to say that some japanese guy added YV12 support. It's based on the original version, thus not on Sh0dan's modifications: Viewaudio. Yes, it's from 2003
Google gives an intelligible translation (except for "Tokino Tamotsu View Channel"):
And CacheAudio in the same dll might be useful.

Code:
ViewAudio.dll v0.3.01 Copyright (C) 2002, 2003 minamina 
http://nullinfo.s21.xrea.com/
================================================== ============================== 
Avisynth Plugin - View Audio (YUY2 and YV12 Only) 

- Description 

 Speech display filter for Avisynth 
 Modes for YUY2 and YV12 mode 
 Avisynth 2.5 only 

 Richard Ling's work AudioGraph add voice capabilities to the reference frame around the display capabilities 
 Thanks to Mr. Richard Ling 

- How 

 LoadPlugin ( "ViewAudio.dll") 
 ViewAudio (clip, frames, top, height, fill, channel) 

 frames: before and after the specified number of frames displayed (default: 2) 
 top: start drawing y coordinate (-1, then at the bottom of the clip, default: -1) 
 height: The height of the drawing area (default: 80) 
 fill: you fill the drawing area? (default: true) 
 channel: Channel voice to draw (-1 Tokino Tamotsu View Channel, default: -1) 

- Examples 

 ViewAudio () 
 ViewAudio (1, 0) 
 ViewAudio (height = 200) 

================================================== ============================== 
Avisynth Plugin - Cache Audio 

- Description 

 Audio cache filter for Avisynth 
 Avisynth 2.5 only 

 AudioSource random access are weak when used as an aid to edit 

- How 

 LoadPlugin ( "ViewAudio.dll") 
 CacheAudio (clip, MaxFrame, BlockFrame) 

 Specify the maximum number of frames MaxFrame cache (default: 1000) 
          -1: For all frames (need lots of memory. Time-consuming at first view) 
 BlockFrame specify the number of frames read at once (default: 100) 
            -1: MaxFrame use the same value (requires a lot of memory. Time-consuming at first view) 

- Examples 

 CacheAudio () 
 CacheAudio (10000, 300) 
 CacheAudio (MaxFrame = 20000) 

================================================== ============================== 

- History 

 2003/11/03 v0.3.01 CacheAudio added 
 2003/10/06 v0.2.02 is wrong, correct the problem check the maximum number of frames displayed 
 2003/09/22 v0.2.01 also change the voice frame can be displayed around 
 2003/03/16 v0.1.01 Avisynth 2.5 support 
                    YV12-mode 
 Born 2002/12/15 v0.0.01
AlanHK is offline   Reply With Quote
Old 26th February 2010, 06:49   #16  |  Link
Midzuki
Unavailable
 
Midzuki's Avatar
 
Join Date: Mar 2009
Location: offline
Posts: 1,480
Well, I've just discovered that the waveform generated by AudioGraph() can be made "more visible" (or "more annoying", depending on the point-of-view) by using PointResize(). Example script:

Quote:
LoadPlugin("C:\AVSplugins\AudGraph.dll")
vid=BlankClip(width=32, height=32, fps=15, \
length=3254).KillAudio()
aud00=WavSource("filename.wav")
aud01=WavSource("filename.wav").GetChannel(1)
aud02=WavSource("filename.wav").GetChannel(2)
left_ch=AudioGraph(AudioDub(vid,aud01),0).PointResize(256, \
256)
.AddBorders(16,16,16,16)
rite_ch=AudioGraph(AudioDub(vid,aud02),0).PointResize(256, \
256)
.AddBorders(16,16,16,16)
AudioDub(StackHorizontal(left_ch,rite_ch), aud00)
SelectEvery(1,0,0)
Example video:

http://cid-5acf098e0ebae8d5.skydrive...nnel-Theme.avi

Last edited by Midzuki; 27th February 2010 at 08:01. Reason: updated script, added URL to example video
Midzuki is offline   Reply With Quote
Old 17th June 2020, 17:54   #17  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
I apologize for bumping an old thread ....

But, an update to this plugin was made by Ihor Bobalo some time ago but only source code provided. Includes new parameters "_graph_scale", "_middle_colour", and "_side_colour".

Can anyone be kind enough to compile the updated version, x86/x64 if possible?

Source code is here: https://sourceforge.net/p/audiograph...AD/tree/trunk/
Reel.Deel is offline   Reply With Quote
Old 20th June 2020, 15:43   #18  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,869
Quote:
Originally Posted by Reel.Deel View Post
I apologize for bumping an old thread ....

But, an update to this plugin was made by Ihor Bobalo some time ago but only source code provided. Includes new parameters "_graph_scale", "_middle_colour", and "_side_colour".

Can anyone be kind enough to compile the updated version, x86/x64 if possible?

Source code is here: https://sourceforge.net/p/audiograph...AD/tree/trunk/
Here's a quick and dirt x86 build I made: https://we.tl/t-HSjwLbrtGX
When I have time, I might fork the source and bring everything to GitHub and then play a bit with it 'cause so far it supports pretty much nothing... I didn't try it. Try it.

Last edited by FranceBB; 20th June 2020 at 17:03.
FranceBB is offline   Reply With Quote
Old 20th June 2020, 15:58   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Reel.Deel,
What does AudioGraph() have that Wonkey_Donkey WaveForm() dont have ? [apart from maybe YUY2, I think].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 20th June 2020, 16:04   #20  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Reel.Deel View Post
Can anyone be kind enough to compile the updated version, x86/x64 if possible?
I'll do it unless wonkey's WaveForm() supersedes and replaces that plugin.
__________________
Groucho's Avisynth Stuff
Groucho2004 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 11:40.


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