VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    I don't expect a miracle but how to stabilize all this shaking and changing of color? I guess if that can be fixed it would already look much better. Can you suggest a good avisynth code? Here is the clip.
    Image Attached Files
    Quote Quote  
  2. For chroma noise reduction use CNR2 with high un and vn values. Maybe even two instances. For general noise reduction use something like TemporalDegrain. For camera stabilization use DepanStabilize.

    Code:
    CNR2(un=100, vn=100)
    CNR2(un=100, vn=100)
    DePanStabilize(last, prev=5, next=5, data=DePanEstimate(last))
    TemporalDegrain(SAD1=200, SAD2=150, sigma=8)
    Adjust parameters to taste.
    Last edited by jagabo; 30th Jan 2016 at 09:27.
    Quote Quote  
  3. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Ok, something is going wrong. I got the filters loaded but somehow 1/3 screen is green. Here is the code and encoded clip:

    DirectShowSource("C:\temp\clip.mpg")
    ConvertToYV12(interlaced=false)
    CNR2(un=100, vn=100)
    CNR2(un=100, vn=100)
    TemporalDegrain(SAD1=200, SAD2=150, sigma=8)
    DePanStabilize(last, prev=5, next=5, data=DePanEstimate(last))
    #crop to remove borders
    Image Attached Files
    Quote Quote  
  4. Figure out where the problem is happening. Remove all the filters except DirectShowSource(). Add them back one at a time until you find which filter is causing the problem. Then look for an update of that filter or any filters it relies on.

    By the way, I recommend you use DgMpgDec for opening MPG files. Build an index using DgIndex, then open the index file with Mpeg2Source("clip.d2v"). That's much more reliable than using DirectShowSource().
    Quote Quote  
  5. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    By the way, I recommend you use DgMpgDec for opening MPG files. Build an index using DgIndex, then open the index file with Mpeg2Source("clip.d2v"). That's much more reliable than using DirectShowSource().
    That solved the problem! And it also proves why it is necessary to use it besides creating an index of frames. I did some reading about it and got the essence.

    I have some other questions. By looking at the video I can see some other errors like this kind of rolling tape (I don't know how to call it). I mean if you look at the wall at the lines between the planks you can see that they are not stable. All I know about the video is that it was a vcd which is probably made from a captured VHS tape. Is it possible to correct this?

    And another question. I want to upload it to youtube and maintain the same quality. Should I upscale the video and if yes then what would be a good size? I think I will leave the aspect ratio as it is. And what should be the optimal x264 encoder settings and bitrate?

    Thank you for helping, really!
    Quote Quote  
  6. Horizontal time base jitter is hard to fix after capture. You can reduce it a bit with QTGMC. nnedi3 is usually best for upscaling. I like to upscale stepwise and sharpen in between. Try something like:

    Code:
    Mpeg2Source("D:\Downloads\clip.d2v", CPU2="ooooxx") 
    
    ColorYUV(off_y=-20) # pull levels down
    Crop(4,4,-4,-8) # crop junk at edges of the frame, improves depan edge fill
    CNR2(un=100, vn=100)
    CNR2(un=100, vn=100)
    Dehalo_alpha(rx=4, ry=1) # reduce VHS oversharpening halos
    DePanStabilize(last, prev=8, next=8, rotmax=0.0, damping=1.0, data=DePanEstimate(last))
    TemporalDegrain(SAD1=200, SAD2=150, sigma=8) # less denoising because QTGMC also reduces noise
    
    # stabilize horizontal jitter a bit
    TurnRight()
    QTGMC(InputType=1, Sharpness=0.2)
    TurnLeft()
    
    # upscale stepwize with a little extra sharpening
    nnedi3_rpow2(2, cshift="Spline36Resize")
    aWarpSharp(depth=5)
    Sharpen(0.2, 0.0)
    nnedi3_rpow2(2, cshift="Spline36Resize", fwidth=1440, fheight=1080)
    aWarpSharp(depth=5)
    Sharpen(0.2, 0.0)
    That's looking over processed but you can tone things down if you want.
    Last edited by jagabo; 1st Feb 2016 at 07:53.
    Quote Quote  
  7. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    That's cool! It really makes it alot better. Thanks!

    I read a little documentation and also added to DePanStabilize (mirror=15) to mirror the edges instead of black. That's it, more than I expected. Avisynth and all the people who created the filters have done a great job!
    Last edited by Srivas; 1st Feb 2016 at 09:10.
    Quote Quote  
  8. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    By the way, if I want to cut the whole video to pieces and just add some fade in and fade out, what is the best way to do it without double encoding? Can I just cut it to pieces first and just encode fade in/out parts and then process in avisynth?
    Quote Quote  
  9. I'm not really sure it's better. Just different.

    You can use Trim() to make smaller clips. Then use FadeIn(), FadeOut(), and/or Dissolve() on them. Then append the pieces as required.
    Quote Quote  
  10. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    I personally find noise to be disturbing and tiring to the eyes. I like clean.
    Quote Quote  
  11. Member
    Join Date
    Nov 2007
    Location
    I'm here
    Search PM
    Actually I can do the cutting in Videredo and then add fading in Vegas and frameserve to avisynth. That't the way I know. But the cutting is not frame accurate.

    I will try in avisynth. It would be great to do everything in one place.
    Last edited by Srivas; 1st Feb 2016 at 21:36.
    Quote Quote  



Similar Threads

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