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:
encode:
script:
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?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)
+ Reply to Thread
Results 1 to 7 of 7
-
-
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). -
sorry for the late reply.
yep.
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.
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.
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. -
Have you tried reducing the prefetch number?
It may have something to do with the parallel thread processing,
or set mtmode=3 for f3kdbLast edited by davexnet; 10th Oct 2024 at 23:46.
-
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.
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? -
sorry for the months late response. i'm having this issue yet again and i'm not sure how to fix it.
gotcha
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)
i tried using another debander, gradfun3, but it doesn't work at all.
Last edited by ENunn; 18th Mar 2025 at 10:55.
-
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).
Similar Threads
-
Returning User from 2019.. Preview Video now inoperative, plus glitches
By pak.Hanafi in forum Newbie / General discussionsReplies: 0Last Post: 8th Oct 2023, 19:43 -
Bitrate fluctuates more than I like in encoded video
By killerteengohan in forum RestorationReplies: 14Last Post: 16th Aug 2023, 11:07 -
Can I get preset info of encoded video?
By Anonymous543 in forum Newbie / General discussionsReplies: 1Last Post: 17th Jan 2022, 09:50 -
Median() plugin for Avisynth
By ajk in forum RestorationReplies: 74Last Post: 17th Mar 2020, 13:53 -
Virtualdub2 median filter?
By DiggyDre in forum RestorationReplies: 4Last Post: 2nd Jan 2020, 20:05