Log in

View Full Version : Suggestion for new function from a AvisSynth user / fan.


droopy928gt
9th May 2003, 20:55
Dear All,

Thanks for further developing AviSynth. When I started with video as a hobby it was a great program for me to achieve the sometimes strange combination of clips / audio I wanted in a relatively easy way. Added advantage for me was the fact of being able to simply load the AviSynth scripts in my favorite encoder, TMPGEnc. Recently though I've gotten into a few situations which gotten me to think that there was a reasonably straigh forward function missing in AviSynth.

If I might therefore be so bold, I wanted to propose a function to you, the developers, as a possible extension of AviSynth in future developments. Now I'm a lousy programmer and as such can only propose it. I hope though that you people might give it some thought though.

The function I'm thinking of is "SegmentedWavSource". You already have "SegmentedAviSource".

The reason for proposing this is basically the possibly greater flexibility in manipulating audio. The first idea for this comes from a functionality which is already in AviSynth, where you can use the captured AVI in the "WavSource" function to manipulate its audio. After which you then combine them again using the "AudioDub" function. "WavSource" though can not be used in cases where e.g. the capture was done using segmented AVI files. You would first have to save the audio of this segmented AVI before you could use it, with all the possible dangers of out of sync audio. But also the extra steps and time spend.

To give an example which I encountered myself and basically got me thinking about this.

I had an segmented AVI capture for which for some kind of reason the right audio channel was sometimes breaking off into a silence for a few seconds after which it would come back again. Since it was a documentary, the stereo part didn't matter that much so I simply would copy the left channel to the right channel. Using AviSynth this could have been as easy as following script.

video = SegmentedAviSource("d:\sample.avi")
audio = (Segmented)WavSource("d:\sample.avi")

brackets on segmented are only because the function as such currently doesn't exist

stereo = GetChannel(audio, 1, 1)
AudioDub(video, stereo)

If only there had been the "SegmentedWavSource" function as my captures are always segmented. "ConvertToMono" in this case would't help as this would cause volume variations as the right channel was sometimes cutting out.

Hope you'll see my point and the possible added functionality this would give.

I understand that it is very easy for me to write this as I have no idea on how all is fit together and what it would take to achieve such function. On the other hand I also hope you will give it some thought.

Thanks again for continueing this great program first started by Ben, wherever he might be at the moment.

Thumbs up to you all, Leon

sh0dan
9th May 2003, 23:27
Can't you do:

video = SegmentedAviSource("d:\sample.avi")
stereo = GetChannel(video, 1, 1)
AudioDub(video, stereo)


... or am I missing something rather large here? :confused:

Richard Berg
10th May 2003, 02:22
Furthermore, keep in mind that WavSource is just an alias -- AviSource (and thus SegmentedAviSource) can already read WAV files.

droopy928gt
10th May 2003, 09:51
@ ShOdan & Richard Berg

Hmmmm, I feel very much embarassed now, especially since it turns out to be this simple. From what I read in the documentation on GetChannel and AviSource/WavSource I didn't think the example you give to be possible ShOdan. Documentation states you would first have to open using WavSource before using GetChannel.

----------------------------
GetChannel quote:
# Removes right channel information, and return as mono clip with only left channel:
video = AviSource("c:\filename.avi")
stereo = WavSource("c:\afx-ab3_t4.wav")
mono = GetChannel(stereo, 1)
AudioDub(video, mono)

# Converts avi with "uncompressed multichannel wav" audio to a stereo signal:
video = AviSource("c:\divx_wav.avi")
audio = WavSource(c:\divx_wav.avi)
stereo = GetChannel(audio, 1, 2)
AudioDub(video, stereo)
----------------------------
AviSource / WavSource quote:
Up to v2.04, WAVSource was an alias to AVIFileSource. In later versions, WAVSource doesn't try to open the video stream anymore. It can be useful if you want to retrieve the audio stream from an AVI file but the video stream is damaged or its compression method is not supported on your system.

From v2.04 up there is built-in support for ACM (Audio Compression Manager) audio (e.g. mp3-AVIs). AVISource is also no longer able to open WAV-files, which must be accessed by using WAVSource.
----------------------------

Thanks for taking the effort in clarifying this and sorry for bothering you in this part of the forum with something which turned out to be a normal AviSynth usage question.

Best regards, Leon