View Single Post
Old 13th March 2022, 20:25   #12  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Not totally sure I used vs_average correctly, but here are some comments:
Code:
  sourceFps = clip.fps # fps the interpolated input has
  divider = 5 # set divider by which the frame rate should be lowered
  targetFPS  = clip.fps/divider # calculate target fps
  num = clip.num_frames; # <- set num to the number of frames the clip has
  
  out = clip[0] # <- set out to be the first frame of the clip  (<- this is probably not needed, or the the first frame should be dropped at the end)
  count = int(num/divider) # divide the number of frames through the ammount the frame rate should be lowered to get the output frame count
  for i in range(count): # for each frame
    clips = [None]*divider # create an array which can hold divider times elements (=1-frame clips)
    for j in range(divider): # fill the array
      clips[j]=clip[i+j] # with the frames
    i = i + divider;
    out =  out + core.average.Mean(clips) # merge the 1-frame clips to one frame and add it to the out
  # now out contains all the merged frames (and the first frame of the input clip)
  clip = out
  return clip # return the clip that was just created
hope this helps to understand what I thought, should be done.
(this was the first thing that popped into my mind how to use vs-average to archive what you described)

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote