VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    i'm trying to use the median filter to stack three captures of a betacam tape. the preview in avspmod looks fine, but the encoded video has visual glitches and i don't know why. i'm only getting these on the encoded video. the glitches seem to show up at random, and every encode has different glitches.

    raw:
    Click image for larger version

Name:	Cj8xJlU.png
Views:	272
Size:	715.2 KB
ID:	82679
    Click image for larger version

Name:	oB5GLxc.png
Views:	270
Size:	1.56 MB
ID:	82680

    encode:
    Click image for larger version

Name:	FUnr5CT.png
Views:	270
Size:	546.0 KB
ID:	82682
    Click image for larger version

Name:	xImB5lg.png
Views:	278
Size:	1.35 MB
ID:	82681

    script:
    Code:
    setmemorymax(63448)
    v = lwlibavvideosource("I:\virtualdub\tape transfers\betacam\sp\Lot #3\LAIDLAW TRANSIT THE BUS STOPS HERE.mkv", fpsnum=30000, fpsden=1001)
    a = lwlibavaudiosource("d:\recordings\LAIDLAW TRANSIT THE BUS STOPS HERE.flac")
    audiodub(v,a)
    Trim(228, 19744)
    v1=last
    lwlibavvideoource("F:\virtualdub\tape transfers\betacam\sp\Lot #3\LAIDLAW TRANSIT THE BUS STOPS HERE cap 2.avi", fpsnum=30000,fpsden=1001)
    Trim(135, 19651)
    v2=last
    lwlibavvideoource("F:\virtualdub\tape transfers\betacam\sp\Lot #3\LAIDLAW TRANSIT THE BUS STOPS HERE cap 3.avi", fpsnum=30000,fpsden=1001))
    Trim(357, 19873)
    v3=last
    medianblend(v1,v2,v3)
    assumetff()
    converttoyuv444(matrix="rec601", interlaced=true).convertbits(10)
    Levels(70, 1, 990, 0, 1020, coring=false,dither=true).tweak(bright=0, cont=1.00, hue=-0, sat=1.0, coring=false, dither=true).convertbits(8)
    Trim(1500, 19348)
    qtgmc(preset="slow", ezdenoise=0.0, sharpness=0, sourcematch=3,lossless=2,matchenhance=1,tr2=0, subpel=4)
    spotless()
    finedehalo()
    neo_dfttest(sigma=6, tbsize=3)
    f3kdb(range=20, y=80, cb=80, cr=80, dynamic_grain=true)
    cropresize(indar=15.0/11.0, resizewo=true)
    Crop(5, 0, -6, -2)
    SuperRes(matrixin="rec601", 2, .43, 0, """nnedi3_rpow2(4, nns=4, cshift="Spline16Resize")""", matrixout="rec709")
    #SuperRes(2, .43, 0, """edi_rpow2(2, nns=4, cshift="Spline16Resize")""").SuperRes(2, .43, 0, """edi_rpow2(2, nns=4, cshift="Spline16Resize")""")
    x = float(width) / float(height)
    spline36resize(round(x * 2164),2164)
    converttoyv12(matrix="rec709", interlaced=false)
    prefetch(10)
    i have tried both median and medianblend, both with the same result. i have also tried updating avisynth to the latest test version, and the issue persists. i usually encode to hevc_nvenc with ffmpeg, but this also happens in my sd prores encodes. is there a fix for this?
    Quote Quote  
  2. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    First of all, are you sure that the 3 (segments) captures are perfeclty aligned frame by frame?

    For clean captures, I am not a fan of the median operation. Have you tried to compare the first source with the median results and see an effective improvement?
    In addition, with all that processing in term of level adjustement, spot removal, denoise, etc. the median operation is completely useless. (it may have sense if no (deep) processing is planning thereafter).

    In any case, to debug your problem you may want to try to encode after each step of your AviSynth processing to find what is causing it (if any of the plugin is suspected).
    Quote Quote  
  3. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    sorry for the late reply.

    Originally Posted by lollo View Post
    First of all, are you sure that the 3 (segments) captures are perfeclty aligned frame by frame?
    yep.

    Originally Posted by lollo View Post
    For clean captures, I am not a fan of the median operation. Have you tried to compare the first source with the median results and see an effective improvement?
    yeah, there's a difference. less tape glitches. i get them from time to time on my betacam transfers for some reason, hence why i'm using it.

    Originally Posted by lollo View Post
    In addition, with all that processing in term of level adjustement, spot removal, denoise, etc. the median operation is completely useless. (it may have sense if no (deep) processing is planning thereafter).
    i'm not using median to denoise, i don't really notice a difference with and without it in terms of noise. my final file sizes are smaller, but visually it looks the same. i'm just using it to get rid of tape glitches. my betacam deck has noise on the component outputs for some reason. when I do denoise, there's banding, hence the f3kdb.

    Originally Posted by lollo View Post
    In any case, to debug your problem you may want to try to encode after each step of your AviSynth processing to find what is causing it (if any of the plugin is suspected).
    i did an encoding pass with just median and it seems like my issue isn't there. did some more encoding passes and i found out that f3kdb is causing it :/ i don't know why, and i don't know how to fix it. it sucks because its a pretty good debander.
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Have you tried reducing the prefetch number?
    It may have something to do with the parallel thread processing,
    or set mtmode=3 for f3kdb
    Last edited by davexnet; 10th Oct 2024 at 23:46.
    Quote Quote  
  5. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by ENunn View Post
    i'm not using median to denoise, i don't really notice a difference with and without it in terms of noise. my final file sizes are smaller, but visually it looks the same. i'm just using it to get rid of tape glitches. my betacam deck has noise on the component outputs for some reason. when I do denoise, there's banding, hence the f3kdb.
    When you use the median filter somehow you "remove" content non present in all captures. Marginally (random) noise can be part of that.

    What I meant, is that using median to remove random spots is fine (even if you can use a plugin like Spotless() in post processing, although Median() is less invasive for sure); but if you plan to use a later post-processing, the usage Median() for "improving" final look may be useless.

    Originally Posted by ENunn View Post
    i did an encoding pass with just median and it seems like my issue isn't there. did some more encoding passes and i found out that f3kdb is causing it :/ i don't know why, and i don't know how to fix it. it sucks because its a pretty good debander.
    Nice, you find the cause. Not familiar with that plugin, but it appears more like its artefact than a combination of plugin+encoder problem. Does the defect appear before encoding not using AvsPMod but saving the specific portion of the video with a lossless codec and playing it?
    Quote Quote  
  6. Member
    Join Date
    Mar 2019
    Location
    Henderson, KY, USA
    Search PM
    sorry for the months late response. i'm having this issue yet again and i'm not sure how to fix it.

    Originally Posted by lollo View Post
    When you use the median filter somehow you "remove" content non present in all captures. Marginally (random) noise can be part of that.

    What I meant, is that using median to remove random spots is fine (even if you can use a plugin like Spotless() in post processing, although Median() is less invasive for sure); but if you plan to use a later post-processing, the usage Median() for "improving" final look may be useless.
    gotcha

    Originally Posted by lollo View Post
    Nice, you find the cause. Not familiar with that plugin, but it appears more like its artefact than a combination of plugin+encoder problem. Does the defect appear before encoding not using AvsPMod but saving the specific portion of the video with a lossless codec and playing it?
    i tired encoding to both utvideo and prores in ffmpeg and they both have the same issue. but my issue happens randomly at random points, so i can't just save a segment. every encode has unique errors.

    i tried a simpler script:
    Code:
    v = lwlibavvideosource("i:\virtualdub\tape transfers\breathasize breathing program.mkv", fpsnum=30000,fpsden=1001)
    a = lwlibavaudiosource("i:\recordings\breathasize breathing program.flac")
    audiodub(v,a)
    #delayaudio(.150)
    assumetff().converttoyuv422(matrix="rec601", interlaced=true).convertbits(10)
    #Crop(8, 4, -24, -6_
    Levels(60, 1,860, 0, 1020, coring=false,dither=true).tweak(bright=0, cont=1.00, hue=-0, sat=0.850, coring=false, dither=true).convertbits(8)
    #turnRight().Histogram().TurnLeft()
    Trim(535, 83649)
    bob()
    FineDehalo(rx=2.5, ry=1.0)
    LSFplus(ss_x=1.5, ss_y=1.5, secure=false, Spwr=2, SdmpHi=0, soothe=false, keep=25)
    separatefields().selectevery(4,0,3).weave()
    separatefields()
    neo_dfttest(sigma=35, tbsize=5)
    weave()
    neo_f3kdb(dynamic_grain=true)
    converttoyv12(matrix="rec601", interlaced=true)
    prefetch(6)
    Click image for larger version

Name:	WShkvId.png
Views:	11
Size:	346.4 KB
ID:	86168

    i tried using another debander, gradfun3, but it doesn't work at all.
    Click image for larger version

Name:	1dsCv0P.png
Views:	14
Size:	12.9 KB
ID:	86169
    Last edited by ENunn; 18th Mar 2025 at 10:55.
    Quote Quote  
  7. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by ENunn View Post
    i tired encoding to both utvideo and prores in ffmpeg and they both have the same issue. but my issue happens randomly at random points, so i can't just save a segment. every encode has unique errors.
    I had understood that you found the problem beeing in f3kdb.

    So I would just use a simple script with that filter, load it in VirtualDub and save the output in a lossless codec (or even uncompressed) to see if the problem arises.
    If not, I would add the rest of your processing prior to the call of f3kdb within the same procedure, and check.
    If not, I would then try the encoding of the outcome of VirtualDub with your used codecs and check if the problem appears (I doubt this being the cause).
    Quote Quote  



Similar Threads

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