View Single Post
Old 1st February 2013, 00:13   #10  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
You could try a 2 pass approach. The first pass writes a log of audio levels per frame. You process the log to make your decisions. The second pass acts upon your decision output to select the video view.

Pass 1 :-
Code:
LoadPlugin(".....MinMaxAudio.dll")

Colon=":" # Field Separator text

...Source("Video1....")
AudioDub(...Source("AudioTrack...."))

WriteFile("AudioLevel.log", "current_frame", "colon", "AudioRMS()")
Pass 2 :-
Code:
V1=...Source("Video1....")
V2=...Source("Video2....")

ConditionalFilter(V1, V1, V2, "ChoiceVar", "equals", "1") # Select Video based on ChoiceVar
ConditionalReader ("Choice.Log", "ChoiceVar") # Load ChoiceVar table

AudioDub(...Source("AudioTrack....")) # Add Audio
Of course you still need to write the magic to convert AudioLevel.log into Choice.Log. Which should be a fairly easy task in any text handling language like Perl, Basic, C, etc.
IanB is offline   Reply With Quote