VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Hello,

    I wanted to know if it is possible to detect and fix a video that in some scenes plays slowly.
    I have tried to solve the problem by re-encoding the video but it did not solve it.

    The video data is:
    mkvmerge v34.0.0 ('Sight and Seen') 64-bit, libebml v1.3.7 + libmatroska v1.5.0, V_MPEG4 / ISO / AVC, 25,000 FPS.

    Thanks a lot.
    Quote Quote  
  2. It depends on why it's playing slowly

    How are you playing it back ? What hardware or software player ?

    Is it a hardware issue ? Maybe your computer is too old/slow? Try another player, or other computer, or other faster hardware . If you're using HW acceleration, try disabling it. Is it a driver issue ? Try updating drivers. ie. Rule out a playback issue first

    Is the video the issue ? Was it not produced correctly ? is it a timestamp issue? or actual frames duplicated ?

    If you investigated and still don't know, post an original cut sample of the video (e.g. you can use mkvtoolnix)
    Quote Quote  
  3. The video is part of a series of 39 episodes, the one with problems is chapter 27, all the previous ones are reproduced correctly.

    The problem gives me it in the same scene in both VLC and MPC-HC.

    Hardware is an Intel Core I5-7400 3.00GHZ, 4096MB RAM.

    Attached is a fragment of the video in which you can see the slowness between seconds 14 and 18.
    Image Attached Files
    Quote Quote  
  4. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Didn't slow down for me.
    I think,therefore i am a hamster.
    Quote Quote  
  5. Member
    Join Date
    Aug 2002
    Location
    South Florida
    Search Comp PM
    Same here-no problem.
    Quote Quote  
  6. I upload the same scene from another file and what I see in the latter is that the scene is "cleaner", without jumps than if I saw in the first file I sent.

    In this file the scene between 34 and 42 seconds is correct. In the previous one, I see the same scene with small jumps.
    Image Attached Files
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jab66 View Post
    I upload the same scene from another file and what I see in the latter is that the scene is "cleaner", without jumps than if I saw in the first file I sent.

    In this file the scene between 34 and 42 seconds is correct. In the previous one, I see the same scene with small jumps.
    The first clip has occasional duplicate frames, probably the cause of the small "jumps"
    Quote Quote  
  8. Is there a way through ffmpeg or another tool to detect if there are duplicate frames?
    Thanks.
    Quote Quote  
  9. I didn't see any duplicate frames

    There are abundant blended frames, but both versions have them, but slightly different blend phases . They play about the same in several media players for me

    Describe what you mean by "plays slowly"
    Quote Quote  
  10. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    I didn't see any duplicate frames
    Possibly frame 414 in the first video; I thought I'd seen a couple more but when I looked again I couldn't
    find them
    Quote Quote  
  11. Originally Posted by davexnet View Post
    Originally Posted by poisondeathray View Post
    I didn't see any duplicate frames
    Possibly frame 414 in the first video; I thought I'd seen a couple more but when I looked again I couldn't
    find them
    Yes 414 is a partial duplicate of 413; but there is some additional ghosting in 414

    If that' s what he is referring to, there is no way that would be "automatically" detected correctly or accurately. You'd need something closer to a true duplicate without the added ghosting, otherwise you'd get too many false positives in other scenes with low motion

    Otherwise, there is good old manual identification and interpolation scripts


    Code:
    LWLibavVideoSource("sceneSlow.mkv")
    RX(414,1)
    
    
    
    function RX(clip Source, int N, int X)
    {
    # N is number of the 1st frame in Source that needs replacing.
    # X is total number of frames to replace
    #e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation
    
    start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
    end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
    
    start+end
    AssumeFPS(1) #temporarily FPS=1 to use mflowfps
    
    super = MSuper()
    backward_vec = MAnalyse(super, isb = true)
    forward_vec = MAnalyse(super, isb = false)
    MFlowFps(super, backward_vec, forward_vec, blend=false, num=X+1, den=1) #num=X+1
    AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
    Trim(1, framecount-1) #trim ends, leaving replacement frames
    
    Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
    }
    Image Attached Files
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    Originally Posted by davexnet View Post
    Originally Posted by poisondeathray View Post
    I didn't see any duplicate frames
    Possibly frame 414 in the first video; I thought I'd seen a couple more but when I looked again I couldn't
    find them
    Yes 414 is a partial duplicate of 413; but there is some additional ghosting in 414

    If that' s what he is referring to, there is no way that would be "automatically" detected correctly or accurately. You'd need something closer to a true duplicate without the added ghosting, otherwise you'd get too many false positives in other scenes with low motion

    Otherwise, there is good old manual identification and interpolation scripts


    Code:
    LWLibavVideoSource("sceneSlow.mkv")
    RX(414,1)
    
    
    
    function RX(clip Source, int N, int X)
    {
    # N is number of the 1st frame in Source that needs replacing.
    # X is total number of frames to replace
    #e.g. RX(101, 5) would replace 101,102,103,104,105 , by using 100 and 106 as reference points for mflowfps interpolation
    
    start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point
    end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point
    
    start+end
    AssumeFPS(1) #temporarily FPS=1 to use mflowfps
    
    super = MSuper()
    backward_vec = MAnalyse(super, isb = true)
    forward_vec = MAnalyse(super, isb = false)
    MFlowFps(super, backward_vec, forward_vec, blend=false, num=X+1, den=1) #num=X+1
    AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining
    Trim(1, framecount-1) #trim ends, leaving replacement frames
    
    Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0)
    }

    Very well. From what I understood the best way is to do it manually. Could you help me to know how you identified frame 414 and how did you fix it? I'm looking for a technique that, even if it's manual, helps me improve the video. Thank you.
    Quote Quote  
  13. Originally Posted by jab66 View Post

    Very well. From what I understood the best way is to do it manually. Could you help me to know how you identified frame 414 and how did you fix it? I'm looking for a technique that, even if it's manual, helps me improve the video. Thank you.


    I don't know if it's the "best" way... but if that's what you're referring to it's the most accurate for the identification stage. Manual ID is always the most accurate, but can be tedious. If you have other sections that are clear duplicates (I doubt it , given the blend cycle characteristics), then everything could be automatic because there are "automatic" scripts that replace 1 duplicate automatically according to a threshold value. e.g. "filldrops" and their variants

    That interpolation is a synthesized "in between frame" using motion vectors. So if 414 is flagged, it's calculated from 413 and 415. It's not perfect; there can be blobby edge artifacts, sometimes severe and distracting, but sometimes it's "good enough"

    That was done in avisynth. You'd have to go frame by frame (you can view in avspmod, or vdub2) to find out which frames you want replaced and enter them in the script. That RX function is written as framenumber, and number of frames, more than one frame in a row can be interpolated over

    There are duplicate frame detection scripts that might help you identify areas, but what you have really isn't a duplicate frame (I mean mathematically for "automatic" calculations) . It's a few % off. You're going to get a lot of false positives in low motion scenes
    Last edited by poisondeathray; 8th Nov 2020 at 21:48.
    Quote Quote  
  14. Attached is a dedup 1st pass log file . It's a duplicate detector, but only available as x86. You can run it through mp_pipeline in avisynth x64. But there is a bit of a learning curve for avisynth

    So you might be able to use that to help guide you and you decide if you want to fix the "duplicates" or not

    frm 413: diff from frm 414 = 2.7975% at (352,352)
    frm 525: diff from frm 526 = 1.5475% at (352,288)

    Low % values indicate small differences or very similar frames , or "duplicates"

    But some of the entries are <3% but clearly not "duplicates", because of low motion, so they are false positives
    Image Attached Files
    Quote Quote  



Similar Threads

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