Skip to content

An idea for a useful new feature #8

Description

@radpopl

Many people as I see on the videohelp.com forum use RIFE to remove corrupted frames or entire sequences of frames.

I have a suggestion/idea to add such a function:

RIFE_ReplaceFrames(src, from_frame, number_of_frames, model (optionally)

where:
src = video
from_frame = from which frame to insert interpolated frames
number_of_frames = number of frames to replace

and/or

RIFE_ReplaceFrames(src, file="frames.txt")

where in the file there would be frame numbers to replace:
100,1 (1 frame with number 100)
101,2 (frames 101 and 102)
200,5 (frames from 200 to 204)
#300,5 (comment, ignore this line)
[...]

I have such a script in AviSynth, but it only works for about 10-15 frames in the script. Above that, a large increase in memory usage causes AviSynth error.

function ReplaceFrameRIFE(clip Source, int N, int X, int "model")
{
  # N is number of the frame in Source that needs replacing. 
  # X is total number of frames to replace
  # e.g. (101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for interpolation
  
  model = default(model, 41)

  Trim(Source, N-1, length=1)+Trim(Source, N+X, length=1)
  Rife(gpu_thread=1, model=model, factor_num=X+1, factor_den=1, sc=false)
  AssumeFPS(Source.FrameRateNumerator, Source.FrameRateDenominator)
  Trim(1,X)
#Subtitle("RIFE", align=5) "" # optional label to verify replacement
  Source.trim(0,end=N-1) ++ last ++ Source.trim(N+X,0)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions