+ Reply to Thread
Results 31 to 60 of 83
-
Agreed.
@db83, @tafflad, et al: I'll return in a little while and post some of the hard to find plugins or active links for them.Last edited by sanlyn; 21st Mar 2014 at 10:53.
-
@sanlyn
That would be good. Am having problems locating chubbyrain2.
There may be others after that line but the script stalls there. -
The "usual" version of chubbyrain2 as referenced by poisondeathray in Doom9. Not perfect, but better than most de-rainbows and without causing lots of damage:
Code:function ChubbyRain2(clip c, int "th", int "radius", bool "show", int "sft") { #based on Mug Funky's ChubbyRain th = default(th,10) # threshold. Actual meaning is uncertain radius = default(radius,10) # temporal smoothing radius show = default(show,false) # sft = default (sft, 10) # temporal smoothing strength u = c.utoy() v = c.vtoy() uc = u.mt_convolution(horizontal="1",vertical="1 -2 1",Y=3,U=0,V=0) vc = v.mt_convolution(horizontal="1",vertical="1 -2 1",Y=3,U=0,V=0) cc = c.mt_convolution(horizontal="1",vertical="1 2 1",Y=2,U=3,V=3).bifrost(interlaced=false).cnr2().temporalsoften(radius,0,sft,2,2) rainbow=mt_lutxy(uc,vc,Yexpr=string("x y + "+string(th)+" > 256 0 ?")).pointresize(c.width,c.height).mt_expand(y=3,u=-128,v=-128)#.blur(1.5) overlay(c,cc,mask=rainbow) show==true? rainbow : last }
Code:chubbyrain2()
Also required, and used by other filters, is bifrost(). A miscellaneous plugins .zip file from another thread includes bifrost, plus SmoothUV, aWarpSharp, ReplaceFramesMC2, santiag, and stab, here: https://forum.videohelp.com/attachments/19037-1374867708/Miscellaneous_plugins.zip . Are these plugins popular and in regular use? Yes. Like many functions, chubbyrain2 requires MaskToolsv2 -- it is included in the download package for MCTemporalDenoise, below.
If you don't have Tritical's TIVTC inverse telecine package, it's here: http://bengal.missouri.edu/~kes25c/TIVTCv105.zip
A little guy, but used everywhere: ChromaShift: http://avisynth.org/warpenterprises/files/chromashift_25_dll_20031104.zip
A higher-level version of the usual Avisynth levels filters, with several functions that use dithering to smooth things out, SmoothAdjust v2.8.0: http://forum.doom9.org/showthread.php?t=154971 , which includes SmoothLevels().
The heavy-hitter -- heavy enough that you have to be careful with it: MCTemporalDenoise (aka MCT, or MCTD). Uses a ton of support plugins, most of which can be used as stand-alones. All gathered into one package here: https://forum.videohelp.com/attachments/19036-1374867528/MCT_Required.zip . This download has subfolders with instructions and docs. The instructions are in a very short .txt file. Read it. Please.
MCTD and some other big-timers also use plugins that come from the RemoveGrain package: https://forum.videohelp.com/attachments/19035-1374866283/RemoveGrain_v1_0_files.zip
And there's more removers in the RemoveDirt v.09 package: https://forum.videohelp.com/attachments/19034-1374861656/RemoveDirtv09.zip . Don't unzip RemoveDirt and RemoveGrain downloads into the same place: some of their files are duplicated.
A sharpener called LSFMod (for "LimitedSharpenFasterMOD") and some anti-alias and line-cleaning plugins require this dandy little support .dll, called VariableBlur40: http://www.tsp.person.dk/VariableBlur040.zip You might be surprised how many filters sneak it in on you.
Don't download these zip's and packages directly into your Avisynth plugins folder. Create a separate folder for receiving downloads, and a separate subfolder for each download. For one thing, many downloads have duplicates and/or different versions of some support files. For another, unzipping everybody's html help files and other goodies into your plugins folder causes huge headaches. Download plugins and packages to their own subfolders, so you won't have to hire somebody to help you find out where you hid them from yourself. Look over the unzip'd goodies and copy only the dll, avs script, or avsi script that you will need in your Avisynth plugins.
A plugin whose name ends with .dll will be loaded automatically if Avisytnh needs it.
A script whose name ends with .avsi will be loaded automatically if Avisytnh needs it.
A script whose name ends with .avs will be not load automatically, but has to be explicitly loaded with the Import() command, like so:
Code:Import("path\to\script-or-plugins\GreatScript.avs")
Last edited by sanlyn; 21st Mar 2014 at 10:53.
-
@sanlyn
Many thanks for this. I was aware that Chubbyrain2 was a function and had come across the code you now quote. I clearly had not read enough of the docs to determine how that was incorporated.
The one thing that puzzles me is that you state that the function must be imported whereas in the code applicable to the Op's video I just see 'Chubbyrain2()' with no import and, as I mentioned, the script coughed as soon as vdub landed on that line. So am I correct that I save the function as 'Chubbyrain2.avsi' and save it in plug-ins folder ? By the time you read this I will have probably tried that out and you can hear the screams if it does not work. But if it does then no harm is done to this 'Avisynth for Dummys'.
I have been downloading the plug-ins I found to date in seperate folders so no risks to cross contamination there -
All was going very well - I read that I had to create a copy of one filter, rename as FFTW3.dll, and move it my system32 folder.
Reloaded the script "Access violation , line 700 test.avs line 26"
Clearly this is a Windoze error but where do I now go ?
edit: sorted. maybe I renamed the wrong file but I now found the plug-in
edit2: I am trying this on the full 40 minte video. Methinks it could be a long day.
edit3: I guess I am going about this the wrong way or my PC is just too slow. The total processing time is frightening in the extreme. While I can not change that, is there a scenario that I could do small sections or is that just asking for trouble ?Last edited by DB83; 14th Sep 2013 at 04:45.
-
No, I didn't include all of the "import" or LoadPlugin settings. Everyone does that differently; for example, I don't keep MCTemporalDenoise as an "avsi", I keep it as an "avs" and import it when I need it. It's helpful to have a text template or two of setup lines that you use regularly. That way, just copy them into new scripts instead of typing all those lines over and over.
The part of that script that runs really slow is MCTemporalDenoise at its highest setting. Reducing the power unfortunately isn't as effective. Running it in two parts prevents the kind of memory and file swapping that slows things down.
As I mentioned, I ran the same script but in 2 steps. You have save the first part as Lagarith YV12 using "fast recompress" in VirtualDub. Be certain before saving the AVI output that you check the color depth, compressor, and "fast recompress" settings before saving. Allowing Virtualdub to convert or save as RGB will cause problems.
This as STEP 1 will run almost as fast as the movie plays:
Code:AViSource("path\to\avi\GD_sample.avi") AssumeTFF().TFM(order=1).TDecimate() ColorYUV(cont_y=30,off_y=-45,off_u=-5) #,gamma_y=-1) ConvertToYV12(interlaced=false) SmoothLevels(8,1.2,255,12,240,chroma=200,limiter=0,tvrange=true,dither=100,protect=6) a=last # -- save starting point as "a" e1=a.SelectEven() # -- filter "e1" EVEN frames, keep results as "e2" e1 chubbyrain2() smoothuv(radius=7) e2=last o1=a.SelectOdd() # -- filter "o1" ODD frames, keep results as "o2" o1 chubbyrain2() smoothuv(radius=7) o2=last Interleave(e2,o2) # -- rejoin e2 + o2, crop and keep as "b" crop(0,0,0,-444,true) b=last overlay(a,b,opacity=0.75) # -- overlay cleaned top border "b" onto "a" return last # ##=== Save as YV12 Avi with lossless Lagarith compression === ## # ##=== in VirtualDub using "fast recompress" === ##
Code:AviSource("path\to\avi\Step1.avi") #<- or whatever its name is MergeChroma(MCTemporalDenoise(settings="very high",interlaced=false)) Cnr2("xxx",4,5,255) ChromaShift(C=2) AssumeFPS("NTSC_FILM") return last # ##=== Save as YV12 Avi with lossless Lagarith compression === ## # ##=== in VirtualDub using "fast recompress" === ##
Members who use MCTD with the MT version of Avisynth can offer their suggestions on multithreaded use. Some plugins won't run with MT enabled (TIVTC does some of it automatically, so no problem there). Avisynth "MT" often doesn't work in some systems. I gave up on it. It took longer to set up and tweak MT settings than it did to just run the scripts. Your mileage might vary, but I'm still waiting for the MT versions to be more ready for prime time. Even if I included MT settings in a posted script, they'd likely work on my PC but not on yours.
I've saved the output of this first cleanup phase as YV12 because I'm still looking for some effective but fairly non-destructive denoisers for all that tape grunge in the video. I wouldn't try to remove 100% of it, because a lot of that grunge is what VHS calls "detail". The more of it you remove, the less "detail" you keep, until the vid starts looking like it's made of jello.Last edited by sanlyn; 21st Mar 2014 at 10:54.
-
Thanks for that.
'tis time to adopt the second script(s) since I am being told that to run the first will take another 8 days, 10 hours. {don't think I could find a graemlin to express that} -
McTemporalDenoise() is probably the culprit, it's very slow. You can use Trim() to process only a portion of your video:
Trim(1000,2000)
That will limit the script to processing frames 1000 to 2000 (inclusive).
If you're brave you can download a multithreaded build of AviSynth and use SetMtMode() to control then number of threads and threading model. That can significantly speed up processing on multicore CPUs. -
Trim is good advice. I never process a full 40-minute video from first stage to last, as one piece. Most people would use short segments, then join them for encoding as a last step. If you do it all at once and later decide that a couple of short segments really must be fixed at an earlier stage (it always happens), you're stuck with doing the whole thing again. Once you've encoded, transferred to disc or a drive, and amazed your friends with the results, discard the intermediate files -- but save the scripts and, if possible, the original capture.
Last edited by sanlyn; 21st Mar 2014 at 10:54.
-
Thanks guys.
I DID process the entire 40 minute vid for the first part and, although it was not 1:1, it only took 90 minutes on this dinossaur.
I will leave the second part for another day and play around with 'trim'. Ultimately, it is up to the OP as to how far he goes with this but I for one have already learnt some.
{Big Thumb] to you -
A little more work. Added a "Step 3" by using a denoise and chroma cleanup routine borrowed from 2BDecided. I made a function out of it (this version is for non-interlaced video). Removing some of the noise killed some dot crawl on edges and some chroma smear. Also alloowed to reduce bitrate a bit. The script runs at about 6 fps. You could probably get rid of even more noise in the sky, but you'll lose too much fine detail in the water spray.
Top image is where we started with the original AVI. Bottom image is result of more work, posted as "sample_Denoise_TestF.mkv" (23.972, pulldown not added yet). In the top "original" you'll also see lots of magenta rainbows in the sky, plus haloing and other junk. Note in the bottom photo that part of the white tow line was "averaged out". Well, you can't have everything. It looked like chroma noise to MCTD. If you can see the difference on playback, you're getting pretty good. Also cropped off some bristling dot crawl on the side borders and some frame hopping at top and bottom.
The MvDegrain2_2B function uses the older version of mvtools. You can have both versions of mvtools v1 and v2 in your plugins folder because the functions within the two versions have different names. Older version 1.11.45 here: http://avisynth.org.ru/mvtools/mvtools.html
Code:Import("path\to|pluygins\chubbyrain2.avs") AviSource("path\to\video\Step2.avi") # ##=== one more run for chubbyrain2, this time === ## # ##=== with just the top 20 pixels + tweak. === ## a=last a chubbyrain2() smoothuv(radius=7) SmoothTweak(hue1=3,hue2=-2) crop(0,0,0,-460,true) b=last overlay(a,b,opacity=0.85) MVDegrain2_2B(last) # ##=== function text at end of script === ## LSFMod(defaults="slow",strength=150) GradFun2DBmod(thr=1,mask=false) AddGrainC(1.5, 1.5) Crop(4,2,-2,-2).AddBorders(4,2,2,2) return last Function MVDegrain2_2B(clip) { source=clip # <--- save original video #-----denoiser: backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1) backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1) forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1) forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1) source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1) clean=last #save cleaned version diff1=subtract(source,clean).Blur(0.25) diff2=diff1.blur(1.5,0) diff3=subtract(diff1,diff2) # <- diff3 is high-ish frequency noise only sharpen(0.4,0.0) # sharpen cleaned version a little #--- mix high frequency noise back in overlay(last,diff3.levels(128,1.0,255,0,127,coring=false),mode="add", opacity=0.7) overlay(last,diff3.levels(0,1.0,127,128,255,coring=false).Invert(),mode="subtract", opacity=0.7) #--- put cleaned chroma back in with warp sharpening mergechroma(clean.aWarpSharp(depth=20.0, thresh=0.75, blurlevel=2, cm=1)) return last }
-
Ooh Goody. Even more work
Can I ask one (to you I am sure, stupid) question. I note from the first step that the video is now 24 fps (originally 30 fps). I guess that the IVTC does that. Does part 2 return it to 30 fps or is that done in your encoder (ie with pull-down) ?
Also, is there some magic formula to determine if the source was originally film or video ? -
The fps is 23.976. Normally one would add 3:2 pulldown flags to get 29.972 fps. I just didn't do it here because viewers such as VirtualDub or NLE's that don't deinterlace would show 2 "interlaced" frames for every 5, when in fact with soft-coded pulldown flags the interlace doesn't physically exist.
There are all kinds of "video" source out there. Pro film (i.e., negative film) is shot as 23.972 or close to it. Movie film originals are pure progressive. They get digitized with some form of telecine for the "30fps" world. A telecined movie in VirtualDub would have what appears to be 2 interlaced frames for every 5 frames (for NTSC 23.976 -> 29.972). With something like anime you can find some very strange structures and horrible field or frame blending to boot, because a lot of anime is created at 15fps.
When a telecined VHS video is captured, the tape plays as hard-coded telecine: that is, the interlaced frames in the tape playback really are captured as interlaced, not just flagged that way in the video's header data.Last edited by sanlyn; 21st Mar 2014 at 10:55.
-
I did take a closer look at DScaler and its deinterlace dialogues. On one of the automatic detection settings its changing on playback from bob to 3:2 pulldown with various field skipping.
Is it then possible that some sequences were shot on video and others on film ? The tape dates from 1992. -
Update:
I took a look at 'Part 2'. Now if I could, as stated, get 3 or 4 frames per second I would be quite happy. It is reported that I am getting 1 frame every 5 secs. Ouch !!!
To illustrate that, if I considered doing the whole vid in one go, it would take over 3 days (the numbers were increasing) or 75+ hours. So even trimming the vid and running the encodes for 12 hours at a time I am still looking at over 6 days.
Yes my CPU is slow by current standards but I never built this system with this sort of work in mind - it performs quite fine with NLE's and other stand-alone encoders with filtering (Procoder etc.). Its not important for this vid as it is the OP who probably has something a wee bit faster who will be crunching the numbers. But I am thinking of the other NTSC tapes I personally own (which I readilly admit I do not know would need this level of filtering). To paraphrase another poster "Anything I can do in just 3 hours ?" -
Less than 1fps? Something wrong. Similar scripts run about 2.5 fps on my ancient 2.2Ghz dual-core Athlon and low-rent Biostar mobo. Your dual-core Intel e8400 @3GHz should be at least as fast as my old build. Your 2GB RAM shouldn't be an issue (my old Athlon only has 1.5G). You could try running the script with only the MCTemporalDenoise line and comment-out the other lines with a "#" at the start of the lines you don't want. The input to the second part ought to be YV12, and make certain VirtualDub is set for YV12 output, Lagarith with YV12, and fast recompress. Forgetting to do that in VDub will slow it down trying to convert to RGB. We still have members here who are running MCTD scripts with Pentium 4's!!
Last edited by sanlyn; 21st Mar 2014 at 10:55.
-
Well I know that I set the output for Part 1 as YV12. Mediainfo shows Lagarith YUV. (the original source being Huff RGB). And I am sure that part has worked since the created clip is substantially smaller than the original.
Looking at the 32 second clip I created from Part 2 (before I cancelled the process), which took one hour, that also shows Lagarith YUV.
I will try again when I have some time and eliminate as many non-essential services etc. at runtime. Also turn off da 'net. Trouble is, I have only one PC and there are things that I simply must do while the encoding is going on -
Hope you make progress. I work with my newer PC build now (still XP Pro), but even on the newone I turn all the auto stuff (no auto Win update, no browser updates, nothing but basic services going). Bit a dual-core 3GHz Intel shouldn't be running that slow.
That's what MediaInfo says, but it makes that error often with 4:2:2 color source. The original that was submitted is Huff YUY2. Try this script:
AviSource("path\to\original\capturte.avi")
Info()
Some data in yellow will appear in the frames. Near the top of the data you'll see "YUY2" for color.
You'll also see "Bottom Field First"as field priority. That's wrong. It's TFF. Just goes to show ya: can't trust anything nowadays.Last edited by sanlyn; 21st Mar 2014 at 10:55.
-
[QUOTE=jagabo;2267430] Then the capture was screwed up in the first place.
In what respect? The AVI that was submitted is the source that was used for my script. The first statement in the script opens the AVI. The second statement uses TIVTC. The third statement uses ColorYUV. I know that TIVTC and ColorYUV will work in YV12 or YUY2. I don't think either will work if the input at that point is RGB. If the submitted AVI had a colorspace change from the unedited original capture, I wouldn't be aware of it.Last edited by sanlyn; 21st Mar 2014 at 10:55.
-
Oops. m'gosh, you had me confused (J.H.C., don't tell me I worked the wrong video
).
No problem.Last edited by sanlyn; 21st Mar 2014 at 10:56.
-
A quiet afternoon. Cricket (always a relaxing experience) on the tv. What better a time to run another test.
Turned off everything I thought could slow this down. And...
In the original test, I got .20 frames per second over the one hour. Total render time 75 hours+
In the new test, I got 2.18 frames per second over the one hour. Total render time estimated at 7hrs 35min.
Monitored CPU usage as well and for all practical purposes only vdub (52% CPU) was running.
Ok. I can live with this and with 'Trim' can do this comfortably in two 3-4 hour sessions. -
Good work. I have a ton of ugly icky noisy trashy captures that required some slow industrial-strength filtering. This vid isn't that bad, but every time one encounters stuff like that top border flashing it's really a hassle. I cringe every time I see it because I know it'll take forever and I'll have to work in separate steps with shorter segments. If this video didn't have that one problem, the heavy duty routine wouldn't be needed at all.
Try this post from July, which took even more work (and time): https://forum.videohelp.com/threads/357064-Advice-on-what-filters-to-use-when-convertin...=1#post2256361
The original capture: j.avi https://forum.videohelp.com/threads/357064-Advice-on-what-filters-to-use-when-convertin...=1#post2256361
There are even worse jaw-droppers in post 42 and 44 of that thread. And you thought you had a problem! There are lots of scripts in that thread one can learn from. I certainly did. Credit some from jagabo, too.Last edited by sanlyn; 21st Mar 2014 at 10:56.
-
So to recap, if one just identifies the sequenes that have the top border issue - and it is not present throughout the full run-time - one can leave some lines of the code out ?
Which then begs the question. Which lines ? -
The lines that use chubbyrain2 and MCTD.
Last edited by sanlyn; 21st Mar 2014 at 10:56.
-
Thanks.
I guess (probably incorrectly) that they do not harm the other footage. Part 1 (with chubby) was fairly fast and Part 2(with MCTD) is now 'managable'. And if the colour band is variable it could get quite complicated in having small chunks of video which have to be re-assembled in the right order afterwards. But I guess that is the way you 'pros' do it.
Sorry for all the questions. We all have to learn sometime. -
Yep. This business of working in sections is done all the time. Pain in the neck. Welcome to VHS.
Last edited by sanlyn; 21st Mar 2014 at 10:56.
-
I have HuffYUY installed but the video is all garbled for me, so I can't see anything to do this properly. But when there's a section of a frame needing some work, this often does the trick:
A=Last
B=A.ReplaceFramesMC(258,4)
B=B.Crop(0,0,0,-450)
Overlay(A,B,0,0)
Just an example. The script says to interpolate 4 frames beginning with number 258 and to do it for only the top 30 pixels. Leave the lower 450 rows of pixels alone. You can also create a mask and feather it if necessary. It may not be applicable to this video at all, but I use something similar quite often. If the part being 'fixed' is relatively static and other parts of the frames are moving it can be very helpful in preventing motion artifacts in the rest of the frames. You can repeat it for different sets of frames as long as you have the memory available.
Similar Threads
-
Present state of play with B&W conversion to Colour
By GeneLamp in forum Newbie / General discussionsReplies: 39Last Post: 30th Jun 2013, 19:03 -
Colour Conversion problems with Avisynth
By wiseant in forum Video ConversionReplies: 6Last Post: 16th Mar 2011, 11:40 -
Dual band or not?
By yamatosoul in forum Video Streaming DownloadingReplies: 3Last Post: 30th Nov 2009, 17:35 -
Green Band Problem
By fusion99 in forum Blu-ray RippingReplies: 4Last Post: 6th Aug 2009, 11:58 -
green band after using restream
By thecrock in forum Newbie / General discussionsReplies: 0Last Post: 15th Dec 2008, 14:37