VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Member
    Join Date
    Dec 2010
    Location
    quebec
    Search Comp PM
    Is their any sharpening filter ( virtualdub or avisynth) that is interlaced aware ?

    or a avisynth procedure to do it? ..i tried to separate fields , msharpen and weave

    but i know you guys must know a better way
    Quote Quote  
  2. You could also
    Code:
    Bob()     #use a bobber of your choice; QTGMC is usually a very good choice
    sharpen()          #your sharpening filter here
    separatefields().selectevery(4,0,3).weave()  #re-interlace
    Quote Quote  
  3. Here's an oldie but a goodie (I did not write this):

    Code:
    function ApplyInterlacedFilter(clip v1, string filter)
    {
       v2 = separatefields(v1)
       selecteven(v2)
       even = Eval(filter)
       selectodd(v2)
       odd = Eval(filter)
       interleave(even,odd)
       return weave()
    }
    Quote Quote  
  4. Member
    Join Date
    Dec 2010
    Location
    quebec
    Search Comp PM
    How do i do this .. i make this a script (.avs) that i call ?

    or something like

    ApplyInterlacedFilter(MSharpen)

    is that it ?

    with this i'm sharpening the fields.. with the other one i'm bobing, sharpening the frames and reinterlacing .. what are the pros and cons of each one ?
    Last edited by smartel; 5th Apr 2020 at 20:40.
    Quote Quote  
  5. just explaining technicality, not actual filter usability,
    http://www.avisynth.nl/index.php/Internal_functions#Eval
    Eval needs a string to evaluate, so you pass a string as your argument:
    Code:
    avisource("file.avi")
    ApplyInterlacedFilter(last, "sharpen(0.5)")
    Quote Quote  
  6. SeparateFields().WhateverSharpen().Weave() isn't a great way of sharpening interlaced video. This is because scan lines that are not adjacent to each other (there's a missing scan line between them) are treated as if they are. Artifacts are spread across two lines instead of one. Since I never have need to keep interlaced video interlaced any more, I use QTGMC() to make the video progressive, then sharpen from there.

    original fuzzy lines, Sharpen(1.0), SeparateFields().Sharpen(1.0).Weave():
    Image
    [Attachment 52623 - Click to enlarge]
    Last edited by jagabo; 5th Apr 2020 at 23:52.
    Quote Quote  
  7. Originally Posted by smartel View Post

    … with this i'm sharpening the fields.. with the other one i'm bobing, sharpening the frames and reinterlacing .. what are the pros and cons of each one ?
    a) Sharpening even/odd grouped fields:
    Pros:
    - keeps the original field structure intact
    - no deinterlacing (or bobbing) artifacts
    - works with basic internal avisynth filters
    - you can filter the even and odd fields differently
    Cons:
    - may tend to shimmer

    b) Bob-filter-reinterlace
    Pros:
    - Overall result can profit from a good bobber like QTGMC
    - easy resizing of the bobbed frames when needed
    - you could leave the frames progressive, double rate, unless you want to re-interlace
    Cons:
    - deinterlacing / bobbing artefacts
    - may require the installation of external avisynth filters and dependencies (QTGMC ....)

    Which method is preferred depends also on the source and on other filters you may want to include.
    Last edited by Sharc; 6th Apr 2020 at 08:37.
    Quote Quote  
  8. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Really, though: what's the source and why are you sharpening it?

    Perhaps you only want to sharpen in the horizontal dimension. This is the case with my own VHS captures. Then, as long as the sharpener is spatial-only with no temporal functionality, you wouldn't need to worry about interlacing.
    My YouTube channel with little clips: vhs-decode, comparing TBC, etc.
    Quote Quote  
  9. Originally Posted by Brad View Post
    as long as the sharpener is spatial-only
    And allows sharpening only in the horizontal dimension. AviSynth's Sharpen(X, Y) allows that. But most sharperners I've seen don't.
    Quote Quote  
  10. Member
    Join Date
    Dec 2010
    Location
    quebec
    Search Comp PM
    is their a better way to reinterlace 59.94p to 29.97i
    to take each full frame to built the new field (top and bottom) keeping the fluidity

    resizing down (frame to field) should make it sharper, no ? like the opposite of qtgmc does
    Quote Quote  
  11. Originally Posted by smartel View Post
    is their a better way to reinterlace 59.94p to 29.97i
    to take each full frame to built the new field (top and bottom) keeping the fluidity

    resizing down (frame to field) should make it sharper, no ? like the opposite of qtgmc does
    I have no idea what you are trying to do, but if you want to take 60 fps progressive (59.94) and change it to traditional 30 fps (29.97) interlaced, this will do that:
    Code:
    SeparateFields() # 60 frames becomes 120 fields
    SelectEvery(4, 1, 2) # 120 fields to 60 fields (selects 2 from 4)
    Weave()
    This is for TFF video. You should ALWAYS check to make sure you get the field order correct when doing this by temporarily bobbing the resulting video and looking for back/forth "jitterbug" motion when walking through the interlaced video one field at a time. If your video has that, change the selectevery statement to: selectevery(4,0,3).
    Quote Quote  
  12. Originally Posted by johnmeyer View Post
    Code:
    SeparateFields() # 60 frames becomes 120 fields
    SelectEvery(4, 1, 2) # 120 fields to 60 fields (selects 2 from 4)
    Weave()
    This is for TFF video. You should ALWAYS check to make sure you get the field order correct when doing this by temporarily bobbing the resulting video and looking for back/forth "jitterbug" motion when walking through the interlaced video one field at a time. If your video has that, change the selectevery statement to: selectevery(4,0,3).
    Just to nitpick because I've got nothing else to do right now....

    SeparateFields starts with the dominant field, so for a TFF video, the first field from SeparateFields would be a top field.
    SelectEvery(4, 1, 2) is selecting the second and third fields from each group of four, so it's starting with the bottom field, and after weave the output would be BFF. If the source was BFF, after weave you'd have a TFF video. Avisynth keeps track and Info() will confirm the field order has changed.

    Mind you for a progressive source, given both fields represent the same moment in time, does it matter which one you call the dominant field when separating and weaving? I'm trying to imagine where it could go wrong.
    Quote Quote  
  13. I agree, SelectEvery(4,1,2) will reverse the field order. SelectEvery(4,0,3) will retain the original field order.

    If the source is progressive the field order still changes but temporally the result is the same. There will be spacial differences though because you're selecting different fields from the original video. But you wouldn't be doing this if the original frames were progressive.
    Quote Quote  
  14. I have too many script fragments lying around. (4,0,3) does seem like the one I use the most. Perhaps I was trying to un-do a field reversal problem.
    Quote Quote  
  15. VirtualDub filter setup windows will ask if your video is interlaced and will act accordingly. If the VirtualDub filter doesn't ask, it doesn't matter. With Avisynth, filter documentation and instructions will specify whether or not interlace is allowed. Deinterlacing isn't always necessary. Sometimes the SeparateFields() function will suffice. Can't go further into detail without a sample video you're working with.

    Read more: http://www.digitalfaq.com/forum/video-restore/9057-avisynth-deinterlace-improve.html#ixzz6jjYRcWYJ
    Maybe this source will help you
    Quote Quote  
  16. Member
    Join Date
    Dec 2010
    Location
    quebec
    Search Comp PM
    ok here's my source , my result and my script

    https://files.videohelp.com/u/195367/VTS_01_2.MPG

    https://files.videohelp.com/u/195367/Nouveau%20document%20texte%20(2)%20-%20Copie.avi

    OUT_SAR_X = 10
    OUT_SAR_Y = 11

    video = MPEG2Source("G:\Temp\VTS_01_1.index\VTS_01_1.d2v", idct=5, iPP=true, cpu=0, cpu2="ooooxx", iCC=true, info=3)
    audio = NicAC3Source("G:\Temp\VTS_01_1.index\VTS_01_1 T80 2_0ch 256Kbps DELAY -11ms.ac3")
    AudioDub(video, audio)


    AssumeTFF()

    #ConvertToYV12(interlaced = true)
    ReduceFlicker(strength = 3, opt=3)

    SeparateFields()

    Smoothlevels(17,0.833,255, 17,234, HQ=true, limiter=0, protect=16, chroma=200, Lmode=1)

    SmoothTweak(hue2=1) # - green + red

    invert()
    hdragc(max_sat=1.1, max_gain=1.3, coef_sat=0.70)
    invert()

    Tweak(hue=6, sat=1.3, coring = false)

    Weave()

    luma=last
    SeparateFields()
    BicubicResize(width/2,height*2)
    aWarpSharp(depth=30, blurlevel=1)
    BicubicResize(width*2,height/2)
    Weave()
    MergeChroma(luma,last)

    QTGMC(Preset = "Faster", SourceMatch=3, Lossless=2, EZKeepGrain=0.6, NoisePreset="Faster", NoiseProcess=2, ChromaNoise=true,DenoiseMC=true ,sharpness=0.5, NoiseDeint="generate",StabilizeNoise=true,tr2=1)

    NonlinUSM(z=3, pow=1.0, str=0.15, rad=0.5)

    ConvertToYV24(matrix="rec709", chromaresample="point")
    MergeChroma(PointResize(width, height, 0, 1))

    separatefields().selectevery(4,0,3).weave()

    ConvertToRGB32(interlaced=true, matrix="REC709", ChromaInPlacement="mpeg2", chromaresample="Spline36") #for virtualdub's camcorder color denoise and colortools for monitoring



    i'm not too shure about the filters' order .
    i wanted to prevent blurring and sharpen within QTGMC

    i took ideas to sharpen chroma and overall not that shure with the parameters
    Quote Quote  



Similar Threads

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