VideoHelp Forum

+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Hi guys...
    I have a problem with a video and I don't know if the problem is in duplicate frames or other...

    You can see the problem in the video:
    https://drive.google.com/file/d/11eq6OgZsyBnd26YVgvbRU7924PaEq4yo/view?usp=sharing

    These errors occurs in all the video, let me know if I can correct the entire video with a plugin or some other solution

    I have tried filldrops and dedup but the problems remain, probably I am wrong on the problem. Let me know, thanks.
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Stepping thru the video you see a good rhythm of 59.94 unique frames per second, but at 130-131, 330-331 you see a jump;
    the underlying frame is missing, it's not a duplicate issue.
    Wait and see if you get any further suggestions
    Quote Quote  
  3. Ok, thanks, I'll wait.
    Quote Quote  
  4. Every 50 frames there are two dropped frames: (probably at 31, 32), 81, 82, 131, 132, 181, 182, 231, 232, 281, 282... 431, 432...

    Smoother?
    Image Attached Files
    Last edited by jagabo; 21st Sep 2022 at 22:17. Reason: added sample
    Quote Quote  
  5. Please can you give me the code line and the plugin to use?

    I know this: SmoothD2
    SmoothD2(quant=3, num_shift=3, Matrix=3, Qtype=1, ZW=1, ZWce=1, ZWlmDark=0, ZWlmBright=255, ncpu=4)

    or
    MipSmooth
    MipSmooth(downsizer="lanczos", upsizer="bilinear", scalefactor=1.5, method="strong")

    or

    MSmooth
    clip = core.msmoosh.MSmooth(clip, threshold=3.0, strength=1)

    These are the default in Staxrip

    I have tried these and the result is not the same as yours.

    Please give me the name of the plugin and the line of code that you used, thanks.
    Last edited by salvo00786; 22nd Sep 2022 at 02:53.
    Quote Quote  
  6. First I used this "manual" script:

    Code:
    LWLibavVideoSource("frame problems.mkv") 
    
    InsertFramesMC(432)
    InsertFramesMC(431)
    
    InsertFramesMC(382)
    InsertFramesMC(381)
    InsertFramesMC(332)
    InsertFramesMC(331)
    
    InsertFramesMC(282)
    InsertFramesMC(281)
    InsertFramesMC(232)
    InsertFramesMC(231)
    
    InsertFramesMC(182)
    InsertFramesMC(181)
    InsertFramesMC(132)
    InsertFramesMC(131)
    
    InsertFramesMC(82)
    InsertFramesMC(81)
    InsertFramesMC(32)
    InsertFramesMC(31)
    InsertFramesMC() adds a motion interpolated frame at the indicated position. Search these forums for it. You will have to manually add more for the full length video. And you'll need to work backwards as adding frames increases the frame number of the remaining frames.

    Another approach is to double the frame rate then use SelectEvery() to pick out the frames you want:

    Code:
    LWLibavVideoSource("frame problems.mkv") 
    
    FrameRateConverter(FrameDouble=true)
    SelectEvery(100, 0,2,4,6,8,10,12,14,16,18,\
                     20,22,24,26,28,30,32,34,36,38,\
                     40,42,44,46,48,50,52,54,56,58,\
                     60,61,62,63,64,66,68,70,72,74,76,78,\
                     80,82,84,86,88,90,92,94,96,98)
    Here I used FrameRateConverter() to double the frame rate with motion interpolated frames between each of the original frames, then use SelectEvery() to select all the original frames (the even numbered frames after doubling) plus two motion interpolated frames (61 and 63). The benefit of using this method is that you don't have to go through the entire video and specify each interpolated frame. But it will fail if there is a change of cadence somewhere along the line.
    Quote Quote  
  7. Ok, the first method is a little problematic because the video has 318017 frames... I think that the problem is in the entire video.
    1) How can I analyze the entire video and see where are all the problems? There are software or plugin for this or I have to use my eyes?

    2) I used your second method on the same file, that I loaded here, but why my after encoding the framerate is not 59,94 but 62,34, probably because you used other two frames 61 and 63?

    3) This is a pure example only to understand your workaround. For example if I convert the file from 59,94 to 23,76 (not the exact half), your code is valid or you have to use another code? If I understood correctly if I convert the file to 29.97 (half of the framerate), I have to add 31 and 33 instead of 61 and 63, but if for example I convert the file to 23.76???

    Probably I have to add 25 and 27 in the code?

    For example I converted the file to 23.76. The code is good or wrong for this file?

    FrameRateConverter(FrameDouble=true)
    SelectEvery(100, 0,2,4,6,8,10,12,14,16,18,\
    20,22,24,25,26,27,28,30,32,34,36,38,\
    40,42,44,46,48,50,52,54,56,58,\
    60,62,64,66,68,70,72,74,76,78,\
    80,82,84,86,88,90,92,94,96,98)

    this is the 23.76 file
    https://drive.google.com/file/d/11hxKdcPX7HcE8MMhAyIIU-hg_cs_vMeC/view?usp=sharing

    4) This is another question, what is the difference between CAS and CASm?
    Last edited by salvo00786; 22nd Sep 2022 at 10:23.
    Quote Quote  
  8. Originally Posted by salvo00786 View Post
    1) How can I analyze the entire video and see where are all the problems? There are software or plugin for this or I have to use my eyes?
    You have to step through frame by frame looking for unexpected jumps in the motion. That can be hard to see in many shots. Since the pattern here is two frames in every 50 frames you can skip ahead by multiples of 50 frames and see if it's still consistent.

    Originally Posted by salvo00786 View Post
    2) I used your second method on the same file, that I loaded here, but why my after encoding the framerate is not 59,94 but 62,34, probably because you used other two frames 61 and 63?
    Since I added 2 frames to every group of 50 frames there are 4 percent more frames (52/50). If you want to keep the running time (to keep the audio in sync) you need to increase the frame rate proportionately. The alternative is to keep the frame rate at 59.94 (add AssumeFPS(60000,1001) at the end of the script) and lengthen the audio by 4 percent.

    Originally Posted by salvo00786 View Post
    3) This is a pure example only to understand your workaround. For example if I convert the file from 59,94 to 23,76 (not the exact half), your code is valid or you have to use another code?
    The frame rate and chosen frames I used was specifically to restore the missing frames halfway between 30 and 31, and 31 and 32, of every group of 50 frames of the of the original video.

    If you decimate 60p to 24p you are removing 36 out of every 60 frames. The process for restoring those 36 frames will be very different.

    Originally Posted by salvo00786 View Post
    4) This is another question, what is the difference between CAS and CASm?
    I dont' even know what that is referring to!
    Quote Quote  
  9. In Staxrip there are two contrast adaptive sharpening.

    One is CAS and the other is CASm.
    Quote Quote  
  10. Here's how you restore 60p from a 60p video that has been decimated 24p.

    Code:
    LWlibavVideoSource("60p.mkv") # 60p source
    ShowFrameNumber(x=20, y=20) # number the frames so we can identify the original frames.
    dec = ChangeFPS(24000, 1001) # leaves frames: 0, 2, 5, 7, 10, 12, 15, 17...
    #return(dec) # if you want to verify the decimation
    
    interp = Interframe(dec, Tuning="weak", NewNum=144000, NewDen=1001, cores=4) # frame rate * 6
    #return(interp) # if you want to see the 144 fps video
    SelectEvery(interp, 12, 0, 3, 6, 8, 10)
    Here I started with a 60p video (so we can compare the original 60p to the restored 60p) and decimated it to 24p. Between the frames of the 24p video there are sometimes one missing 60p frame (1/2 between the surrounding frames), sometimes two missing 60p frames (1/3 and 2/3 between the two surrounding frames), alternating between the two possibilities. To account for both possibilities we multiply the frame rate by 6 (24 * 6 = 144). Then we pick out the appropriate frames with SelectEvery().

    As you can see the final result is as smooth as the original video and has the same runtime. But you can tell some frames are interpolated by looking closely at the frame numbers and other interpolation artifacts.

    Note that the SelectEvery pattern will be a little difference if your sequence starts with two missing frames rather than one. I'm sure you can figure that out...

    The final result stacked below the original video:
    Image Attached Files
    Quote Quote  
  11. Ok, thanks for your explanation.
    Quote Quote  
  12. Now I will try these on some videos.
    Quote Quote  
  13. Keep in mind that the technique is specifically for 24p video that was decimated from a native 60p source. It is not for native 24p video (like movies) where successive frames originated at 24p intervals.

    When starting with video that's already been decimated to 24p the script will look like:

    Code:
    LWlibavVideoSource("24p.mkv") # a 24p video that has already been decimated from 60p
    
    interp = Interframe(dec, Tuning="weak", NewNum=144000, NewDen=1001, cores=4) # frame rate * 6
    SelectEvery(interp, 12, 0, 3, 6, 8, 10)
    I also removed the lines which were just informative. And the decimation pattern must be consistent over the entire video.

    And lastly, motion interpolation often doesn't work well. So don't be surprised if you see gross distortions in some shots.
    Last edited by jagabo; 24th Sep 2022 at 06:43.
    Quote Quote  



Similar Threads