VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Hi guys,

    I have a fair amount of experience with digital video. I usually use Virtualdub however I realise AVIsynth may be the appropriate tool for this job.

    The footage here is sourced from a miniDV NTSC tape. The frametrate is currently 29fps however I'm not sure what the original framerate of the footage was when it was originallly shot.

    Here is a clip of the footage - https://www.sendspace.com/file/grhwyo

    I'm interesting in the best way to IVTC it. I've tried the auto IVTC in virtualdub however there are still some combed frames left over.

    10-11 seconds into the source video (where the 2 ladys are running) there is no interlacing which is strange. When doing the IVTC in vDub, interlacing appears on that segement. Does the video contain both interlaced and de-interlaced footage? Can this be IVTCed?

    Here is a sample of the footage -

    Any help would be greatly appreciated. I would like to learn more and develop my IVTC-ing abilities.
    Quote Quote  
  2. Most of the video is 24p but the short segment of the two women running is 30p. If you IVTC the whole clip to 24p the 30p shot will get jerky (see attached video). If that's the only 30p shot it probably isn't worth worrying about.

    AviSynth script:

    Code:
    AviSource("Video 1.avi") 
    TFM() # field match
    TDecimate() #reduce 29.97 fps to 23976 fps, preferentially discarding duplicate frames
    Resulting video (no audio):
    Image Attached Files
    Quote Quote  
  3. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by jagabo View Post
    Most of the video is 24p but the short segment of the two women running is 30p. If you IVTC the whole clip to 24p the 30p shot will get jerky (see attached video). If that's the only 30p shot it probably isn't worth worrying about.

    AviSynth script:

    Code:
    AviSource("Video 1.avi") 
    TFM() # field match
    TDecimate() #reduce 29.97 fps to 23976 fps, preferentially discarding duplicate frames
    Resulting video (no audio):

    Thanks. I'll try your recommendation. Out of interest would it possible to perform the IVTC in virtualdub to achieve the same result as AVisynth?
    Quote Quote  
  4. I haven't really used VirtualDub's IVTC function enough to say.
    Quote Quote  
  5. TFM/TDecimate is so good, I can't imagine using anything else. It does many sophisticated tests to make sure the fields are matched and then decimated correctly.
    Quote Quote  
  6. The particular 30p shot is mostly panning and can be converted fairly well to 25p with motion interpolation.

    Code:
    import("C:\Program Files (x86)\AviSynth\plugins\SmoothFPS2.avs") 
    
    AviSource("Video 1.avi") 
    
    part1 = Trim(0, 308).TFM().TDecimate()
    part2 = Trim(309, 343).SmoothFPS2(24000,1001)
    part3 = Trim(344,0).TFM().TDecimate()
    
    part1+part2+part3
    SmoothFPS2() can be found here: https://forum.videohelp.com/threads/335908-How-can-I-get-the-smoothest-slow-motion-out...ip#post2085931

    This type of motion interpolation can result in gross distortions but it works pretty well here.
    Image Attached Files
    Quote Quote  
  7. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by jagabo View Post
    Most of the video is 24p but the short segment of the two women running is 30p. If you IVTC the whole clip to 24p the 30p shot will get jerky (see attached video). If that's the only 30p shot it probably isn't worth worrying about.

    AviSynth script:

    Code:
    AviSource("Video 1.avi") 
    TFM() # field match
    TDecimate() #reduce 29.97 fps to 23976 fps, preferentially discarding duplicate frames
    Resulting video (no audio):

    How did you establish the framerate of the different scenes in the video?
    Quote Quote  
  8. Originally Posted by Imy View Post
    How did you establish the framerate of the different scenes in the video?
    I bobbed the video (Bob Doubler in VirtualDub, Bob() in AviSynth and counted duplicate (aside from bob artifacts) frames. Most of the video had a 2:3 pattern of duplicates Ie, AABBBCCDDD... That means 2 two film frames was converted to 5 fields. 2/5 of 59.94 is 23.976. In the 30p shot every frame was repeated once, ie AABBCCDD... 1/2 of 59.94 is 29.97.
    Quote Quote  
  9. Try this along with TIVTC to remove or hide the artifacts you do not wish to see.

    Santiag()
    Quote Quote  
  10. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    I cannot find SmoothFPS2.avs anywhere. Does anyone have it so I can put it in my plugins folder?
    Quote Quote  
  11. jagabo gave you a link to it in his post #4.

    Did you not see it or not understand what it was? It's a function. You make an AVS out of it, put that AVS somewhere like the plugins folder and then use it in your script as he showed in an example in the link.
    Quote Quote  
  12. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by manono View Post
    jagabo gave you a link to it in his post #4.

    Did you not see it or not understand what it was? It's a function. You make an AVS out of it, put that AVS somewhere like the plugins folder and then use it in your script as he showed in an example in the link.
    Apologies. Although I am experienced with digital video, I am an AVIsynth novice.

    I created SmoothFPS.avs in the Avisynth plugins folder with the following code:

    function SmoothFPS(clip source, float fps) {
    fp=fps*100
    backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
    # we use explicit idx for more fast processing
    forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
    cropped = source.crop(4,4,-4,-4) # by half of block size 8
    backward_vec2 = cropped.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2)
    forward_vec2 = cropped.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2)
    return source.MVFlowFps2(backward_vec, forward_vec, backward_vec2, forward_vec2, num=int(fp), den=100, idx=1, idx2=2)
    }

    DirectShowSource("video.ext") #or whatever is appropriate for your source
    AssumeFPS(10) # 60 fps slowed to 1/6, 10 fps
    SmoothFPS(30) # interpolate new frames to 30 fps


    I then created a avs file in the same folder as the source video with the following code:

    import("C:\Program Files (x86)\AviSynth\plugins\SmoothFPS2.avs")

    AviSource("Video 1.avi")

    part1 = Trim(0, 308).TFM().TDecimate()
    part2 = Trim(309, 343).SmoothFPS2(24000,1001)
    part3 = Trim(344,0).TFM().TDecimate()


    Problem is I get an error stating there is no functio named "SmoothFPS2"
    Quote Quote  
  13. You defined a function called SmoothFPS() then tried to call a function called SmoothFPS2(). The name of the AVS file doesn't matter, then name in the function declaration is what matters.

    Also, these lines:

    Code:
    DirectShowSource("video.ext") #or whatever is appropriate for your source
    AssumeFPS(10) # 60 fps slowed to 1/6, 10 fps
    SmoothFPS(30) # interpolate new frames to 30 fps
    Should not be in the SmoothFPS2.AVS file.

    Copy/Paste from the link I gave for SmoothFPS2.AVS.
    Last edited by jagabo; 21st Oct 2017 at 17:56.
    Quote Quote  
  14. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by jagabo View Post
    You defined a function called SmoothFPS() then tried to call a function called SmoothFPS2(). The name of the AVS file doesn't matter, then name in the function declaration is what matters.

    Also, these lines:

    Code:
    DirectShowSource("video.ext") #or whatever is appropriate for your source
    AssumeFPS(10) # 60 fps slowed to 1/6, 10 fps
    SmoothFPS(30) # interpolate new frames to 30 fps
    Should not be in the SmoothFPS2.AVS file.

    Copy/Paste from the link I gave for SmoothFPS2.AVS.

    I thank and appreciate your help and patience with me so far. So I created SmoothFPS2.AVS in my plugins folder with the following:

    Code:
    function SmoothFPS2(clip source, int num, int den) {
    super = MSuper(source, 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(source, super, backward_3, forward_3, num, den, mode=0)
    }
    I then amended my AVS file for my video to read:

    Code:
    import("C:\Program Files (x86)\AviSynth\plugins\SmoothFPS2.avs")
    
    AviSource("Video 1.avi")
    
    part1 = Trim(0, 308).TFM().TDecimate()
    part2 = Trim(309, 343).SmoothFPS2(24000,1001)
    part3 = Trim(344,0).TFM().TDecimate()

    Unfortunately, the AVS file does not open. Upon closer inspection in AVSP, when trying to view the video, I get 'Not a clip' error.
    Last edited by Imy; 22nd Oct 2017 at 07:24.
    Quote Quote  
  15. Does the error message say anything else useful? Like the line number? The name of the function causing the problem? Do you have MvTools2 installed?
    Quote Quote  
  16. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by jagabo View Post
    Does the error message say anything else useful? Like the line number? The name of the function causing the problem? Do you have MvTools2 installed?
    I copied the mvtools dll file into my plugins directory if that's what you mean.

    The error occurs at line 6 col: 45
    Quote Quote  
  17. Oh, you're missing the last line, the one that appends the three parts. See post #6.
    Quote Quote  
  18. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    That work's now. Apologies for excluding that line.

    I'm amazed at how intelligdent TFM and TDecimate are..
    Quote Quote  
  19. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by killerteengohan View Post
    Try this along with TIVTC to remove or hide the artifacts you do not wish to see.

    Santiag()

    Hi,

    Do I simply apply the a line stating 'Santiag()' or do you I need to include some parameters?

    for example
    Code:
    santiag(strh=1, strv=1, type="nnedi3", nns=1, threads=0, nsize=6, halfres=false, scaler_post="Spline36Resize")
    Quote Quote  
  20. Originally Posted by Imy View Post
    Originally Posted by killerteengohan View Post
    Try this along with TIVTC to remove or hide the artifacts you do not wish to see.

    Santiag()

    Hi,

    Do I simply apply the a line stating 'Santiag()' or do you I need to include some parameters?

    for example
    Code:
    santiag(strh=1, strv=1, type="nnedi3", nns=1, threads=0, nsize=6, halfres=false, scaler_post="Spline36Resize")

    Parameters are not needed unless you want to use something other than the default settings.
    Quote Quote  
  21. Member
    Join Date
    Sep 2002
    Location
    UK
    Search Comp PM
    Originally Posted by killerteengohan View Post
    Originally Posted by Imy View Post
    Originally Posted by killerteengohan View Post
    Try this along with TIVTC to remove or hide the artifacts you do not wish to see.

    Santiag()

    Hi,

    Do I simply apply the a line stating 'Santiag()' or do you I need to include some parameters?

    for example
    Code:
    santiag(strh=1, strv=1, type="nnedi3", nns=1, threads=0, nsize=6, halfres=false, scaler_post="Spline36Resize")

    Parameters are not needed unless you want to use something other than the default settings.
    Ah ok. Thanks. I'm assuming the default setting does what it needs to to improve the picture.
    Quote Quote  



Similar Threads

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