You need the RemoveDirtMC filter. There are several variations around. Here's the one that I used.
Put that in an AVSI file in the plugins64+ folder. Or plugins+ for 32 bit.Code:##################################################################### # # https://forum.videohelp.com/threads/382527-Need-help-setting-up-avisynth-pls%21?p=2477423&viewfull=1#post2477423 # ###################################################################### #REMOVE DIRT FUNCTION #...................................................................................................................................................................... function RemoveDirt(clip input, int "limit", bool "_grey") { clensed=input.Clense(grey=_grey, cache=4) alt=input.RemoveGrain(2) return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=30,cthreshold=8, gmthreshold=40,dist=3,dmode=2,debug=false,noise=limit,noisy=4, grey=_grey) # Alternative settings # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=4,cthreshold=6, gmthreshold=40,dist=1,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=true) # return RestoreMotionBlocks(clensed,input,alternative=alt,pthreshold=6,cthreshold=8, gmthreshold=40,dist=3,tolerance= 12,dmode=2,debug=false,noise=limit,noisy=12,grey=_grey,show=false) } function RemoveDirtMC(clip, int "limit", bool "_grey") { _grey=default(_grey, false) limit = default(limit,6) # prefiltered = fft3dfilter(clip,sigma=1,sigma2=2,sigma3=3,sigma4=5,bw=64,bh=64) prefiltered = RemoveGrain(clip,2) superfilt = MSuper(prefiltered, hpad=32, vpad=32,pel=2) super=MSuper(clip, hpad=32, vpad=32,pel=2) bvec = MAnalyse(superfilt,isb=true, blksize=16, overlap=2,delta=1, truemotion=true) fvec = MAnalyse(superfilt,isb=false, blksize=16, overlap=2,delta=1, truemotion=true) # Increase thSAD if moving objects are being removed!! bvec_re = Mrecalculate(super,bvec,blksize=8, overlap=0,thSAD=20) fvec_re = Mrecalculate(super,fvec,blksize=8, overlap=0,thSAD=20) backw = MFlow(clip,super,bvec_re,thSCD1=900,thSCD2=200) forw = MFlow(clip,super,fvec_re,thSCD1=900,thSCD2=200) clp=interleave(forw,clip,backw) clp=clp.RemoveDirt(limit,_grey) # Alternative to RemoveDirt call above # clp = clp.DeSpot(p1=20, p2=4, pwidth=30, pheight=30, mthres=22, merode=33, sign=1, seg=0, color=false, \ # motpn=false, fitluma=true, mark_v=255) # clp = clp.invert.DeSpot(p1=12, p2=6, pwidth=18, pheight=16, mthres=22, merode=25, p1percent=10, sign=1, show=Show, seg=1, \ # color=true, motpn=false, mark_v=255).invert clp=clp.SelectEvery(3,1) return clp }
I'm not sure if it requires any other filters you don't already have...
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 54 of 54
Thread
-
Last edited by jagabo; 15th Jan 2022 at 10:49.
-
ok so things were goin just fine then it got stuck on a frame in the full length video.... and it's been stuck there for 4 hours lol
here's my status dump
Code:================= Processing thread ================= Completed: No Error encountered: No Video push ended: No Video ended: No Flushing compressor: No Codec frames buffered: 0 Video input pipe: 0/32 buffers active (0 non-preload frames) No buffers pending. Pending source frames: 32 Frame 6242 | Batch 6242 | Pending Frame 6243 | Batch 6243 | Pending Frame 6244 | Batch 6244 | Pending Frame 6245 | Batch 6245 | Pending Frame 6246 | Batch 6246 | Pending Frame 6247 | Batch 6247 | Pending Frame 6248 | Batch 6248 | Pending Frame 6249 | Batch 6249 | Pending Frame 6250 | Batch 6250 | Pending Frame 6251 | Batch 6251 | Pending Frame 6252 | Batch 6252 | Pending Frame 6253 | Batch 6253 | Pending Frame 6254 | Batch 6254 | Pending Frame 6255 | Batch 6255 | Pending Frame 6256 | Batch 6256 | Pending Frame 6257 | Batch 6257 | Pending Frame 6258 | Batch 6258 | Pending Frame 6259 | Batch 6259 | Pending Frame 6260 | Batch 6260 | Pending Frame 6261 | Batch 6261 | Pending Frame 6262 | Batch 6262 | Pending Frame 6263 | Batch 6263 | Pending Frame 6264 | Batch 6264 | Pending Frame 6265 | Batch 6265 | Pending Frame 6266 | Batch 6266 | Pending Frame 6267 | Batch 6267 | Pending Frame 6268 | Batch 6268 | Pending Frame 6269 | Batch 6269 | Pending Frame 6270 | Batch 6270 | Pending Frame 6271 | Batch 6271 | Pending Frame 6272 | Batch 6272 | Pending Frame 6273 | Batch 6273 | Pending Pending output frames: 32 Frame 6242 | Batch 6242 | Hold 0 | Null 0 | Direct 0 Frame 6243 | Batch 6243 | Hold 0 | Null 0 | Direct 0 Frame 6244 | Batch 6244 | Hold 0 | Null 0 | Direct 0 Frame 6245 | Batch 6245 | Hold 0 | Null 0 | Direct 0 Frame 6246 | Batch 6246 | Hold 0 | Null 0 | Direct 0 Frame 6247 | Batch 6247 | Hold 0 | Null 0 | Direct 0 Frame 6248 | Batch 6248 | Hold 0 | Null 0 | Direct 0 Frame 6249 | Batch 6249 | Hold 0 | Null 0 | Direct 0 Frame 6250 | Batch 6250 | Hold 0 | Null 0 | Direct 0 Frame 6251 | Batch 6251 | Hold 0 | Null 0 | Direct 0 Frame 6252 | Batch 6252 | Hold 0 | Null 0 | Direct 0 Frame 6253 | Batch 6253 | Hold 0 | Null 0 | Direct 0 Frame 6254 | Batch 6254 | Hold 0 | Null 0 | Direct 0 Frame 6255 | Batch 6255 | Hold 0 | Null 0 | Direct 0 Frame 6256 | Batch 6256 | Hold 0 | Null 0 | Direct 0 Frame 6257 | Batch 6257 | Hold 0 | Null 0 | Direct 0 Frame 6258 | Batch 6258 | Hold 0 | Null 0 | Direct 0 Frame 6259 | Batch 6259 | Hold 0 | Null 0 | Direct 0 Frame 6260 | Batch 6260 | Hold 0 | Null 0 | Direct 0 Frame 6261 | Batch 6261 | Hold 0 | Null 0 | Direct 0 Frame 6262 | Batch 6262 | Hold 0 | Null 0 | Direct 0 Frame 6263 | Batch 6263 | Hold 0 | Null 0 | Direct 0 Frame 6264 | Batch 6264 | Hold 0 | Null 0 | Direct 0 Frame 6265 | Batch 6265 | Hold 0 | Null 0 | Direct 0 Frame 6266 | Batch 6266 | Hold 0 | Null 0 | Direct 0 Frame 6267 | Batch 6267 | Hold 0 | Null 0 | Direct 0 Frame 6268 | Batch 6268 | Hold 0 | Null 0 | Direct 0 Frame 6269 | Batch 6269 | Hold 0 | Null 0 | Direct 0 Frame 6270 | Batch 6270 | Hold 0 | Null 0 | Direct 0 Frame 6271 | Batch 6271 | Hold 0 | Null 0 | Direct 0 Frame 6272 | Batch 6272 | Hold 0 | Null 0 | Direct 0 Frame 6273 | Batch 6273 | Hold 0 | Null 0 | Direct 0 Video filter system -------------------
[Attachment 63085 - Click to enlarge]
Any ideas??
EDIT: Oh and did I mention when I click abort, it doesn't really stop and I have to kill the vdub2 process.....Last edited by Lord Rakim; 25th Jan 2022 at 11:02.
-
Sometimes just trying again will work. If you're using a lot of threads using fewer will usually help.
-
Well I'm on try #4 right now... it seems to have gotten further than the last time lol
Using Lagarith for output (stopped on fram 6242).... think I'm gonna try Grass Valley Lossless for output and see if that comes out any better
EDIT:GV Lossless stopped at frame 8840
Gonna try ProRes next.... it froze too
So I'm just gonna go uncompressed... hell I have the room lol it seems to be working just fine.... at 10700/16855 frames!
So i rebooted the PC, started just Vdub2 and let it do uncompressed and it actually finished!Last edited by Lord Rakim; 25th Jan 2022 at 15:53. Reason: adding some output codec details
-
-
-
-
The timecodes (timestamps) keep it in sync "blah.times.txt" . They compensate for the dropped duplicate frames by adjusting the timestamps. You mux that into the container, such as with mkvmerge or mp4fpsmod
Or, if you want to re-introduce the (hard) duplicates (now clean) you can use VFR to CFR which will read the timestamps , or timecodefps
http://avisynth.nl/index.php/VfrToCfr
https://github.com/Asd-g/TimecodeFPS -
If you didn't use the exact same clip and the exact same settings you won't get the same change. You can take the original number of frames and the number of frames after dedup to calculate the correct frame rate:
Code:new frame rate = old frame rate * dedup frame count / original frame count
Yes, that's another way to keep the running time. In fact it's better as it will keep the audio and video in sync all the way through. -
soooo I got VfrtoCFr (and FFMS2 to use FFVideoSource) and created this script
Code:FFVideoSource( "d:\videos\new\misc\clean up dungeon video-27fps.avi", timecodes="d:\videos\temp\blah.times.txt" ) vfrtocfr( timecodes="d:\videos\temp\blah.times.txt", fpsnum=30000, fpsden=1001 ) audiodub( FFAudioSource("d:\videos\temp\at_the_dungeon.clips.wav") )
Code:Complete name : d:\videos\new\misc\clean up dungeon video-27fps.avi Format : AVI Format/Info : Audio Video Interleave Format profile : OpenDML File size : 13.0 GiB Duration : 10 min 12 s Overall bit rate : 183 Mb/s Writing library : VirtualDub2 build 44282/release
Code:Complete name : D:\videos\temp\at_the_dungeon.clips.wav Format : Wave File size : 107 MiB Duration : 10 min 37 s Overall bit rate mode : Constant Overall bit rate : 1 411 kb/s Writing application : Lavf57.65.100
I feel like I'm almost there lol
EDIT: Used vdub to create a WAV file after getting a warning about VBR and here is the result
Code:Complete name : d:\videos\temp\at_the_dungeon.clips-fromvdub1.wav Format : Wave File size : 107 MiB Duration : 10 min 37 s Overall bit rate mode : Constant Overall bit rate : 1 411 kb/s
Code:Complete name : D:\videos\temp\at_the_dungeon.clips-fromvdub2.wav Format : Wave File size : 107 MiB Duration : 10 min 37 s Overall bit rate mode : Constant Overall bit rate : 1 411 kb/s
pazera - 112,541,262
vdub1 - 112,508,820
vdub2 - 112,508,700Last edited by Lord Rakim; 27th Jan 2022 at 11:25.
-
FFVideoSource( "d:\videos\new\misc\clean up dungeon video-27fps.avi", timecodes="d:\videos\temp\blah.times.txt"
("timecodes" and "timestamps" are the samething BTW)
So if you ran that, you overwrote the original blah.times.txt data from dedup
When you run the original script, and mux in timecodes (timestamps) with either mkvmerge or mp4fpsmod (or encode with x264 with the --tcfile-in option), that becomes VFR and in sync
But if you wanted CFR , you can add vfr2cfr or timecodefps to the original script after dedup and the denoising ; or reading a VFR file directlyLast edited by poisondeathray; 27th Jan 2022 at 11:26.
-
Ooops lol
When you run the original script, and mux in timecodes (timestamps) with either mkvmerge or mp4fpsmod (or encode with x264 with the --tcfile-in option), that becomes VFR and in sync
But if you wanted CFR , you can add vfr2cfr or timecodefps to the original script after dedup and the denoising ; or reading a VFR file directly
So it looks like this?
Code:FFVideoSource( "d:\videos\new\misc\clean up dungeon video-27fps.avi") vfrtocfr( timecodes="d:\videos\temp\blah.times.txt", fpsnum=30000, fpsden=1001 ) audiodub( FFAudioSource("d:\videos\temp\at_the_dungeon.clips.wav") )
Last edited by Lord Rakim; 27th Jan 2022 at 12:05.
-
Code:LWLibavVideoSource("at_the_dungeon.clips.avi", cache=false, prefer_hw=2) Crop(0,8,-0,-16) #DupMC(log="blah.dup.txt") return(last) DeDup(threshold=5.0, trigger2=22, maxcopies=4, maxdrops=4, show=false, log="blah.dup.txt", times="blah.times.txt") SMDegrain (tr=9, thSAD=3000, refinemotion=false, contrasharp=false, PreFilter=0, mode=0, truemotion=true, plane=4, chroma=true) RemoveDirtMC() QTGMC(InputType=2, sharpness=0.3) CAS(0.5) nnedi3_rpow2(2, cshift="Spline36Resize") aWarpSharp2(depth=5) CAS(0.5) AssumeFPS(29.97) vfrtocfr( timecodes="d:\videos\temp\blah.times.txt", fpsnum=30000, fpsden=1001 ) audiodub( FFAudioSource("d:\videos\temp\at_the_dungeon.clips.wav") )
EDIT: so i tried it this way and it ALMOST is perfectly in sync..... gonna try puttin the VFR & audio lines before AssumeFPS and see what happens....Last edited by Lord Rakim; 29th Jan 2022 at 09:22.
-
neither way has worked BUT i did find what I think is the original MPG i had before I encoded it into XVID... so maybe this will work better with the script to keep my audio in sync...
-
-For the 1st script after the 2nd pass encode, you add in the timecodes(timestamps) to make it in sync. You could use mkvtoolnix. This is producing VFR. Done. This will make it in sync. You do not have to add audio to the script, you can add original audio (no quality loss)
-VFRtoCFR is for after you mux in timecodes . If you want to convert VFR BACK to CFR for some reason. It's a separate script . It essentially reverses (1) by adding in new duplicates where they were dropped. The difference is they are now clean duplicates. Duplicates were removed in the first place because they impair temporal filtering effectiveness -
You can convert a VFR soure to CFR with source filters like LSMASHVideoSource() and ffVideoSource(). Just add numerator and denominator arguments.
Code:LSMASHVideoSource("filename.mp4", fpsnum=NUM, fpsden=DEN)
-
How do I use MKVToolnix with the timecodes??? Talk to me like I'm 7 lol
Been busy with other projects for work so my brain is not working right..... but I wanna learn how do this right if I have some similar projects that come up like a lot of old family footage.... -
when you run the 1st pass there is a file produced times="blah.times.txt" . That "blah.times.txt" are the timecodes (timestamps) that keep everything in sync for VFR (duplicates were dropped from dedup, those timestamps compensate for those drops)
If you're using the mkvtoolnix GUI , when you add your video, select the video track (left click) , and on the right column there is a field "Timpstamp file" . Push the button to the right and select the location for "blah.times.txt". Push start multiplexing -
[QUOTE=poisondeathray;2647559]
[Attachment 63263 - Click to enlarge]
OK I think I got this..... got it running now and it looks successful!
Thank you!
EDIT: it looks a lil off near the end of the video, so I'm gonna try the other WAV I extracted with vdub2 and see if it works better....Last edited by Lord Rakim; 10th Feb 2022 at 13:39. Reason: almost there
-
what an interesting thread i agree the results looked magical. i hate dealing with scripting but man the results !!! i am going to download the file and give it a go in resolve but i dont expect anything as good as what i see but ill do my best for a comparison
-
heres my first go at it with 5 mins in davinchi resolve studio used the noise reduction and sharpening tools
-
i took a run at it with veai using the proteus fine tune model i upped the revert compression setting but let it auto choose the rest of settings i think a pass like this then using davinchis dirt removal could have a good result i am late for bed but posted this up on a facebook resolve group to see what they could come up with
-
Similar Threads
-
[Avisynth] Gradually transition from clip A to clip B with a “wipe” effect
By abolibibelot in forum Video ConversionReplies: 6Last Post: 31st Oct 2021, 09:47 -
What type of noise is this?
By Cherbette in forum EditingReplies: 9Last Post: 21st Oct 2020, 11:27 -
Any way to reduce this noise?
By natfunk71 in forum CapturingReplies: 1Last Post: 8th May 2020, 01:32 -
Artifact cleanup
By killerteengohan in forum RestorationReplies: 15Last Post: 21st Apr 2020, 19:21 -
VHS Noise
By Micheal81 in forum CapturingReplies: 15Last Post: 8th Feb 2020, 17:23