Log in

View Full Version : random editing script


Mug Funky
26th July 2003, 09:24
hey y'all. i was helping a friend make a Grindcore metal video clip, and struck upon a script that would be quite useful for people who want very fast editing, and don't care too much what is included...


clip=avisource("smallclips_.avi")

chunk1=unalignedsplice(clip.trim(rand(clip.framecount - 5),-5), clip.trim(rand(clip.framecount - 5),-5))
chunk2=unalignedsplice(clip.trim(rand(clip.framecount - 5),-5), clip.trim(rand(clip.framecount - 5),-5))
chunk3=unalignedsplice(clip.trim(rand(clip.framecount - 5),-5), clip.trim(rand(clip.framecount - 5),-5))


unalignedsplice(chunk1,chunk2,chunk3)


basically, you can repeat the clip.trim(rand... etc bits as much as you want (well, 64 times, according to avisynth's limits) and put as many "chunk=" lines in as you want.

what comes out is a video made entirely of 5 frame chunks of video, in random order. very useful for extremely fast music videos.

i had a 2gig compilation of war footage, nukes, horror scenes, and anime violence (it was after all death metal), and this script spat out the most awesome junk ever. so i thought i'd post it here for people to use, modify, or just harness the idea from, etc.

hope someone finds a use. i like to share my scripts (but i have no idea how to add these to the avisynth site...)

cweb
29th July 2003, 17:19
Here's my modification to try to randomize it a bit more:

# random script
point1=rand(video.framecount - 5,seed=TRUE)
point2=rand(video.framecount - 5,seed=FALSE)
chunk1=unalignedsplice(video.trim(point1,-5), video.trim(point2,-5))

point1=rand(video.framecount - 5,seed=FALSE)
point2=rand(video.framecount - 5,seed=FALSE)
chunk2=unalignedsplice(video.trim(point1,-5), video.trim(point2,-5))

point1=rand(video.framecount - 5,seed=FALSE)
point2=rand(video.framecount - 5,seed=FALSE)
chunk3=unalignedsplice(video.trim(point1,-5), video.trim(point2,-5))

video=unalignedsplice(chunk1,chunk2,chunk3)


Notice the first line with seed=TRUE to try to use a random seed based on the system time. However I can only use it once as it will return the same values if I call it again (the system time hasn't changed!).

Edit: It isn't as good as I would like due to the seed problem..