VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. After applying Levels through AviSynth on VirtualDub2, I’m seeing vertical stripes in my video. (These are not the same stripes I posted about on this forum five years ago.)

    Sometimes, in other processing videos, those lines do not appear. I’m also running several filters in a single AviSynth script: QTGMC, DeHalo, and Santiag. After Levels, I change the frame using SplineResize

    1 image: Captured with the camera lens cap closed.
    2 image: Enhanced so the vertical stripes are more visible.

    Any ideas on what could be causing this? Thanks in advance.
    Image Attached Thumbnails Click image for larger version

Name:	0.png
Views:	23
Size:	232.7 KB
ID:	87219  

    Click image for larger version

Name:	0enh.png
Views:	22
Size:	144.6 KB
ID:	87220  

    Last edited by taigi; 1st Jun 2025 at 03:45.
    Quote Quote  
  2. Could be caused by:
    (Capture/GraphicCard) Driver issues.
    Improper luma-plane handling during resizing/sharpening/color conversion.

    You probably can get rid of them by lowering the luma resolution and then restore it.
    I'm pretty sure I saw this before somewhere on the forum.

    General idea:
    Code:
    clip = last
    # Extract luma
    Y = clip.ConvertToY8()
    scaleFactor = 2 # if two isn't enough try 4 or 8
    # Lowering horizontal resolution; you might want to try different resizers
    Y_half = Y.BilinearResize(Y.Width() / scaleFactor, Y.Height())
    #  Restoring original resolution; you might want to try different resizers
    Y_restored = Y_half.BilinearResize(clip.Width(), clip.Height()) 
    
    # Convert luma back to YV12 by adding dummy chroma  (if you source isn't YV12 adjust this)
    Y_restored_yv12 = ConvertToYV12(Y_restored)
    
    # Replace chroma from original clip
    MergeChroma(Y_restored_yv12, clip)
    Cu Selur

    Ps.: Here's also a Vapoursynth version:
    Code:
    # Extract luma
    luma = core.std.ShufflePlanes(clip, planes=0, colorfamily=vs.GRAY)
    
    # Lower horizontal resolution
    width = luma.width
    scalingFactor = 2
    luma_half = core.resize.Bilinear(luma, width // scalingFactor, luma.height)
    
    # Scale back to original width
    luma_restored = core.resize.Bilinear(luma_half, width, luma.height)
    
    # Merge modified luma back with original chroma
    clip = core.std.ShufflePlanes([luma_restored, clip], planes=[0, 1, 2], colorfamily=vs.YUV)
    PPs.: rotation the image by 90°, and applying some smoothing combined with a combing mask and then rotating the image back might retail more details.
    Last edited by Selur; 1st Jun 2025 at 00:54.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by taigi View Post
    Stripes appear after Levels filter in avisynth script
    Make sure you use the latest Avisnyth version (currently 3.7.5).

    Provide a demo to reproduce the issue.
    Quote Quote  
  4. I'm using this script:

    video = FFMPEGSource2("file.avi", atrack=1)
    video = video.Levels(12, 1.0, 255, 16, 235, coring=false, dither=true)
    return video
    Prefetch(2)

    Anything wrong with it?
    Quote Quote  
  5. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by taigi View Post
    I'm using this script:

    video = FFMPEGSource2("file.avi", atrack=1)
    video = video.Levels(12, 1.0, 255, 16, 235, coring=false, dither=true)
    return video
    Prefetch(2)

    Anything wrong with it?
    Try LWLibAvVideoSource("file.avi"), that's LSMASH.
    Remove "return".
    Quote Quote  
  6. Remove "return".
    or just switch the two last lines for Prefetch to actually do something
    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
    video = FFMPEGSource2("file.avi", atrack=1)
    video = video.Levels(12, 1.0, 255, 16, 235, coring=false, dither=true)
    Prefetch(2)
    return video
    I doubt it's a problem of the source filter => best share a short sample of your source.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Source file is typical. I'm having stripes on other similar files too. I think problem is in the whole script. Yes two dehalos:

    video = FFMPEGSource2("1.avi", atrack=1)

    video = video.QTGMC(TR0=2, TR1=1, TR2=0, Rep0=1, Rep1=0, Rep2=2, DCT=5, ThSCD1=400, ThSCD2=150, SourceMatch=2, Lossless=1, Sharpness=0, Sbb=0, MatchPreset="slow", NoiseProcess=1, NoiseRestore=0, NoisePreset="slow", StabilizeNoise=true, NoiseTR=1, NoiseDeint="true", Sigma=2.0)

    video = video.FineDehalo(rx=1.5, ry=1.5, thmi=80, thma=128, thlimi=50, thlima=100, darkstr=1.0, brightstr=1.0, showmask=0, contra=0.0, excl=true)

    video = video.santiag(strv=3, type="nnedi3", nns=4, threads=0, nsize=4, halfres=false, scaler_post="LanczosResize")

    video = video.FineDehalo(rx=1.0, ry=1.0, thmi=80, thma=128, thlimi=50, thlima=100, darkstr=1.0, brightstr=1.0, showmask=0, contra=0.0, excl=true)

    video = video.Levels(12, 1.0, 255, 16, 235, coring=false, dither=true)

    video = video.Spline64Resize(1024,576)

    Prefetch(2)

    return video
    Quote Quote  
  8. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by taigi View Post
    Prefetch(2)

    return video
    I doubt that this works, use it like I wrote you.


    Originally Posted by taigi View Post
    Source file is typical.
    That doesn't mean to us anything.
    Provide a sample to reproduce the issue.
    Quote Quote  
  9. I doubt that this works, use it like I wrote you.
    Works for me for years,..

    your suggestion
    Code:
    video
    Prefetch(2)
    should be the same as:
    Code:
    last=video 
    Prefetch(2)
    return last # since there is no return
    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  10. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by Selur View Post
    Works for me for years,..
    ...
    should be the same as:
    There is no "last" in his script, so I doubt that it works for you too.

    EDIT:

    Oh, I see, it's you who suggested him that, I guess you are not that secret/unknown avs expert[s] then.

    Originally Posted by Selur View Post
    I doubt it's a problem of the source filter
    Read there [starts from that post I think] -> https://forum.doom9.org/showthread.php?p=1975646#post1975646
    Quote Quote  
  11. There is no "last" in his script, so I doubt that it works for you too.
    Last when I read the Avisynth code it always used "last" unless only direct variables are used and returned.

    Read there [starts from that post I think] -> https://forum.doom9.org/showthread.php?p=1975646#post1975646
    I don't really see the connection to from InpaintDelogo to this thread.

    => totally lost, but the vertical line problem is useless to discuss without a sample

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  12. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by Selur View Post
    Last when I read the Avisynth code it always used "last" unless only direct variables are used and returned.
    Show me where there are no direct variables in his or your script.

    Originally Posted by Selur View Post
    I don't really see the connection to from InpaintDelogo to this thread.
    If you follow the conversation there then you'll see that it boils down that there is some bug in FFMS2 + VirtualDub/StaxRip combo or FFMS2 is not frame accurate.
    Quote Quote  
  13. Show me where there are no direct variables in his or your script.
    You are missing the '.. and returned' part.

    With:
    Code:
    video
    Prefetch(2)
    like you suggested, the 'video' line would be the same as 'last = video'
    (same as "Levels()" actually is "last = Levels(last)")
    and since at the end of the script nothing got returned, last will be returned.
    so
    Code:
    video
    Prefetch(2)
    is actually
    Code:
    last = video
    Prefetch(2)
    return last


    If you follow the conversation there then you'll see that it boils down that there is some bug in FFMS2 + VirtualDub/StaxRip combo or FFMS2 is not frame accurate.
    But frame accuracy should not matter with Levels() since that it only works on single frames independently. So unless the source filter has another bug which messes up the luma plane it should not be the cause of the vertical stipes.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  14. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Read it again: "...his or your script."

    I know that my example has "last".
    Why are you even trying to prove that my example has "last", when I wrote that his and your examples doesn't have it?

    Originally Posted by Selur View Post
    But frame accuracy should not matter with Levels() since that it only works on single frames independently. So unless the source filter has another bug which messes up the luma plane it should not be the cause of the vertical stipes.
    Yes, but OP wrote that he's using QTGMC.
    Quote Quote  
  15. like I wrote without a sample of the source this is moot,...
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  16. The script isn't causing the vertical stripes. It's just making existing stripes visible. Your VCR, cables, or capture device is causing them.
    Quote Quote  



Similar Threads

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