ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Total frame randomization of a video

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Daun
Total frame randomization of a video
on Dec 29, 2016 at 7:35:23 pm
Last Edited By Daniel Daun on Dec 29, 2016 at 7:36:05 pm

I'm triying to randomize every frame of a 30 fps 9 minutes video.
My goal is to mix every single frame leaving inalterated their duration, their will only change order (every still image will be 1 frame long).
I tried with many codes found online but they always work on short video and implementing loops,
I don't need looping, I need that's there's not repetition and every frame appears once, leaving the lenght of the total video unchanged.
I tried to separate the video in jpeg, the result were something like 16k images that I don't know what to do with... and going like that I lose the audio part.

I'm using a code from the evergreen motionscript...

The thing is that I don't know if this code doesn't repeat images (I can't say by the video)... I need that every frame appears just once, and it seems to me that I still lose the audio part... Is this code good? There's a way to keep the audio (I need it randomized liek the video, every frame should have its short sound)....?

Thanks for helping.

segDur = .1;// duration of each "segment" of random time, I changed it from .5 to .1 (I'm working at 1 frame right?)
minVal = inPoint;
maxVal = outPoint - segDur;

seed = Math.floor(time/segDur);

Return to posts index

Dan Ebberts
Re: Total frame randomization of a video
on Dec 29, 2016 at 8:48:52 pm

Maybe something like this for time remapping:

numFrames = 16200;
a = [];
for (i = 0; i < numFrames; i++)a.push(i);
for (i = 0; i < numFrames; i++){
idx = i + Math.floor(random(a.length - i));
temp = a[i];
a[i] = a[idx];
a[idx] = temp;
idx = timeToFrames(time)%numFrames;

The audio could be a problem though because of the rewind chirp you get when changing the time.

It might be slow with so many frames, so you might want to convert the expression to keyframes.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved