VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab and copy, convert or make Blu-rays and DVDs! :)
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 32
Thread
  1. Hello all- I was wondering if anyone could provide any tips for cleaning this video up a bit with avisynth? I was planning on passing through QTGMC to deinterlace, but would really appreciate any advice on what else this video could use to make it look better. Its an old VHS transfer for a move that will probably never see any better releases, and I'd like to make it look just a little better if possible.

    I can provide additional clips if there's any interest.

    Thanks!
    Image Attached Files
    Quote Quote  
  2. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by autephex View Post
    I was planning on passing through QTGMC to deinterlace,
    This video isn't interlaced. It's hard-coded telecine film source. You need inverse telecine (TIVTC).

    Even if you follow TIVTC with QTGMC in progressive mode and use other denoisers, don't expect much. Besides poor signal level control and crushed darks, the video has serious mistracking and scanline timing errors. It was damaged visually during your initial capture. You can put time and effort into it but it won't look any better than it does now. If anything, it will look slightly worse from re-encoding. You need better equipment and lossless media if you want to work with badly aged tapes.
    Last edited by LMotlow; 7th Dec 2018 at 09:36.
    - My sister Ann's brother
    Quote Quote  
  3. I agree with the others. If you want the best results you need to capture the video again with a lossless codec. You need a line time base corrector to get rid of the horizontal jitter (this can't be fixed after capturing) and you need to adjust levels to keep darks and bright from being crushed. You also want to use a VCR that doesn't add those strong oversharpening halos.

    But one issue I saw that may be on the original tape: the V channel appears to rise across the frame causing the left to have a green cast:

    Image
    [Attachment 47400 - Click to enlarge]


    After compensating for this we get:

    Image
    [Attachment 47401 - Click to enlarge]


    Obviously, more work need to be done on the colors but regular color filters won't fix this droop of the V channel.

    This fix was performed with:

    Code:
    #
    # open, ivtc, crop video, then
    #
    ramp = GreyRamp().BilinearResize(width, height)
    Overlay(ColorYUV(off_v=12), last, mask=ramp)
    where GreyRamp() is:

    Code:
    #
    # produce a 256x256 ramp from black to white across the frame
    #
    function GreyRamp()
    {
       black = BlankClip(color=$000000, length=256, width=1, height=256, pixel_type="RGB32")
       white = BlankClip(color=$010101, length=256, width=1, height=256, pixel_type="RGB32")
       StackHorizontal(black,white)
       StackHorizontal(last, last.RGBAdjust(rb=2, gb=2, bb=2))
       StackHorizontal(last, last.RGBAdjust(rb=4, gb=4, bb=4))
       StackHorizontal(last, last.RGBAdjust(rb=8, gb=8, bb=8))
       StackHorizontal(last, last.RGBAdjust(rb=16, gb=16, bb=16))
       StackHorizontal(last, last.RGBAdjust(rb=32, gb=32, bb=32))
       StackHorizontal(last, last.RGBAdjust(rb=64, gb=64, bb=64))
       StackHorizontal(last, last.RGBAdjust(rb=128, gb=128, bb=128))
    }
    I think there's a similar issue vertically but it's hard to tell with this clip.
    Quote Quote  
  4. Thanks for the tips guys.

    This wasn't my transfer or believe me, I'd do it over again.

    I've been searching years for a new VHS copy to buy so I can do it myself but its very rare. This is the only transfer currently available, being sold by bootleggers online, and I don't expect to improve it that much but wanted to try to do anything I could to make it even slightly better.

    I will followup with the tips posted.
    Quote Quote  
  5. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    To add to jagabo's expert comments: that looks like a 2nd generation tape dupe. The "shimmer" and "wiggle" in the images are from one of the source players that had no time base correction. The distortion can't be fixed, even if you could re-capture.
    - My sister Ann's brother
    Quote Quote  
  6. I was planning on encoding this for saving on my computer, in addition to keeping the DVD, so even though I don't have much expectations I was still hoping to make any slight improvements possible since I was going to encode it anyway.

    Would the opinions of the other members who posted here be that its not worth attempting also, given the above suggestions?

    I can post some additional clips if it would help, but I don't want to be too much of a bother
    Quote Quote  
  7. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by autephex View Post
    I was planning on encoding this for saving on my computer, in addition to keeping the DVD, so even though I don't have much expectations I was still hoping to make any slight improvements possible since I was going to encode it anyway.
    I don't think you understand what DVD is. DVD is already lossy encoded. Are you saying you can't play DVD on your computer? Re-encoding lossy encodes is not an improvement. Maybe if what you have was pristine to start with, re-encoding wouldn't do that much damage. If you change the image such as color correction, etc., you'll definitely have to re-encode.

    Just saying, be prepared to limit your expectations.
    - My sister Ann's brother
    Quote Quote  
  8. I completely understand what DVD is, not sure why you need to talk down to me like this repeatedly.

    Although my experience with AVIsynth is limited, my experience with video formats is not.

    I can play the DVD fine, but I want to encode a digital copy for my computer and playback via non-disc methods. It will look better playing via DVD player using the disc than if I play it via my computer, so I am looking to apply any filters to improve PQ where possible.

    Given that the video has lots of issues, I'm interested in potentially cleaning some of this up where possible.

    Yes I know its lossy already and re-encoding a DVD source like this will result in loss of detail

    As stated already, I'm not expecting to get a lot out of any re-encodes.

    Given that this is the only available source of this movie, I am willing to sacrifice some detail if I can address some of the problems with this transfer in a way that makes it a bit better looking, aside from detail loss.
    Last edited by autephex; 7th Dec 2018 at 18:03.
    Quote Quote  
  9. As already mentioned, you want to inverse telecine, not deinterlace:

    Code:
    TFM()
    TDecimate()
    vInverse() after that can remove some residual combing from bad horizontal time base and AGC.

    The provided clip doesn't have much color on which to base color corrections. A yellowish shirt, green grass, pretty much everything else is of indeterminate color. Clips with a wider variety of colors would help. Especially large-ish known black, white, and grey areas.

    Colors can be sharpened and shifted to better align with the luma.

    Code:
    MergeChroma(last, aWarpSharp(depth=20).ChromaShift(c=-2, l=-4))
    You can stabilize the picture with Stab() but the problem isn't limited to film bounce, the bad time base causes different parts of the picture to move in different directions. QTGMC(InputType=1) helps with that a bit.

    Code:
    Stab(mirror=15)
    QTGMC(InputType=1, EZDenoise=2.0, DenoiseMC=true)
    Quote Quote  
  10. Thanks jagabo! My mistake on the interlacing, I had assumed it was interlaced NTSC but hadn't actually examined the frames.

    Here are a couple additional clips, the first with a wider variety of colors and motion sequences, the second with some darker lighting and whites, and the final one is a longer clip in case its easier to look at a longer one than a shorter one.

    Your suggestions already are appreciated though.
    Image Attached Files
    Quote Quote  
  11. I came up with a compromise setting that works fairly well for most of the clips. Clip1 still looks undersaturated and too blue.

    Code:
    import("C:\Program Files (x86)\AviSynth\plugins\TemporalDegrain.avs") 
    import("C:\Program Files (x86)\AviSynth\plugins\Ramp.avs") 
    
    c1 = Mpeg2Source("clip1.d2v", CPU2="ooooxx", Info=3) 
    c2 = Mpeg2Source("clip2.d2v", CPU2="ooooxx", Info=3) 
    c3 = Mpeg2Source("clip3.d2v", CPU2="ooooxx", Info=3) 
    c4 = Mpeg2Source("clip4.d2v", CPU2="ooooxx", Info=3) 
    c1+c2+c3+c4
    
    # IVTC
    TFM() 
    TDecimate() 
    
    # remove black borders
    Crop(14,52,-2,-56)
    src=last
    
    # fix droop of V channel at left
    ramp = GreyRamp().BilinearResize(width, height)
    Overlay(last, ColorYUV(off_v=-12), mask=ramp)
    
    # adjust levels
    ColorYUV(gain_y=-20, gamma_y=50, off_y=-2)
    
    # white balance darks, brights
    darks = ColorYUV(off_u=4, off_v=9)
    brights = ColorYUV(off_u=18, off_v=3)
    Overlay(darks, brights, mask=ColorYUV(cont_y=50))
    
    # increase saturation, maybe too much
    ColorYUV(cont_u=30, cont_v=30)
    
    # make reds less orange
    Tweak(hue=5)
    
    # remove residual combing from bad time base, AGC, compression
    vInverse()
    
    # antialiasing
    Santiag()
    
    # stabilize frame
    Stab(mirror=15)
    
    # edge stabilization
    QTGMC(InputType=1)
    
    # chroma noise reduction, sharpen, shift
    MergeChroma(last, TemporalDegrain().aWarpSharp(depth=10).ChromaShift(c=-2, l=-4))
    Original+IVTC and processed, side by side, MKV attached.

    <edit>
    I'm having trouble uploading. Will try again later...
    </edit>
    Image Attached Files
    Last edited by jagabo; 8th Dec 2018 at 13:38.
    Quote Quote  
  12. thanks so much jagabo! Will watch for your uploaded clips, very keen to see the results, but of course I can also try it myself and see.

    Much obliged!
    Quote Quote  
  13. Finally got the clip uploaded. I made a few changes to the script too.
    Quote Quote  
  14. WOW, jagabo !

    That's an incredible improvement!

    See, this is what I'm talking about... sure, re-encoding from a DVD source isn't good practice. But in a case like this your script here is a massive improvement in the resulting picture, in terms of watchability.

    And your side by side mkv is a very much appreciated touch... seeing the old vs new side by side is really cool to watch. Talk about going to extra lengths for some random stranger on the internet! I will be keeping this clip saved just for a point reference.

    Going to go and run your script on the entire film now. Cannot thank you enough!
    Quote Quote  
  15. Brilliant job on the colors, Jagabo. You can do my color timing from now on.

    The rest of the restoration is also extremely good.

    The only negative I noticed is that there seems to be some jerkiness which is most evident during camera pans. This usually happens because the IVTC parameters are not quite right. I suppose it could also be my playback software (I only played the result and did not put it into my NLE so I could walk through it frame-by-frame).
    Quote Quote  
  16. I did notice some slight jerkiness like you mentioned, but figured it was just due to the source. I may try experimenting with those parameters to see if I notice any change, unless you more knowledgeable folks have suggestions.

    This clean up will be shared with fans of the film, and it will be very much appreciated. This is why I came here for advice instead of trying to fiddle with it myself, because my knowledge on avisynth filtering is extremely limited and I really wanted to get this looking as good as is possible.

    Been looking for a better source of this film for years, and right now improving the picture on this capture seems like the only way to make it any better.
    Quote Quote  
  17. You guys are right. I didn't notice the jerky playback since I was mostly looking at colors and stabilizing the picture. It looks like the NTSC video was made from a PAL tape with 3:2:3:2:2 pulldown -- and should be decimated to 25 fps. Though there seems to be a bit more. I'll look into it more later...
    Quote Quote  
  18. I believe this DVD video is captured from a Greek VHS, in which case you'd be correct that it was captured from a PAL tape
    Quote Quote  
  19. If it is in the IVTC, then you can fix it by tweaking TFM/TDecimate. If it is in the source, then you'll have to fill in the missing frames. I wrote a script to detect the gaps and automatically synthesize a frame. It was for a specific problem and would have to be tweaked for this operation:

    Automatically fix dups followed (eventually) by drops
    Quote Quote  
  20. There aren't any (at least no significant number of) missing fields/frames in the source. But I think there's an issue where even correctly matched fields result in little combing -- partly because of the bad horizontal time base, but maybe from another cause too. There may also be an issue with colors of the two fields (of the original PAL video) not matching. In my script cleaned that up with very strong temporal filtering of the chroma but there may be a better fix. I'll look at it in some more detail tomorrow.
    Quote Quote  
  21. Finally had a chance tonight to try playing with the TFM/TDecimate settings. Was able to put back to 25fps with TDecimate but haven't been able to eliminate the jerkiness yet... will keep toying with it some more

    Any suggestions on best encoding program to run Avisynth scripts with? I've been using MEGUI and HCenc, but they are both giving me some strange issues

    Edit: I may have located someone with a PAL DVD of the same recording. I am still trying to get some more info from them, but they have given me a screenshot which matches my version, except it has PAL resolution and seems to have slightly more detail and noise in the picture. My NTSC DVD has blank footage from a DVD recorder at the start and end, so now I am wondering if the original PAL VHS was transferred via unknown means to DVD, and then this DVD was recorded onto an NTSC DVD recorder instead of just copied with a DVD drive. This may also account for the slight difference I see in color/detail/noise between the screenshots.

    This person is willing to send me their PAL DVD version, and it could possibly help with the jerky issues if it does not have the PAL -> NTSC conversion problems? All other issues appear to still be present, based on screenshots.
    Last edited by autephex; 10th Dec 2018 at 19:34.
    Quote Quote  
  22. We have done some more comparison and have confirmed that we both have the same DVD recording, but he has PAL and I have NTSC

    My best guess is that whoever transferred the original VHS used a DVD recorder to capture the tape, which is why we see their DVD Recorder menu and play button in the video. Then someone along the line of trades, somebody didnít have a computer with a DVD burner so instead they plugged a DVD player into their DVD Recorder and recorded the PAL DVD into their NTSC DVD recorder, producing the version I have. (Or another likely possibility is a bad conversion by an online bootleg seller)

    Here is a sample screenshot comparison. I resized my screenshot from NTSC resolution to match the PAL resolution for easier comparison between the two. Flipping back and forth, you can see the difference in noise/detail. Its definitely the same original DVD Recorder source, because they both have the same DVD Recorder screens captured at the beginning and end of the video, both displaying the same date of capture.
    Image Attached Thumbnails Click image for larger version

Name:	NTSC.jpg
Views:	4
Size:	76.4 KB
ID:	47447  

    Click image for larger version

Name:	PAL.png
Views:	4
Size:	441.6 KB
ID:	47448  

    Last edited by autephex; 10th Dec 2018 at 20:02.
    Quote Quote  
  23. Originally Posted by autephex View Post
    Finally had a chance tonight to try playing with the TFM/TDecimate settings. Was able to put back to 25fps with TDecimate but haven't been able to eliminate the jerkiness yet...
    Try this partial script:

    Code:
    c1 = Mpeg2Source("clip1.d2v", CPU2="ooooxx", Info=3) 
    c2 = Mpeg2Source("clip2.d2v", CPU2="ooooxx", Info=3) 
    c3 = Mpeg2Source("clip3.d2v", CPU2="ooooxx", Info=3) 
    c4 = Mpeg2Source("clip4.d2v", CPU2="ooooxx", Info=3) 
    c1+c2+c3+c4
    
    Interleave(TFM(field=1, pp=0), TFM(field=0, pp=0))
    vInverse()
    Dup(threshold=4, blend=true, show=false)
    
    TDecimate(Cycle=12, CycleR=7)
    There is a problem where the two fields don't always align properly after TFM. This noise confuses TDecimate at times. The vinverse and Dup() are used to make the near matches exact matches, helping TDecimate().
    Quote Quote  
  24. Not sure if its a problem with version of TIVTC, but I am getting invalid arguments for TFM when I try to run that script

    I also had this problem with the original script, but had to add TFM(c1) instead of just TFM()

    Was running an updated version TIVTC-v1.0.11, so I rolled back to TIVTCv105, but I am still getting invalid arguments for TFM(field=1, pp=0), TFM(field=0, pp=0)
    Quote Quote  
  25. You may have to use the dual TFM with their respective d2v on each source before concatenating them. Or just work on one source file at a time.

    I think you'll be better off starting with the PAL disc.
    Last edited by jagabo; 10th Dec 2018 at 21:54.
    Quote Quote  
  26. I actually am already working on only one source file. I just clipped a segment with a camera pan so that I could judge the effects quickly while trying options. Do you happen to know which version TIVTC you have? It seems strange to me I'd keep getting argument errors as its not a problem with missing the plugin or something like that
    Quote Quote  
  27. What is your exact script? And the exact error message?

    The versions of TIVTC.dll I have are very old. The 32 bit version is dated 2009 (1.0.5 maybe) , the 64 bit version 2010. Both are working fine with the script I posted.

    I just tried updating the 32 bit version to 1.0.10. No problems.
    Last edited by jagabo; 10th Dec 2018 at 23:05.
    Quote Quote  
  28. I figured it out. It was because I was keeping c1 = Mpeg2Source("clip1.d2v", CPU2="ooooxx", Info=3) for just the 1 clip and deleting the following c2, etc. instead of just starting with Mpeg2Source. Still very new to avisynth scripting.

    This looks a lot smoother than before, but framerate is 24.975.. should it be exactly 25fps?

    I also resized to 704x396 for a proper 16x9 ratio because I was getting a vertical flashing green bar at the right most side of the video. It seems to be related to the crop on that side and I think maybe the resulting AR being irregular, but I'm not sure? Do I need to add a border back in maybe? When I resize to 704x396, the green bar is much less present but its still flashing there a bit, as shown in clip.

    Here's the whole script I'm running:

    Code:
    import("C:\Program Files (x86)\AviSynth 2.6\plugins\TemporalDegrain.avs") 
    import("C:\Program Files (x86)\AviSynth 2.6\plugins\Ramp.avs") 
    import("C:\Program Files (x86)\AviSynth 2.6\plugins\Santiag.avs") 
    import("C:\Program Files (x86)\AviSynth 2.6\plugins\Stab.avs") 
    
    Mpeg2Source("clip4b.d2v", CPU2="ooooxx", Info=3) 
    
    # IVTC
    Interleave(TFM(field=1, pp=0), TFM(field=0, pp=0))
    vInverse()
    Dup(threshold=4, blend=true, show=false)
    
    TDecimate(Cycle=12, CycleR=7)
    
    # remove black borders
    Crop(14,52,-2,-56)
    src=last
    
    # fix droop of V channel at left
    ramp = GreyRamp().BilinearResize(width, height)
    Overlay(last, ColorYUV(off_v=-12), mask=ramp)
    
    # adjust levels
    ColorYUV(gain_y=-20, gamma_y=50, off_y=-2)
    
    # white balance darks, brights
    darks = ColorYUV(off_u=4, off_v=9)
    brights = ColorYUV(off_u=18, off_v=3)
    Overlay(darks, brights, mask=ColorYUV(cont_y=50))
    
    # increase saturation, maybe too much
    ColorYUV(cont_u=30, cont_v=30)
    
    # make reds less orange
    Tweak(hue=5)
    
    # remove residual combing from bad time base, AGC, compression
    #vInverse()
    
    # antialiasing
    Santiag()
    
    # stabilize frame
    Stab(mirror=15)
    
    # edge stabilization
    QTGMC(InputType=1)
    
    # chroma noise reduction, sharpen, shift
    MergeChroma(last, TemporalDegrain().aWarpSharp(depth=10).ChromaShift(c=-2, l=-4))
    
    LanczosResize(704,396)
    Image Attached Files
    Quote Quote  
  29. Originally Posted by autephex View Post
    I figured it out. It was because I was keeping c1 = Mpeg2Source("clip1.d2v", CPU2="ooooxx", Info=3) for just the 1 clip and deleting the following c2, etc. instead of just starting with Mpeg2Source. Still very new to avisynth scripting.
    One thing that may help you out: when you don't explicitly name a stream in AviSynth it uses the name "last". So the sequence:

    Code:
    Mpeg2Source("clip4b.d2v", CPU2="ooooxx", Info=3) 
    TFM()
    is short for:

    Code:
    last = Mpeg2Source("clip4b.d2v", CPU2="ooooxx", Info=3) 
    last = TFM(last)
    This sequence:

    Code:
    c4 = Mpeg2Source("clip4b.d2v", CPU2="ooooxx", Info=3) 
    TFM()
    doesn't work because the first line creates a stream called c4 and the second line tries to use last -- which doesn't exist at that point.

    Originally Posted by autephex View Post
    This looks a lot smoother than before, but framerate is 24.975.. should it be exactly 25fps?
    No the result of this decimation (discard 7 of every 12 frames) leaves the video at 24.975 fps (25000/1001). So even under the best of circumstances you'll still be missing one frame out of every 1001. In theory you could use a very long cycle like TDecimate(Cycle=5994, CycleR=3494) to get exactly 25 fps but in practice that doesn't work well (and is incredibly slow). If you don't need 25 fps (like for PAL DVD) you can leave the video at 24.976 fps. The other options are to AssumeFPS(25) or ChangeFPS(25). The former will require changing the audio length to match, the latter duplicates 1 frame out of every 1000 which may create a noticeable jerk every 40 seconds.

    Originally Posted by autephex View Post
    I was getting a vertical flashing green bar at the right most side of the video.
    If you view the result of your script in VirtualDub (or some other editor/player) do you see the green bar there? Or is it only after encoding. I doubt the problem is in x264. It works fine with any mod2 frame size.
    Quote Quote  



Similar Threads