VideoHelp Forum
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    I have this music video VOB that is 30i but is converted from a 25i source and has some weird frame duplication every couple of frames and i can't figure out how to fix it. Can anyone here help?

    Attached is a 30 second untouched clip of the VOB file. Thanks in advance!

    clip.vob
    Quote Quote  
  2. Just remove the duplicate frames before deinterlacing:

    Code:
    Mpeg2Source("clip.d2v", CPU2="ooooxx", Info=3) 
    TDecimate(Cycle=6, CycleR=1)
    QTGMC()
    Image Attached Files
    Quote Quote  
  3. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Wow. That seems to have helped a lot but there are still ocassional frame duplications that cause the image to look jittery
    Quote Quote  
  4. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by Fedex View Post
    Wow. That seems to have helped a lot but there are still ocassional frame duplications that cause the image to look jittery
    Oh. Sorry, i forgot to put AssumeTFF(). Once i put that it looks perfect. Thanks for your help
    Quote Quote  
  5. Mpeg2Source(... Info=3) sets the field order flag. Some other source filters don't.
    Quote Quote  
  6. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    Mpeg2Source(... Info=3) sets the field order flag. Some other source filters don't.
    I was using FFmpegSource2()... I guess that's why the field order wasn't set
    Quote Quote  
  7. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Ok so. That music video comes from a VHS Rip (i don't know how it was ripped and converted to 30i). There are more music videos on the DVD and i can notice some left over "duplication" (frames 1677 to 1679 after deinterlace) and some weird mess up from time to time (frames 7 to 8 after deinterlace).

    My script is:
    Code:
    v = MPEG2Source("cliptest.d2v")
    a = DirectShowSource("cliptest.mp2")
    audiodub(v, a)
    assumetff()
    ChangeFPS(30)
    Tdecimate(cycler=1, cycle=6)
    QTGMC()
    https://www.mediafire.com/file/pkvty69lnc9pycd/cliptest.vob/file
    Quote Quote  
  8. ChangeFPS adds duplicate frames when increasing the frame rate. You can use ChangeFPS(50) after QTGMC if you need 50 fps at the end (one duplicate every 1001 frames). Or AssumeFPS(25 sync_audio=true) to speed the video and audio up by 0.1 percent.
    Quote Quote  
  9. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    ChangeFPS adds duplicate frames when increasing the frame rate. You can use ChangeFPS(50) after QTGMC if you need 50 fps at the end (one duplicate every 1001 frames). Or AssumeFPS(25 sync_audio=true) to speed the video and audio up by 0.1 percent.
    Ok... I'll try that. About the jittery frames leftover i don't know if that has to do with ChangeFPS
    Quote Quote  
  10. Change FPS will duplicate frames to increase the frame rate from 29.97 to 30 fps. When you decimate to remove 1 of every 6 frames there are still some duplicate interlaced frames that were created by ChangeFPS. Since each interlaced frame contains two consecutive pictures, the duplicates repeat the motion. Normally:

    Code:
    interlaced         deinterlaced
    01 23 45 67... --> 0 1 2 3 4 5 6 7...
    Interlaced frames 01 23 45 and 67 are bob deinterlaced to become 0 1 2 3 4 5 6 7 with smooth motion.

    But if one of the interlaced frames is duplicated you get something like:

    Code:
    interlaced             deinterlaced
    01 23 23 45 67...  --> 0 1 2 3 2 3 4 5 6 7...
    Frame 23 is duplicated so motion 2 3 is repeated. Ie, you see 2, then 3, then go back to 2, then forward to 3 again, then continue with 4 5 6 7... Hence the jitter.
    Quote Quote  
  11. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    ChangeFPS adds duplicate frames when increasing the frame rate. You can use ChangeFPS(50) after QTGMC if you need 50 fps at the end (one duplicate every 1001 frames). Or AssumeFPS(25 sync_audio=true) to speed the video and audio up by 0.1 percent.
    Ok so. Both messups are still there just that in different frame numbers. Do you know any other way to fix this? Thanks in advance
    Quote Quote  
  12. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    Change FPS will duplicate frames to increase the frame rate from 29.97 to 30 fps. When you decimate to remove 1 of every 6 frames there are still some duplicate interlaced frames that were created by ChangeFPS. Since each interlaced frame contains two consecutive pictures, the duplicates repeat the motion. Normally:

    Code:
    interlaced         deinterlaced
    01 23 45 67... --> 0 1 2 3 4 5 6 7...
    Interlaced frames 01 23 45 and 67 are bob deinterlaced to become 0 1 2 3 4 5 6 7 with smooth motion.

    But if one of the interlaced frames is duplicated you get something like:

    Code:
    interlaced             deinterlaced
    01 23 23 45 67...  --> 0 1 2 3 2 3 4 5 6 7...
    Frame 23 is duplicated so motion 2 3 is repeated. Ie, you see 2, then 3, then go back to 2, then forward to 3 again, then continue with 4 5 6 7... Hence the jitter.
    Yeah but i don't know if you see that ocasionally there is like 3 or 2 frames out of order that look like deinterlacing TFF content with BFF mode (or viceversa). You can appreciate it more at frames 7 and 8 in the cliptest script

    EDIT: I see what you mean now. The jitter is noticeable even without ChangeFPS
    Quote Quote  
  13. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    I've experimented with putting ChangeFPS before and after QTGMC or before and after Tdecimate but still haven't been able to solve it
    Quote Quote  
  14. ChangeFPS after QTGMC will create a little jerk every 30 seconds or so -- because it will duplicate frames to change the rate. Other possible problems:

    Sometimes TDecimate will make a mistake. Compression artifacts in a duplicate may outweigh motion in other frames making it throw out the wrong frame. You can try playing around with TDecimate's parameters might help with this.

    Your video may simply have extra duplicates from a bad capture. Capture devices often repeat the prior frame when a new frame doesn't arrive in time. Problems like this will probably require manual fixes.

    Music videos often have duplicate or missing frames or fields from their editing -- when the video is sped up or slowed down to match the music.

    Are you still using ffVideoSource? It is not always frame accurate, especially with random seeking (which may be occur with temporal filters like TDecimate and QTGMC, and encoding with inter-frame codecs). I highly recommend using Mpeg2Source for MPEG 2 video.
    Quote Quote  
  15. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    ChangeFPS after QTGMC will create a little jerk every 30 seconds or so -- because it will duplicate frames to change the rate. Other possible problems:

    Sometimes TDecimate will make a mistake. Compression artifacts in a duplicate may outweigh motion in other frames making it throw out the wrong frame. You can try playing around with TDecimate's parameters might help with this.

    Your video may simply have extra duplicates from a bad capture. Capture devices often repeat the prior frame when a new frame doesn't arrive in time. Problems like this will probably require manual fixes.

    Music videos often have duplicate or missing frames or fields from their editing -- when the video is sped up or slowed down to match the music.

    Are you still using ffVideoSource? It is not always frame accurate, especially with random seeking (which may be occur with temporal filters like TDecimate and QTGMC, and encoding with inter-frame codecs). I highly recommend using Mpeg2Source for MPEG 2 video.
    I'm using Mpeg2Source()
    Quote Quote  
  16. With cliptest.vob from post #7 I only noticed one back and forth motion near the very start with:

    Code:
    Mpeg2Source("cliptest.d2v", CPU2="ooooxx", Info=3) 
    TDecimate(Cycle=6, CycleR=1) 
    QTGMC(preset="fast")
    I believe that has to do with the fade from black interfering with the duplicate detection.
    Quote Quote  
  17. Member
    Join Date
    Jun 2022
    Location
    Argentina
    Search PM
    Originally Posted by jagabo View Post
    With cliptest.vob from post #7 I only noticed one back and forth motion near the very start with:

    Code:
    Mpeg2Source("cliptest.d2v", CPU2="ooooxx", Info=3) 
    TDecimate(Cycle=6, CycleR=1) 
    QTGMC(preset="fast")
    I believe that has to do with the fade from black interfering with the duplicate detection.
    In this new test clip i attached (frames 424 to 427 after deinterlace) it's VERY noticeable as it looks like wrong field order (i tried AssumeBFF on that part but didn't help). The original 30i VOB had that problem too so i don't know how to go about fixing that (maybe frame duplication?)

    (I used the same script i used on post #7 so the frame number i say is after the conversion)

    https://www.mediafire.com/file/rsbys5ftr4ngluq/test2.vob/file
    Quote Quote  
  18. You can fix problems like that manually. Here I use a filter than uses motion interpolation to replace frames 422 (the first out of place frame) through 425 (the last out of place frame):

    Code:
    function ReplaceFramesMC(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
     
     X = Default(X, 1)
    
     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(pel=2, hpad=0, vpad=0, rfilter=4)
     backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
     forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
     backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
     forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
     backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
     forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
     MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0)
    
     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)
    }
    
    
    Mpeg2Source("C:\Users\John\Desktop\FedEx\test2.d2v", CPU2="ooooxx", Info=3) 
    TDecimate(Cycle=6, CycleR=1) 
    QTGMC(preset="fast")
    
    ReplaceFramesMC(422, 4) # replace frames 422 through 425 with motion interpolated frames
    Motion interpolation like this sometimes introduces gross distortions. It works pretty well here.
    Image Attached Files
    Quote Quote  



Similar Threads

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