VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Member
    Join Date: Aug 2014
    Location: Spain
    Search PM
    I have a raw PAL VHS capture where I have the start (4 minutes more or less) a little bit weird due to the colour

    The problem with it is that the colour is normal but each second I have another second where all the colours turn green and then back to the right colour

    Any ideas for fixing that with Avisynth?
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Probably a sample clip would help

    But just throwing out an idea - You might be able to use conditionalfilter() combined with other filters. The conditionalfilter is use to detect the green frames, the "other filters" are whatever adjustments are requred to "fix" the green
    Quote Quote  
  3. Member
    Join Date: Aug 2014
    Location: Spain
    Search PM
    Here I have a sample:

    (2MB) x264 with QTGMC for deinterlacing: https://dl.dropboxusercontent.com/u/11939487/samples/sample.mkv
    (95MB) huffyuv : https://dl.dropboxusercontent.com/u/11939487/samples/sample.avi

    Advices for restoring it?
    Thanks!
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    It's not quite as you describe; the "flashes" are per field, not per second , and they alternate green and magenta with "normal", so only every 4th bobbed frame is "good". Or another way of describing is every 2nd odd field and every 2nd even field is "bad"

    So one way to do this is to interpolate over every 2nd field of the the Cb , Cr chroma channels , using mvtools2 . The luma is retained, untouched, so you are at lower risk of "morphing" artifacts from mvtools2 interpolation . If there was a lot of motion, you run the risk, of chroma "ghosting", where it doesn't quite match up with the luma. Motion interpolation works by "looking" at two good end ponts and generating a new "inbetween" frame (or field in this case) . So those bad fields are replaced by "good" ones by looking at the 2 neighboring "good" fields

    This following example ONLY addresses the green and magenta flashes. There is still noise , and chroma channels still require attention. It retains the original interlacing. So you still need to clean it up however you feel works best for your goals, and deinterlace if that was your goal. For example, you can apply chroma denoising or smoothing filters by adjusting the script . I'll give you a hint, when the fields and channels are separated in u,v is a good time to apply chroma denoising. Or you can use whatever filters you think works good on "normal" chroma flickering/noise

    This approach also assumes that the pattern holds as it does in this clip. If it doesn't or pattern changes, you have to adjust it or use another technique

    You need stickboy's ApplyEvery.dll , and mvtools2
    Code:
    orig=AVISource("sample.avi")
    
    evn=orig.assumebff().separatefields().selecteven() ##Group Even fields
    odd=orig.assumebff().separatefields().selectodd() ##Group Odd fields
    
    ###Interpolate over every 2nd even field, U channel
    evn
    utoy
    sup_eu = MSuper()
    bv_eu = MAnalyse(sup_eu, isb=true, delta=2)
    fv_eu = MAnalyse(sup_eu, isb=false, delta=2)
    interpolated_eu = MFlowInter(sup_eu, bv_eu, fv_eu, time=50.0, ml=100).DuplicateFrame(0)
    replace_eu = interpolated_eu.SelectEvery(2,0) # replacement frames
    
    DeleteEvery(2,0) # delete bad frames
    InterleaveEvery(replace_eu, 2,0) # replace deleted frames
    eu_filtered=last
    
    ###Interpolate over every 2nd even field, V channel
    evn
    vtoy
    sup_ev = MSuper()
    bv_ev = MAnalyse(sup_ev, isb=true, delta=2)
    fv_ev = MAnalyse(sup_ev, isb=false, delta=2)
    interpolated_ev = MFlowInter(sup_ev, bv_ev, fv_ev, time=50.0, ml=100).DuplicateFrame(0)
    replace_ev = interpolated_ev.SelectEvery(2,0) # replacement frames
    
    DeleteEvery(2,0) # delete bad frames
    InterleaveEvery(replace_ev, 2,0) # replace deleted frames
    ev_filtered=last
    
    ###merge the even group field's original Y with interpolated U and V
    YToUV(eu_filtered,ev_filtered)
    mergeluma(evn)
    evn1=last
    
    ###Interpolate over every 2nd odd field, U channel
    odd
    utoy
    sup_ou = MSuper()
    bv_ou = MAnalyse(sup_ou, isb=true, delta=2)
    fv_ou = MAnalyse(sup_ou, isb=false, delta=2)
    interpolated_ou = MFlowInter(sup_ou, bv_ou, fv_ou, time=50.0, ml=100).DuplicateFrame(0)
    replace_ou = interpolated_ou.SelectEvery(2,0) # replacement frames
    
    DeleteEvery(2,0) # delete bad frames
    InterleaveEvery(replace_ou, 2,0) # replace deleted frames
    ou_filtered=last
    
    ###Interpolate over every 2nd odd field, V channel
    odd
    vtoy
    sup_ov = MSuper()
    bv_ov = MAnalyse(sup_ov, isb=true, delta=2)
    fv_ov = MAnalyse(sup_ov, isb=false, delta=2)
    interpolated_ov = MFlowInter(sup_ov, bv_ov, fv_ov, time=50.0, ml=100).DuplicateFrame(0)
    replace_ov = interpolated_ov.SelectEvery(2,0) # replacement frames
    
    DeleteEvery(2,0) # delete bad frames
    InterleaveEvery(replace_ov, 2,0) # replace deleted frames
    ov_filtered=last
    
    ###merge the odd group field's original Y with interpolated U and V
    YToUV(ou_filtered,ov_filtered)
    mergeluma(odd)
    odd1=last
    
    Interleave(evn1,odd1)
    Weave()
    Last edited by poisondeathray; 29th Aug 2014 at 15:48.
    Quote Quote  
  5. Member
    Join Date: Aug 2014
    Location: Spain
    Search PM
    Thank you really much, I'll try it!
    Quote Quote