Chainmax
7th December 2005, 23:25
I have a series of short clips made from a digital camera. I'd like to process them and join them together using one script, instead of using the script on each clip, encode to HuffYUV and then join with VDubMod. How can I do that?
Guest
8th December 2005, 00:09
Example:
clip1=avisource("clip1.avi")
clip2=avisource("clip2.avi")
clip1=your_desired_filter(clip1, ...)
clip2=your_desired_filter(clip2, ...)
# repeat as required for other filtering
return clip1++clip2
gzarkadas
8th December 2005, 02:33
If your series is more than ten but less than ~70 clips and the clips have uniform names, say:
{path_prefix}{changing part}{.extension}
you can use the array facilities of AVSLib to save yourself typing the same things over again.
The following example (*) demonstrates the idea. It assumes that changing part is a zero based, zero padded, length=3 number sequence:
Import({path to AVSLib header file})
prefix = {your path prefix}
ext = {your clips' extension}
npad = 3
nitems = {your number of clips}
Function LeftPad(string s, int digits) {
return StrLen(s) >= digits ? s : LeftPad("0" + s, digits)
}
Function ClipFromSequence(int index, string prefix, int npad, string ext)
{
name = prefix + LeftPad(String(index), npad) + ext
return AVISource(name)
}
indexes = ArrayRange(0, nitems - 1)
func_args = StrQuote(prefix) + "," + String(npad) + "," + StrQuote(ext)
clips = indexes.ArrayOpFunc("ClipFromSequence", func_args)
# now clips is an array of clips; you can batch-apply filters, say:
clips = clips.ArrayOpFunc("AssumeFPS", "25")
clips = clips.ArrayOpFunc("BilinearResize", "640,480")
clips = clips.ArrayOpFunc("Trim", "0,2000")
...
# and then join them
return clips.ArraySum() # unalignedsplice
# if you want alignedsplice, or a transition (must accept two clips)
# pass it as the sum_func argument
# return clips.ArraySum(sum_func="AlignedSplice")
If your series has more than 70 clips, you will have a trouble to load them with Avisynth (there are threads around explaining why, but I haven't any ready to paste the URL); either try DirectShowSource to go up to ~90, or code the script such that it conditionally process a part of the sequence (say replace 0 in ArrayRange with a "start" variable).
____________________
(*) under the usual GPL version 2.0 or later licencing
Chainmax
8th December 2005, 11:56
Thanks for the quick answers :).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.