VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 37
Thread
  1. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Gday all, I've been given an MP4 (the only available format of this video) and noticed that it seemed a little jerky or hesitant. Stepping through with VDub, I found every 6th (I think) frame is a copy of the previous. I did try Framerateconverter before I discovered the 6th freeze frame. That seemed to help a bit but I found it had, as expected I suppose, a double freeze every 12 frames.

    I'd be grateful if someone could point me towards code which would correct this.

    I've attached a LAGS copy of a portion of the video, which shows the problem.

    Thanks.
    Image Attached Files
    Quote Quote  
  2. Try
    Code:
    AVISource("M3.avi")
    ConvertToYV16()
    Tdecimate(cycle=5,cycleR=1)
    It returns the original 24fps progressive frames.

    Edit:
    In case you absolutely need a 25i or 30i (29.97i) fps version I would consider telecining rather than interpolating, to avoid the sometimes ugly interpolation artifacts. Attached a hard-telecined 25fps and 29.97fps version. (For 25p a simple speedup would also do).
    Image Attached Files
    Last edited by Sharc; 6th Jun 2023 at 11:31.
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Great stuff Sharc, that worked perfectly, although I'm sure this filter setup is sending me to an early grave. I tried TDeint 1.8.7 from the download page but that didn't work ("TDecimate not found"), normal, + or 64 and +, so I downloaded TIVTC as well and put that into every plugin folder I had and it now works. Are they dependent on each other? If so, it would be nice for the wiki to say that. Anyway, I'm up and running. Now I'm going to try to add Framerateconverter to it.
    Quote Quote  
  4. See my note about telecining for frame rate conversion. I usually prefer it. Compare how it looks on your TV.

    Edit:
    I applied 'hard-telecining' for the examples above. x264 would also support soft-telecine (Euro-pulldown for 25fps or 2-3 pulldown for 30fps which is more efficient. Your player would have to respect the flags though.
    Last edited by Sharc; 6th Jun 2023 at 05:02.
    Quote Quote  
  5. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    No issue with 24fps here (I don't think, PAL land but will try on TV) and it'll be going onto YT so that won't matter either.

    See my note about telecining for frame rate conversion.
    I've looked, find it, I cannot. Where for art thou, note?
    Quote Quote  
  6. See 'Edit' in post#2.
    Quote Quote  
  7. Just for complenteness, I attached an example of replacing the duplicates with interpolated frames.
    (I used this Vapoursynth script.)

    Cu Selur
    Image Attached Files
    Last edited by Selur; 6th Jun 2023 at 22:16.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. Originally Posted by Selur View Post
    I attached an example of replacing the duplicates with interpolated frames.
    frames were actually not interpolated, had to change threshold, did not do rife but svp, but I guess that's the same:

    Code:
    fdf = FillDuplicateFrames(clip, thresh=0.002, method='SVPcpu')
    clip = fdf.out
    Quote Quote  
  9. Damn, updated the download to a rife with 0.003 which seems to work fine.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  10. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Continuing on with this project, I have just watched this decimated video on my TV and to my horror spotted a jump every 24 or so frames! Ugh.

    I'd be very grateful for any suggestions/advice on how to tackle this jump. It is really annoying me, to the point where I think the undecimated version is better to look at.

    Unfortunately, I don't have access to any copies apart from the one attached (which is a snip of the full MP4).

    Here's my decimate code:

    Code:
    LSmashVideoSource("F:\Flying\Mirage Movie - Fish\Fish 2023\Cloud Snip.mp4")
    ConvertToYV16()
    Tdecimate(cycle=5,cycleR=1)
    For example, there is a jump between frame 15 and 16. The movement seems to be twice the normal movement, as though one frame is missing.
    Image Attached Files
    Last edited by Alwyn; 1st Jul 2023 at 01:14.
    Quote Quote  
  11. Sticking with 30fps and using FillDrops (thresh=0.0006) seems to be fine,...
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks Selur, I tried Filldrops with Staxrip but couldn't get it to even decimate.

    I found this topic:

    https://forum.videohelp.com/threads/402416-repair-Videos-with-duplicates-and-dropped-frames

    But can't work out how Filldrops is actually used. Is it in an AVS?
    Quote Quote  
  13. TDecimate(Cycle=6, CycleR=1)
    Quote Quote  
  14. FillDrops does not decimate it replaced duplicate frames with interpolations.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  15. Originally Posted by jagabo View Post
    TDecimate(Cycle=6, CycleR=1)
    Yes. I probably had a mental blackout when I suggested Cycle=5, decimating to 24fps.
    Quote Quote  
  16. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Well there you go, Jagabo. I don't understand why, but it looks like the jump has gone. Thank you.

    In the words of an iconic American scientist, Julius Sumner Millar,

    "Why is it so?".

    I would have thought if cycle 5 was not correct, I'd see more of the duped frames than only one every 24.

    Originally Posted by Selur
    FillDrops does not decimate it replaced duplicate frames with interpolations
    .
    Thanks Selur, I think I see a slightly variable frame rate as I step through; no dupes, as such, but a hint of variability.

    I probably had a mental blackout when I suggested Cycle=5, decimating to 24fps.
    The headmaster wants to have a chat!
    Quote Quote  
  17. Don't you get better results by using TFM to provide guidance to TDecimate? All of my IVTC scripts have a call to TFM prior to TDecimate. They're part of the same package, so it would be trivial to test this.
    Quote Quote  
  18. Thanks Selur, I think I see a slightly variable frame rate as I step through; no dupes, as such, but a hint of variability.
    No clue where you see variable frame rate. FillDrops will simply look if there are frames like A-A-B and then create A-interpolate(A,B)-B to create an intermediate frame that replaces the duplicate. I does not change the frame rate.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Selur, fair enough. How did you actually use Filldrops? Via an AVS?
    Quote Quote  
  20. Originally Posted by Alwyn View Post
    "Why is it so?".

    I would have thought if cycle 5 was not correct, I'd see more of the duped frames than only one every 24.
    Think of it like this: Removing 1 of every 5 frames leaves you with 4/5 of the original frames. 30 * 4/5 = 24. Removing 1 of every 6 frames leaves you with 5/6 of the original frames. 30 * 5/6 = 25.

    The sample had a duplicate every six frames. So it's obvious one of every six has to be remove. 25p to 30p with duplicates like that is not uncommon.
    Quote Quote  
  21. Selur, fair enough. How did you actually use Filldrops? Via an AVS?
    I use it through Vapoursynth, but one can use it through Avisynth too.
    https://forum.videohelp.com/threads/402416-repair-Videos-with-duplicates-and-dropped-f...es#post2624941 describes how to use it in StaxRip.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  22. Originally Posted by Alwyn View Post
    Selur, fair enough. How did you actually use Filldrops? Via an AVS?
    Filldrops is a badly misnamed AVISynth script written many years ago by MugFunky and posted at doom9.org:

    automated framedrop filler script

    It is badly named because it replaced duplicates, not drops. You can adjust the settings so it replaces frames which are almost duplicates. This is often useful in analog captures.

    I later wrote a derivative script which makes it work with interlaced material, but more importantly, I updated it to work with MVTools2 rather than the original MVTools:

    Fix duplicate frames resulting from bad analog capture

    There is now a newer algorithm for producing interpolated frames called RIFE which I haven't yet used. Perhaps someone will further update this excellent and very useful script to use that instead of MVTools2.
    Quote Quote  
  23. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Originally Posted by Jagabo
    Removing 1 of every 6 frames leaves you with 5/6 of the original frames. 30 * 5/6 = 25.
    Thanks. 25fps, of course. Normal around here! I should have guessed.

    Originally Posted by Selur
    describes how to use it in StaxRip.
    As I said, tried that, didn't work.

    Thanks John, hopefully this will be the end of this exercise, my head is hurting. You mention TFM, I read the wiki, but what is the actual syntax/example for the three basic parameters , especially the PP? The wiki is characteristically hazy: "int PP. string ovr,".
    Quote Quote  
  24. Ah, there it came from.
    I wrote a Vapoursynth version of it a while ago, which allows you to choose between mv, svp, svp_gpu, rife and gmfssfortuna for the interpolation.
    I also wrote FillDuplicateFrames which allows replacing more than one duplicate in a row. (SVPcpu, SVP, MV, RIFE are available for interpolation)

    One could probably also expand the Avisynth version to support RIFE.

    Cu Selur

    Ps.: I also wrote a Vapoursynth script which replaces black frames with interpolations.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  25. Filldrops is not appropriate for this video. The duplicates are not fill-ins for missing frames. They are simply duplicates from a frame rate conversion.

    Here's a variation of filldrops that's easily modified to use whatever frame rate doubler you want:

    Code:
    function filldrops(clip c, float "threshold")
    {
      threshold = default(threshold, 0.2)
    
    # pick one of the following, or add a frame doubler of your choice
    #  intermediates = c.InterFrame(cores=4)
    #  intermediates = c.FrameRateConverter()
    #  intermediates = c.DoubleFPS2()
      intermediates = c.ConvertToPlanarRGB(matrix="rec709").ConvertBits(32).Rife(gpu_thread=1, model=9).ConvertBits(8).ConvertToYV12(matrix="rec709")
    
      intermediates = intermediates.SelectOdd() # the odd numbered frames are all the motion estimated frames
    
      ConditionalFilter(c, intermediates.Subtitle("intermediate"), c, "YDifferenceFromPrevious()", "lessthan", String(threshold))
    }
    The calling sequence for RIFE isn't optimal but it uses only AviSynth+'s built in filters. It also assumes the source is YV12. An alternate sequence is:

    Code:
    intermediates = c.z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f").Rife(gpu_thread=1, model=9).z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    That should be a little faster but requires z's AvsResize. http://avisynth.nl/index.php/Avsresize
    Last edited by jagabo; 1st Jul 2023 at 12:11.
    Quote Quote  
  26. They are simply duplicates from a frame rate conversion.
    Isn't that even more an argument on why filldrops should be used, to fix the frame rate conversion?
    To me, 'appropriate' seems more like a question of 'taste' in this case.
    Just wanted to mention an alternative solution.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  27. Originally Posted by Selur View Post
    They are simply duplicates from a frame rate conversion.
    Isn't that even more an argument on why filldrops should be used, to fix the frame rate conversion?
    To me, 'appropriate' seems more like a question of 'taste' in this case.
    Just wanted to mention an alternative solution.

    Cu Selur

    No, because the frames will not be "evenly spaced in time" if you use interpolation before decimation for this situation = judder

    You must remove the inserted duplicates, then interpolate to whatever framerate
    Quote Quote  
  28. Okay, you misunderstood my intention. I would not use any decimate, but stick with the current frame rate.
    (I agree interpolation before decimation makes no sense.)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  29. Originally Posted by Selur View Post
    Okay, you misunderstood my intention. I would not use any decimate, but stick with the current frame rate.
    (I agree interpolation before decimation makes no sense.)
    Stick with the current frame rate (as in do nothing) ? Or apply filldrops/some variation ?

    On a 60Hz display in NTSC land, or a judderless display with variable refresh rates, maybe 30FPS is ok, if the 25=> 30FPS was done correctly , otherwise there will be judder from the display (OP is in Australia, 50Hz) . eg. If display runs at 300Hz , it will look ok

    But the 30FPS=>30FPS with filldrops will have judder on any display (even a judderless display), unless you decimate first.

    If you decimate first, the 25FPS is "proper" , frames are "evenly spaced in time." Then you interpolate to the LCM of 25 and 30, which is 150FPS, and pick every 5th frame, to keep them evenly spaced in time = no judder (that's what some of the tools, framerate interpolation chips do in the background, mathematically)
    Quote Quote  
  30. Apply filldrops stick with result.
    But the 30FPS=>30FPS with filldrops will have judder on any display (even a judderless display), unless you decimate first.
    looked fine to me in post #11
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads

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