VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25
Thread
  1. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Have a large interlaced AVI file digitized from VHS or umatic tape. I don't have the tape so re-copying is not possible, if it would even help. The entire video (about 50 minutes) has the image problem as seen in sample. Can it be significantly reduced?

    Also wondering if ivtc'ing is possible without dropped frames. I've tried TFM/Tdecimate on an AVI with similar specs and that happened. Deinterlacing with QTGMC to 29.97 looked better but motion has a blurry look.
    Thanks.
    Image Attached Files
    Quote Quote  
  2. Here's a start:

    Code:
    LWLibavVideoSource("Class clip.avi", format="YUY2") 
    ConvertToYV12(interlaced=true)
    src = last
    
    # first dehalo
    BilinearResize(width/2, height)
    SeparateFields()
    Dehalo_alpha(rx=2.5, ry=1.0, BrightStr=1.5, DarkStr=1.5)
    Weave()
    Spline36Resize(src.width, height)
    
    # then fix first order ghost
    ColorYUV(gain_y=-60)
    Overlay(last, ShiftRight(24), mode="add", opacity=0.20)
    
    return(last)
    
    ################################################
    
    function ShiftRight(clip v, int amount)
    {
        v.Crop(0,0,-amount,-0).AddBorders(amount,0,0,0)
    }
    
    ################################################
    Image
    [Attachment 53116 - Click to enlarge]
    Quote Quote  
  3. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Thank you, jagabo, I'll test it in AvsP.
    Quote Quote  
  4. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    I use FFvideoSource to import video (I don't know if it's equivalent to using libavcodec), but the dehalo video looks too soft compared to the original.
    I guess this halo/double-image was from interference during an over-air broadcast vcr recording.
    Quote Quote  
  5. Yes, you have two issues: multipath reception causes the ghosting, and an overactive sharpening filter in the VCR causing halos.

    Remove the dehalo portion of the script if you think it's softening the picture too much. You can also work on fine tuning the horizontal shift and and opacity values. And apply a second ghost removal for the further away ghost.
    Last edited by jagabo; 5th May 2020 at 16:29.
    Quote Quote  
  6. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    The trade-off in quality wasn't worth it (to me), but I still need some advice on deinterlacing. The blurring with motion is perhaps from blended frames, so instead of following QTGMC with "selecteven," I tried Srestore with 29.97, and 23.976, in two different scenes. Paradoxically, each frate worked good in one but not the other. I'd like to get the frate to 23.976, so I'm uploading the scene it failed in.
    If you look at the woman's coffee cup as she lowers, it get funky. There was a similar issue when she talks, but I cut that off because the file size was getting too big.
    Image Attached Files
    Quote Quote  
  7. The problem with that clip is that the bottom part of the screen moves before the top part. So in one frame you'll see the part part of the frame is clean but there's blending in the bottom part. Then in the next frame the bottom is clean but there's blending in the top part. For example, after a simple bob(0.0,1.0), you'll see blending at the bottom of frame 60. Then at frame 61 the bottom is clear but the top is blended. )The blending on the top of frame 61 is a little hard to see but if you move on to frame 62 you'll see the top part clean up.)

    So there aren't enough completely clean frames for SRestore() to produce a perfect result. In many cases it just has to pick frames with the least blending.
    Quote Quote  
  8. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Thanks, jagabo. I was hoping setting some parameters might enable it to lock onto the right fields or frames. I was confused by the plugin write-up.
    If 23.976 isn't going to be perfect, is there a better way to get 29.97 progressive than Qtgmc.selecteven?
    Quote Quote  
  9. You could try using SRestore() on the top and bottom portions separately, then stacking them back together. I did a quick test with and it looked better for the most part.
    Quote Quote  
  10. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    That's thinking outside the box (from my pov). How do you call srestore twice? Did you use 2 different scripts, and stack them in the 2nd script? Or stack top/bottom as left/right, call srestore, then reverse stacking steps? I tried that (using frate 23.976) but had the same results.
    Last edited by spiritgumm; 18th May 2020 at 10:44.
    Quote Quote  
  11. I did this:

    Code:
    LWLibavVideoSource("C:\Users\John\Downloads\2ndclip.dv", format="YUY2") 
    
    QTGMC(preset="fast")
    
    top=Crop(0,0,-0,340)
    bot=Crop(0,340,-0,-0)
    
    top = top.SRestore(frate=23.976)
    bot = bot.SRestore(frate=23.976)
    
    StackVertical(top, bot)
    It would work better with an overlap between the top and bottom and a mask to smoothly blend at the overlap. This might create some tears where the top and bottom come from different film frames. You'll have to check for that and replace those frames manually. Or play with the split point -- maybe a little higher or lower would give better results.
    Quote Quote  
  12. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    How are you able to call srestore twice? Does it matter which version of avisynth? I'm importing video with DirectShowSource.
    Quote Quote  
  13. I'm using 64 bit AviSynth+ and fairly recent versions of most filters.

    SRestore version 2.796

    # 10/28/2013 martin53
    # - Update v2.7e -> v2.7f
    # Callable more than once from the same script with help of unique global variables per instance.
    # Moderate reformatting to re-establish readability with the new variable names.
    # Needs GRunT plugin
    Last edited by jagabo; 18th May 2020 at 14:08.
    Quote Quote  
  14. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Yep, I found that SRestore version (which was missing a function). Seems to work with 64bit Avisynth 2.5.
    It worked for splitting it in half (crop 240), but produced slight jerky video in another part of clip. Maybe because there was momentary videotape snow across the middle of the frames and SRestore picked cleaner frames (the snow was mostly removed).
    Because your 340/140 crop is off center, the snow is untouched, and video was not jerky. So that's good, unless something throws off the function elsewhere (like lower snow).
    Is there a reason you chose 340/140? That is, does the blending always effect the bottom third that way? Or is this random, so that proportion wouldn't be correct for upper blend problems?
    Btw, are the negative signs for zeroes in your crop necessary?
    Last edited by spiritgumm; 18th May 2020 at 16:40.
    Quote Quote  
  15. I looked at the position where the ghosting transitions in the frame. It's hard to tell but it's around line 340. I don't know if it changes in the full video.

    You are correct, the negative signs for the zeros aren't necessary. I just like to use them for visual consistency. Ie, negative values for the 3rd and 4th values mean "remove that number off columns/lines", positive values mean "keep that number of columns/lines".
    Quote Quote  
  16. Here's a script that blends the boundary between the top and bottom parts:

    Code:
    LWLibavVideoSource("2ndclip.dv", format="YUY2") 
    QTGMC(preset="fast")
    
    split = 340  # specify top/bottom split
    
    top=Crop(0,0,-0,split+16).AddBorders(0,0,0,height-split-16)
    bot=Crop(0,split-16,-0,-0).AddBorders(0,split-16,0,0)
    
    top = top.SRestore(frate=23.976)
    bot = bot.SRestore(frate=23.976)
    
    alpha = StackVertical(Crop(0,0,-0,split).ColorYUV(off_y=256), Crop(0,split,-0,-0).ColorYUV(off_y=-256))
    alpha = alpha.BilinearResize(width, height/8).BilinearResize(width,height)
    
    Overlay(bot, top, mask=alpha)
    Image Attached Files
    Quote Quote  
  17. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    You might not have seen this problem in the clip I uploaded. I did the entire show overnight, and using the prior script, the two sections are frequently not synced. I'm uploading a processed clip a few seconds earlier than the original clip to demonstrate. When the camera moves across the drums at 3 seconds, and guy's belly at 10 seconds. Scene changes (5,7 seconds).
    I just tried your border mask in same clip as below, which helped with the separations and even one of the scene changes, but I wonder if it will look okay on a TV, or if encoded to dvd mpeg.
    Image Attached Files
    Last edited by spiritgumm; 19th May 2020 at 09:19.
    Quote Quote  
  18. Yes, I mentioned that you might get tears when the selected top and bottom didn't come from the same film frame.
    Quote Quote  
  19. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    I appreciate all your work - I can't even figure out how your last script works - but I don't like this split method. Splitting it exactly in half worked best, except for when a tape glitch threw it off. If that was the only reason for that problem, it would be acceptable since there aren't many tape glitches. But the tearing at scene changes is unacceptable.
    Quote Quote  
  20. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    jagabo, I have some mpeg made from these avi (or from the video that was used to make the avi). They don't look interlaced to me, and look better than the 29.97 fps progressive video I made. But they have the same field pattern as the AVI and are identified as interlaced. I tried to replicate this with HC encoder, but the video looks badly interlaced (guess I'm not doing it correctly). I'm attaching a sample of the mpeg (without audio) made by the folks that made the AVI transfers. Thanks for any guidance on this.
    Image Attached Files
    Quote Quote  
  21. I don't understand the question. The m2v has the same problem as the earlier AVI (fields partly from different film frames). Unlike the AVI it's encoded interlaced. But like the AVI it has some interlaced frames.
    Quote Quote  
  22. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    To my eyes, watching this from a dvdr on HD TV looks great, as well as on my monitor using Media Player. The mpeg came with the AVI from the same source people. I hadn't watched it since I wanted to use the earliest source material (the AVI) to work on. I was focused on cleaning it up, and encoding deinterlaced progressive video, which unfortunately has an odd blurry look during motion (whether to MKV or mpeg). Anyway, I thought the accompanying mpeg looked good for dvd video. However, when I try to encode the AVI to interlaced mpeg, it looks terrible.
    Quote Quote  
  23. All you have to do is pass the AVI frames to an MPEG 2 encoder and encode as interlaced, bff. It will playback exactly the same as the m2v clip.
    Quote Quote  
  24. Member spiritgumm's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    Ah, I was thinking "assumebff" in the script would address the BFF setting. Ticking the BFF setting in HC encoder was the solution. Will this work after I clean up the video? Will an MKV encode have visible interlacing (by that I mean combing, which for some reason I'm not seeing with the mpeg)?
    Quote Quote  
  25. Originally Posted by spiritgumm View Post
    Will this work after I clean up the video?
    As long as you don't mess up the interlacing.

    Originally Posted by spiritgumm View Post
    Will an MKV encode have visible interlacing (by that I mean combing, which for some reason I'm not seeing with the mpeg)?
    Not if you encode and flag it as interlaced. The MPG video is encoded and flagged as interalced so the player is deinterlacing on-the-fly. Interlaced x264 MKV attached.
    Image Attached Files
    Last edited by jagabo; 4th Jun 2020 at 13:19.
    Quote Quote  



Similar Threads

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