VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Oct 2019
    Location
    France
    Search PM
    Hi, I have an old animated film that I'm cleaning up and stabilizing to give it a more modern look.

    As is often the case with animation, it's mostly animated in 12fps and sometimes 8fps.
    I'd like to replace similar frames with others so they're 100% identical. Because of their analog nature (film), they have slight variations.

    Do you have any tips for detecting all the "similar frames" and replacing them with a single one please ?
    Quote Quote  
  2. First thing you should do is clean your source to remove noise&co.
    Then, if you want to do this manually, something like https://www.vapoursynth.com/doc/functions/video/freezeframes.html or ReplaceFramesSimple could be used.
    One could also write a small script to replace frames that only differ less than x with the previous frame.
    => should be easily doable with Avisynth or Vapoursynth
    I even wrote a Vapoursynth function for this a while ago:
    Code:
    def addDup(clip: vs.VideoNode, thresh: float = 0.3, debug: bool = False) -> vs.VideoNode:
        """
        Detects frames with low temporal difference compared to their predecessor and duplicates the previous frame
        if the difference is below the given threshold. Optionally adds debug metadata.
    
        Parameters:
            clip (vs.VideoNode): Input video clip.
            thresh (float): PlaneStatsDiff threshold for duplication.
            debug (bool): If True, adds debug props to output frames.
    
        Returns:
            vs.VideoNode: Modified clip with duplicates inserted when differences are below threshold.
        """
    ...
    (see: addDup)
    The function is small and documented, so understanding the idea behind it should be easy.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Member
    Join Date
    Dec 2005
    Location
    Finland
    Search Comp PM
    There is also an AviSynth plugin for this purpose: http://avisynth.nl/index.php/Dup
    Quote Quote  
  4. Ah, totally forgot about that.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  5. You can also try Filldrops which will replace a duplicate by an interpolate frame. But the frame must be tagged as Duplicate.

    Filldrops.avsi

    Code:
    function filldrops (clip c)
    {
    vf=c.mvanalyse(truemotion=true,pel=2,isb=false,delta=1,idx=1)
    vb=c.mvanalyse(truemotion=true,pel=2,isb=true,delta=1,idx=1)
    global filldrops_d = c.mvflowinter(vb,vf,time=50,idx=1)
    global filldrops_c = c
    c.scriptclip("""ydifferencefromprevious()==0? filldrops_d : filldrops_c""")
    
    }
    Last edited by Hunk91; 8th Dec 2025 at 15:23.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!