View Full Version : VHS filter setup I'm using - feedback?
FredThompson
15th June 2003, 08:04
I've tried some of the VirtualDub filters for cleaning up VHS captures of natural subjects (not animation):
Original frame: http://www.geocities.com/fredthompson6/Screenshots/TitleImageRaw.png
2D cleaner optimized and temporal smoother = a slightly impressionist feeling and almost a layering effect by removing subtle depth differences
Smart Smoother High Quality = dog slow, 3-4 fps on an Athlon 2100 on full D1 source. Less impressionist effect than 3D cleaner but creates unwanted smoothing in some static areas. I like it when cleaning up a poor MPEG source but not for "natural" sources.
Sample Frame: http://www.geocities.com/fredthompson6/Screenshots/TitleImageOldMethod.png
Here's what I'm using now with AviSynth 2.5x. It runs fairly fast (9-10 fps on Athon 2100, full D1) and has done a good job of removing the chroma noise as well as keeping detail:
(edit: new version June 24th - see notes later in thread)
AVISource("source.avi")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Cnr2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FluxSmooth-2.5.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Dup.dll")
# If DV source and want to make it bottom field first
# DoubleWeave().SelectOdd()
# If deinterlacing:
# FieldDeinterlace(blend=true)
# If keeping interlaced:
SeparateFields()
# If decombing (film source and want to make it progressive)
# Telecide()
# Decimate(cycle=5)
# Remove temporal noise
# This MUST go before CNR2
fluxSmooth()
# Remove chroma noise
Cnr2("xxx",4,5,255)
#Replace duplicate frames (only for animation)
# Dup(copy=true, blend=true)
# If keeping interlaced:
Weave()
Sample Image: http://www.geocities.com/fredthompson6/Screenshots/TitleImageCurrentMethod.png
decomb
deinterlacing. Needed by some noise filters and will be replaced when Donald Graft's new version is out of beta. Might go with his new bobbing routine then the filters then back down to compliant interlaced. Dunno about that, need to test after the filters are more stable. If there is relatively little motion, I prefer to go to progressive frames as bandwidth goes farther even though MPEG-2 can handle interlaced frames.
Quite a bit of transmitted source actually starts as film. If that's the case, I use decomb to get back to the original progressive version.
Cnr2.dll
Chroma noise removal for VHS and (to some extent) S-VHS source.
FluxSmooth-2.5.dll
A weighted area and temporal noise remover that doesn't smooth too heavily.
Dup.dll
Detects and replaces duplicate frames to gain bandwidth with VBR encoding by removing variance between consecutive static frames. Would LOVE an area-based version so static areas would also get this treatment.
Web page with samples and images: http://www.geocities.com/fredthompson6/
Does anyone have suggestions of how to make this faster or any glaring problems with this script? Is Dup in the proper location?
sh0dan
15th June 2003, 11:50
This is probably the forum you'll recieve the best responses.
magnetoskop
17th June 2003, 02:04
fielddeinterlace is darn ugliest deinterlacer i've layed my eyes on to....(smoothdeinterlace,tomsmocomp both work much better),as fd is not ment to be used in that way anyhow..(it's fast telecide post-process....to remove any combed frames that pass........)
also,you have (again) non-working link (ads only,no image...)
wrt the process of smoothing then adding noise, this is for VHS source.
not much sense here,is there?
you're first denoising and then adding noise before the encoder?
how about leaving that noise there in the first place?
(or you use mpeg2 capturing so you don't capture the noise really?)
if you feed mpeg2 encoder with enough noise,it is devoting much bits to spatial information and less to temporal,so movement might suffer....
Does anyone have suggestions of how to make this faster or any glaring problems with this script?
if it looks good to you,ask no questions...(or fix that link so we can see the samples....)
FredThompson
17th June 2003, 06:07
(junk removed)(Edit: TomsMoComp and SmoothDeinterlace 2.5 versions don't perform as well. Example is on my site.)
Kika
18th June 2003, 00:25
Imho that's much too much. I never use more than Noise Reduction while capturing. OK, i'm producing MPEG2-Videos, so there's no need to do any Deinterlacing...
FredThompson
18th June 2003, 00:48
much too much WHAT? I'm very interested in tweaking/improving this script but am not sure what caught your eye.
(edit: content folded into first post)
Kika
18th June 2003, 01:02
much too much WHAT?
Too much denoising...
I prefer to go to progressive frames
But you never get progressive Frames from interlaced source. No matter what type of deinterlacing you use, it decreases the quality of sharpness or moving. That's a fact.
Cnr2.dll
Nothing to say against this Filter...
undot.dll and FluxSmooth
Two Noise-Filters? That's what i called "too much".
Dup.dll
Only usefull on deinterlaced Videos - a type of Videos i don't like. ;)
BlockBuster
It acts a little like the option Dithered Quantisation in CCE - but CCE can do this much better than this Filter.
And if you are using TMPGEnc... Soften Block Noise is a DCT-based Noise Reduction Filter, it DON'T prevent Blockyness (on heavy settings, it will PRODUCE Blockyness...
I guess I should explain what the filters do.
That's always a good Idea. :)
I'm not a friend of heavy filtering. Do what you want, but EVERY Filter will drop down Details.
P.S.
Who's the Guy who said english is an easy language? ;)
FredThompson
18th June 2003, 01:38
yeah, I know deinterlacing isn't perfect because the source is actually a series of 1/2-pictures. Hasn't really been much of an issue with low-motion stuff. For high-motion, I keep it interlaced. If the source is camcorder and people need to look at individual frames with Media Player (long story...) then I've got to take it to progressive. If the original source was film, interlaced isn't going to be a benefit at all, it would be a hindrance as the source was 24 fps progressive.
I'm actually thinking about droping undot. I was hoping it would work on dropouts but the more I work with it, the more I agree with you. The sample dropout correction from SpotRemover's site looks really nice and I can see how it would be very helpful for damaged tapes. The last time I talked with the author he told me the field-separate analysis wasn't working properly yet. When it is, I can see one more reason to stay interlaced.
I'm looking for a balance between speed and "scrubbing" too much. These filters, with fairly light settings, seem to work well on VHS source without destroying too much of the actual source. VHS has all that low-quality grainines so it's also a little bit challenging when evaluating to know if actual information or VHS-specific noise is being removed. Noise removal in audio is similar. I like to use 2 or 3 filters there with very light settings.
Why make all your video interlaced? If you've got static sections, those could go progressive and you'll save a bundle using dup. I do something similar with mixed live/anime sometimes. If there's an all-anime section, it's filtered differently than live action.
Thanks for the tip about CCE settings. I'll try that. Sure seems like the better way to handle it and would speed things up a bunch.
I agree with you completely about filter too much. That's why I'm asking for feedback. There's an aspect of filtering too much which destroys quality but there's also an aspect of the frame rate blending everything to our human eyes. The trick seems to be finding a good balance.
English is only easy if you're born into it ;) My business involves Europe and all of North America. It can be monstrously exhausting trying to communicate across 5 or more cultures and languages...
FredThompson
18th June 2003, 05:42
SmartSmooth appeared to yield a little more detail but fails horribly compared to Donald Graft's deinterlace upon zooming. Comparison screengrabs are on the site.
Also, I've dumped undot as suggested. It doesn't appear to make any difference.
Kika
18th June 2003, 11:20
Heavy filtering is a little Tricky. Not only if you have sharpness as the important thing. Too much filtering can result in effect like a kind of "Veil" or "Mist" over the Video.
Why make all your video interlaced?
It's the easiest way, and you can't do any wrong (except the Fieldorder settings...).
FredThompson
18th June 2003, 19:26
That's why I'm not usine Smart Smoother High Quality for non-amine. Sure, it removes some noise but flattens too much.
The updated SpotRemover was just released and it's supposed to properly handle interlaced source...
Kika
18th June 2003, 22:58
Belive it or not: For captured Anime i only use VirtualDubs Capture-Noise-Reduction and TMPGEnc in CQ-Mode with my own Matrix. But i'm encoding on high Bitrates in Half-D1 and i own a realy good VCR with TBC and Noise-Reduction, so there's no need to do heavy filterings to spare (save?) Bitrate. ;)
On capturings from old Tapes i sometimes use 2D-Cleaner or SmartSmoother HQ.
Hm, that SpotRemover sounds interesting, guess i have to test it.
FredThompson
18th June 2003, 23:06
Similar use here, CVD for tape transfers using a JVC S-VHS deck with all the goodies. I have found with the TBC on there's the squiggle junk at the bottom for a few lines which needs to be cropped. Some really worn tapes don't like the stabilizer and the top will get skewed. Small price to pay for a stable, clean picture. I'm guessing you have something similar. Sure makes it easier when black is black and not swirling red and blue, doesn't it?
My other source is satellite and sometimes there's some real MPEG artifacting. I've also found camcorder isn't that great for low-light areas. I'm not shooting in twilight, I mean shadow areas. Maybe that's a function of 1 CCD...
Kika
18th June 2003, 23:20
I'm guessing you have something similar.
Yes, it's a JVC HR-S7950. I love this machine. ;)
And i agree, it does make the things a little easier.
My other Source is from Hi8-Videos. They are very sharp, but also have a high amount of Noise. On this source, i use much more filtering. But you asked about the Filter-Settings for VHS, right? :p ;)
I ever try to use only Intra-Frame-Denoising, not Interframe. But sometimes that's not enough. VirtualDubs Capture-Denoise act's like a DNR (Interframe-Denoiser). All i need after that, is a good(!) Frame-Denoising. I have good Results with TMPGEncs Denoiser (26,1,0 to 30,2,0), but it's realy slow.
FredThompson
19th June 2003, 00:14
Mine is the 7600, a couple of years older than yours.
Yup, VHS is the topic for this thread but the original signal can come from many sources.
The light temporal filter is to help remove some of the swim of static backgrounds. I think this is far more common on camcorder source. I've also found capturing at D1 and resizing to CVD helps to reduce the appearance of some of the junk. It's still there if you look at individual frames but resizing seems to help a little.
Whenever possible, I really like to do the denoising at the script level so there's a way to get an idea of the pre-compression source.
FredThompson
19th June 2003, 04:16
I forgot to mention that the samples on my site were made with ALL the enhancements of the VCR on. There was still quite a bit of chroma junk and other noise that made it through. That's why I'm interested in filtering even through the VCR takes care of a lot of it. That, and the way worn tapes bicker with capture circuitry when the enhancements are on.
Also, I now think you're completely correct for non-film source, I'll keep it interlaced unless I have to make an MPEG-1 version. That's what I meant earlier about Media Player. Sometimes I have to make files that will work regardless of the user's computer system which means the basic codecs, especially if PowerPoint is being used. I'm still trying to figure out how to make good quality, all I-frame encodes so people can use the position slider.
When I encode, the target size is typically about 770M per hour for slow-motion, 30 minutes for fast-motion, and audio is at 48. This should allow easy migration of files to DVDR. I'm also experimenting with DVD Movie Factory's little DVD player on the XCVD/XSVCDs. That's getting off the main topic but still makes sense regarding VHS and S-VHS source given their resolutions.
I've also just tried the latest TomsMoComp and it didn't do so well on the very high-motion stuff I have. Was trying to get a frame grab for titling. SmartBob gave far better results.
According to this post: http://forum.doom9.org/showthread.php?s=&postid=227018&highlight=fluxsmooth+and+interlaced#post227018 FluxSmooth doesn't support interlaced source. However, that post is dated earlier than the current actual filter so I've asked for clarification. Sure hope it will work with interlaced source.
Kika
19th June 2003, 15:58
An other idea about filtering: Maybe we have to ask about the Goal:
High quality Video, no matter what Bitrates or as much as possible Video on the Disc in a good (whatever "good" really means...) Quality.
These are things i handle completly different (filtering, resizing).
According to this post: http://forum.doom9.org/showthread.p...aced#post227018 FluxSmooth doesn't support interlaced source.
No problem if speed does not matter. Can be used between SeparateFields and Weave.
FredThompson
19th June 2003, 18:09
I think quality is more important than size. Some source, like 20-year-old VHS, is so low-quality to begin with that I've found an entire hour can fit in 760M as CVD with 48 audio so it can be processed once and moved to DVDR later. More recent high-motion source I usually encode at around 4500-5000 bitrate.
Having said that, the encoding process for low bitrate CVD removes a lot of visual noise itself.
CNR2 seems to do a wonderful job of removing the chroma problems without destroying much of the original color. Some of the other filters seem too heavy-handed. I like FluxSmooth for similar reasons.
2D cleaners seem to flatten the image too easily for my eyes. However, they can help give a cleaner image with camcorder source from a dirty environment.
I haven't tested the latest version of this script for processing time. The original was taking about 3x real time. Some things have been removed so there should be some gain. I'll test tonight to see how SeparateFields and Merge affect speed.
I'd really like to reduce the speed by about 50% but am not willing to give up quality in temporal filtering and deinterlacing (when it is used.) If you have suggestions about filter order or other filters which might help with speed, please let me know.
FredThompson
20th June 2003, 09:12
Kika, what is "Dithered Quantisation in CCE"? I don't see it as an option in DVD2SVCD.
Kika
20th June 2003, 22:25
I don't use DVD2SVCD, so i have no Idea, where to find it.
Directly in CCE it's in the Quality-Settings (CCE 2.66).
2D cleaners seem to flatten the image too easily for my eyes
Right, that's why i use it only in one direction, not in both (mostly vertical).
FredThompson
21st June 2003, 12:51
I've tested the script with field splitting and there's almost no change in processing time.
Thanks to sh0dan the order of CNR2 and FluxSmooth is fixed.
As it is, this works quite well. There is a 2-minute TV ad for the Hulk movie that contains zooming static images from early comics, parts of the movie, shot-on-video live ation and white text on black. The current script replaced shimmering almost-black and stopped shimmering motion of the really small text and logos in the movie credits. It did change the fade-in of white text to a 3-frame cycle so it's not actually as smooth a fade as the original. It's not visible during playback at all and the lack of swimming black is well worth it.
For the movie credits I changed DUP's threshold to 7 (no fades but LOTS of shimmering) and used VirtualDub's grayscale and brightness/contrast filters to set the "black" to true black. This made the image almost completely stable.
I have yet to torture-test this new arrangement on troublesome VHS. (I cheated tonight, DV of S-video from satellite) but I am very pleased with it. Almost imperceptible change to the detail but nice effects on cleaning and stabilizing swim.
neuron2
21st June 2003, 14:57
Originally posted by FredThompson
I'd really like to reduce the speed by about 50% Why would you want to do that?
FredThompson
21st June 2003, 18:10
Oops, I meant to communicate I'd like to reduce the execution time of the script by 50%.
ADLANCAS
22nd June 2003, 05:34
I copied my text from another thread that Iīve just created yesterday.
My script I use to create SVCD with CCE. Then Iīll test this two filters cnr2 and fluxSmooth instead C3D, using the script below.
Just a question, I see how fast is the encode in CCE and you gave speed in fps (I know only in VDub a place that I can see fps!). How can I(we) can compare them ?
Thanks,
Alexandre
Here is the text copied from another area:
Iīve got much better quality using Dgbob (thanks Bach for your suggest) to encode VHS source in YUY2.
The only problem is that speed decrease so much comparing to my old script using SelectOdd()/SelectEven() and C3D.
Before I had speed 0.28 in CCE, now 0.14 ! (Athlon XP 1600+).
I tried also include ConvertToYV12(), ConvertToYUY2() at the beginning/end of script to be faster, but I think that these convertions produced changes in the movie.
Please, could you suggest me some changes to increase the speed preserving quality ?
Another Filter ? Changes in script ?
LoadPlugin("c:\Arquivos de programas\AviSynth2_temp\LoadPluginEx.dll")
LoadPlugin("c:\Arquivos de programas\AviSynth2\plugins\Convolution3D.dll")
LoadPlugin("c:\Arquivos de programas\AviSynth2\plugins\dgbob.dll")
AviSource("D:\Teste\AVS\VHS2.avi",false)
LetterBox(0,16)
dgbob(1)
Convolution3d(0,12,24,8,8,3,0)
BicubicResize(448,448,0,0.6)
saturation=0.9
cu=-(1-saturation)*256
ColorYUV(off_y=1,gain_y=-3,cont_u=cu,cont_v=cu,opt="coring")
separatefields()
selectevery(4,0,3)
Weave()
AddBorders(16,16,16,16)
FredThompson
22nd June 2003, 07:16
Quick reply because I'm pooped (and now know for sure I have a serious stomache infection - shouldn't have eaten that raw yak.)
The site for Convolution3D says the AviSynth version does NOT have temporal support. When I read that, I decided not to use it. GuavaComb also doesn't have a proper 2.5 version. The only 3D noise filter I found for AviSynth was FluxSmooth. Maybe there are others.
Donald just released an updated version of his new bob routine. I have no experience with his new filter.
Correct, the speed observation came from VirtualDub. The notes for FluxSmooth say it might generate errors with multi-pass CCE so I think the safest option is to write the filtered file then do a conversion. Even if it wasn't critical, I'd do it as a safety practice. The only exception I can think of is when I'm encoding a large DV file. In that case I edit the AviSynth script from DVD2SVCD if I'm not going to use FluxSmooth.
Why type of bitrates are you using? Is media very expensive where you live? High bitrates can solve a lot of nagging quality issues.
I've seen lots of posts where people worry about what's in the overscan area. Why?. The vast majority of video is made such that critical elements are NOT in that part of the frame. I like to crop to get rid of jagged edges and the source letterboxing then letterbox to center the image but I'm not concerned with block boundaries because of the encoding bitrates. I DO think it's a good practice to crop off whatever letterboxing is in the source because generated letterbox will be uniform and compress better.
Having said that, I live in the U.S. and media is dirt cheap here. CDRs are about $0.10 or less. If I lived somewhere that media was heavily taxed, I'd have a different viewpoint.
Along those lines, I've got an idea for a 2-pass frame-specific auto-letterboxing filter. Not that I have a prayer of writing it, just the idea. The first pass would determine the absolute maximum boundaries used taking into account a sensitivity setting. The second pass would center the entire source based on the results of the first scan and letterbox each frame individually. That's a little nit-picky but would be helpful and frame-accurate letterboxing could be real helpful on some source.
If your source is TV with static logos, consider using Donald Graft's logo filter to overlay them with a single version. This can also be nice because false motion won't be sensed by CCE. That also leads to my second idea of the night, scrollable preview window for VirtualDub. It's not easy to accurately overlay a logo in the lower-right corner of a full D1 frame.
Also, I use DVD2SVCD for the encoding so I don't resize, per se, with VirtualDub or the cleanup script. Remember I said the notes for FluxSmooth say it conflicts with multi-pass CCE?
There are probably more efficient ways than what I'm doing but I far prefer to keep everything at D1 and feed a completed file to DVD2SVCD. The only exception are odd-ball source like certain digital formats that are 2/3 D1 or some of the already-compressed stuff that comes my way. If it's a capture I made, it's always at D1 until the compression routine.
I DO use Donald Graft's Smart Resize for VirtualDub because I find it's a far better way to set borders for TV source. Many times the active image area changes throughout the source for TV shows. Tonight, for example, I worked on the various documentaries about the new Hulk movie. Some of the source is the film and some is video. Interestingly, the various clips from the film did NOT always occupy the same screen area. If I'd just looked at one part and chose my boundaries based on it, I would have cropped off other sections of the show where there WAS actual source.
I'm not overly concerned about slight color changes with analog source. Analog tape is very lossy and everyone's TV set is going to have slightly different characteristics anyhow. Have you ever seen how hard it is to tune those walls of displays? It's incredible and those are specifically designed to be tunable perfectly.
Additionally, the PC platform does not have strong color management so consider that your analog capture device has some variance, so does your monitor, so do the various image manipulations, so does the encoder. That's my opinion. Other people are very particular about supposed accuracy but unless you've got highly accurate test equipment, how can you truly know your equipment is configured accurately? How would you know the performance footprint of your particular pieces of equipment? (That's all assuming you don't have very obvious problems.)
Do those thoughts help?
FredThompson
22nd June 2003, 12:19
OK, well, I've just watched the Dup filter remove some stuff which should have stayed. Lots of motion but small items moving and the entire frame about hte same color. Darn it. OK, dup filter got commented out for general use. That also moved average speed from 10-11 fps to 13-14 fps. Not a bad speed increase. Going to have to be more judicious about Dup and send the sample clip to Donald.
FredThompson
22nd June 2003, 18:09
wrt the question of how to tell speed, CCE gives you a speed rating during the compression. Multiply that by the frame rate.
ADLANCAS
23rd June 2003, 05:15
At first, sorry for my bad english.
My knowledge is limited and have read a lot of posts here to have some ideas.
Ok letīs see about what you wrote...
I saw in documentation/site from C3d and didnīt see that this version doesnīt have temporal support. Also Capture guide describes C3d as a spatio-temporal.
Itīs very clear to me that using dgbob increase so much quality and unfortunately encode time. Iīve made a lot of tests today and I saw only a difference using a little soft settings in C3d(0,8,16,8,8,2,0)
, this settings produces less mosquito noise.
With Fluxsmooth I could encode with CCE without crash.
I use vbr 4 pass (min.300 , avg.2230 , max 2530) and here I can buy a CD with $0.30(or more!). This is not a problem to me.
I really donīt understand what you said about overscan. For me itīs clear. I donīt like to encode what I canīt see and I can save more bitrate in areas where is necessary.
Letterbox ? Itīs the easiest way to remove garbage.
Logos ? I agree with Wilbert, "Personally I (Wilbert) wouldn't remove any logo, because you will always see that there was a logo."
Colors ? Capture guide again... Itīs a personal choice, it seems good to me. Sometimes I need only to change little bit saturation.
Iīm based in what is described in Capture guide. If Iīve got that right, you donīt agree so much with this guide. I canīt have good arguments to discuss about this guide better than Wilbert, for example.
Thanks for your thoughts.
I hope that guys with more experience than me (itīs very easy to find!) can also put ideas about this issue.
Alexandre
FredThompson
23rd June 2003, 06:23
Yes, if you are going to stay with SVCD-standard bitrate and are sure you will never have a display device which shows the entire frame, resizing and letterboxing as you are makes sense. My displays show the full frame and I encode to match that.
I wasn't talking about delogo, I was talking about logo. If there is a logo, I prefer to copy one then use it to overlay the logo on the source. A lot of the time captured logos show motion after the capture and it's distracting when I watch the video. Overlaying the logo with a bitmap ensures the logo stays the same and it's easier to ignore it.
The capture guide is pretty good. There's more than one way to do this.
Also, tonight I found one of the DVD players I use doesn't like mixed Interlaced and Progressive on the same disc. Something to think about if you ever run into this type of stuff. I just completed some TV shows about the Hulk movie. The show segments were left interlaced and the movie ads were decombed to progressive film rate. They play fine for my computers but the DVD player hated them.
ADLANCAS
23rd June 2003, 15:54
I'm not sure if I'll never have a display device which shows the entire frame. Now I don't have. Who knows in the future? I understand what you mean. Thanks.
I intend to use this script only with VHS produced by a single handy-camera. Films captured from TV or VCR, I use Decomb like you.
Alexandre
FredThompson
26th June 2003, 06:52
This thread is about to get abandoned. I've realized some things due to discussions here and in these threads:
http://forum.doom9.org/showthread.php?s=&threadid=55598
http://forum.doom9.org/showthread.php?s=&threadid=55832
The script I've created has a massive problem in that temporal filtering cannot be done on interlaced source, it must be separated and each field processed individually. The script will be fixed within a day or two at which time I'll change post 1 of the thread, update the website and clean up some of my following posts in the thread. I'll also start a new thread with the "proper" script and an explanation of the theory behind it.
I almost made the update right now but I still don't know if Convolution3D for AviSynth 2.5 as posted on WarpEnterprise's filters page at http://www.avisynth.org/~warpenterprises/ contains temporal support. Also, I'm on some heavy medication and have been to the hospital twice. It looks like my appendix is about to be removed and I'm just not that focussed right now.
FredThompson
1st July 2003, 06:17
In about 2 days I should be releasing a completely new script and thoughts on proper practices for cleaning captures and encoding.
Topics to expect are:
Why noise filtering should ONLY be done in a field-oriented manner BEFORE any deinterlacing, bobbing, decombing, resizing, or any other modification. As a teaser example, there is a new image linked at the bottom of this page: http://www.geocities.com/fredthompson6
An analysis of why the left and right edges of a frame should always be letterboxed for analog captures. Included will be a full explanation of the math and example images. Teaser: When resizing to 1/2 D1 or 2/3 D1 there is at most a 1.5% difference in resolution but a huge gain in quality of the encode.
Uh...I'm sure there will be people who complain about the math but, oh, well.
Examples of how NTSC DV capture fails and is not an optimal solution. DV is fantastic for camcorders but I'll show example of how it fails miserably when trying to capture analog source. (Expect this to be hotly contested.)
A new easily-configurable AviSynth 2.5x filtering script. It's BIG with lots of comments. Focus is on quality first, speed second. I figure, if you're going to go through the hassle of capturing, cleaning and encoding, do it with as high quality a result as possible so you don't have to do it again.
Be warned, this script includes the optional use of SpotRemover for VirtualDub because it works and just about every other scratch and noise remover I've found can't come close.
48 vs. 44.1 audio rate for VCD, CVD and SVCD.
Possibly also noise gate and volume normalization by channel for audio cleanup.
I'll start a new thread for this and put the support files on another site.
FredThompson
3rd July 2003, 18:29
Change of plans:
The way I see it, filtering for noise removal really has 2 goals. The first is to "stabilize" the quality of the capture and try to minimize aberrations in the video stream which comes from analog storage medium and capturing. Let's call this "capture filtering."
The second is compression to reduce size while maintaining quality during compression. Let's call this "compression filtering."
Many months ago I started monitoring http://www.kvcd.net because they claimed to have comrpession filtering to create very small files with high quality. At that time, their methods did create a small file but details would tend to disappear due to somewhat heavy-handed filtering. Try setting a smoothing function with high values on live action to get an idea of what was happening. Now, however, their methods are quite impressive. I downloaded a sample from this thread (http://www.kvcd.net/forum/viewtopic.php?t=4717 page 4 or 7) last night and have thrown away everything I was trying for compression filtering.
I'm still working on capture filtering and will post that in the next day or so. Basically, I'm gutting everything I was working on.
wrt dropouts, film scratches, etc. I've given up on all filters except SpotRemover. Yes, it's shareware at about $35 but it works. Konstantin shared some details with me and I'm convinced that even though it is a VirtualDub filter, there is very little change in the color. SpotRemover's internal routines use YUV and it expects an RGB32 input. Somebody might get upset about the effects of color model change. Konstantin says to expect less than 1 step of change in the intensity. Fine by me.
It's probably also quite good at removing analog artifacts but, for the time being, I'm going to finish up my script and have it do that capture filtering. The KVCD script will be stolen/borrowed and applied in a field-oriented manner.
It's coming, gimme another day or so.
Wilbert
4th July 2003, 10:47
wrt dropouts, film scratches, etc. I've given up on all filters except SpotRemover. Yes, it's shareware at about $35 but it works. Konstantin shared some details with me and I'm convinced that even though it is a VirtualDub filter, there is very little change in the color.
I recommend that you use free filters :)
Many months ago I started monitoring http://www.kvcd.net because they claimed to have comrpession filtering to create very small files with high quality (...) last night and have thrown away everything I was trying for compression filtering.
I'm sure they are doing good things (nice scripts, etc.), but I don't like that "optimal" script stuff. Btw, did you consider HomiE FR's Quantified Motion Filter (http://forum.doom9.org/showthread.php?s=&threadid=56051). Maybe it's nice to compare it with the optimal script @kvcd.net.
FredThompson
4th July 2003, 10:54
Show me a free filter that will work as good at SpotRemover and I'll use it. I haven't found one. When my GeoCities page is back up, look at the sample scratched image near the bottom. Simple speck filters won't work for stuff like that.
I think "optimal" just means the most "optimal" they've found for what they're doing.
No, haven't looked at that other script. What don't you like about the one at KVCD?
You followin' me, punk? ;)
OK, just glanced through that thread. Saw it a few nights ago, actually. Three divisions is better than 2. Right now I'm more focussed on getting the thing working properly then I'll experiment with this one. The samples at KVCD look quite nice so I'd rather use it for the first go.
FredThompson
4th July 2003, 22:43
OK, guys, here's an update. This should be obvious but thought I'd state it here because of some emails and PMs:
I've found it's a lot easier to filter film than true video. Film is, what, 24 fps and video is 50 or (almost) 60 half-picture fps. With the exception of scratch and dropout removal, it sure seems film is best filtered after decombing. Granted, some dropout will disappear during decombing because you're throwing fields away. The problem is large scratches turn into big blobs. Maybe I'm wrong but that's the way it looks to me now. I have a test sample in which there is a large scratch on one field of one frame.
I'll do some more testing and see what happens. I guess the issue of physical damage to a tape is best handled before decombing and actual missing parts of a film, if that's the actual program source, should be done after decombing so the temporal analysis is correct.
True NTSC video filtering is what I'm struggling with. I don't have any good PAL source on tape, just a few 2nd or 3rd generation homemade copies of things. Those are going to be low quality no matter what I do.
Film and true video are very different. Film is a sequence of full-frame pictures. Video is two intertwined sequences of pictures which don't relate to each other on a perfect 1:1 basis.
The hope is to build on the basic process-by-field idea I learned here in the forums but there are some problems with my attempts at encapsulation with AviSynth. An answer is coming, wish I had one to share now.
Originally posted by Wilbert
I'm sure they are doing good things (nice scripts, etc.), but I don't like that "optimal" script stuff. Btw, did you consider HomiE FR's Quantified Motion Filter (http://forum.doom9.org/showthread.php?s=&threadid=56051). Maybe it's nice to compare it with the optimal script @kvcd.net.
You can't compare apples and oranges :) ( But both are great btw ;) )
The original concept was based from HomiE's idea, but instead of applying a filter in stages (3 motions levels of static filters ), our filters are linear. When you switch filters in boundaries, you create sharp edges and glitches, and the encoders are not too happy seeing them ! I wanted to implement some type of linear motion filters for quite a long time: http://www.kvcd.net/forum/viewtopic.php?t=2834 but I couldn't, until I learned of the fabulous functions like YDifferenceToNext() etc. This turned on the light!, and after I saw Homie's filter, it was just a matter of hours (if not minutes :) ) before we had the first functional fully adaptive motion filter. The current filter uses TemporalSoften on static and very low movement scenes. It works inversely proportional to the movement. That is, the less movement, the stronger the filter. Not only that, but also the "radius" is now adaptive and dynamic too! Then after a defined threshold when movement starts to pick up, the TemporalSoften kicks out and the unfilter(working as blur) kicks in and works directly proportional to the movement. The higher the action, the more the blurr up to a selected ceiling. This basically kills vislble macroblocks on action scenes. You can't see the details anyway on high action, so we just soften the picture and that's music in the ears to the encoder :)
Here's the current script, which is updated regularly here: http://www.kvcd.net/forum/viewtopic.php?t=3483
The whole script is now a work of many people, continuously making suggestions and always trying to further refine the script.
It can be used as a basic framework to plug in and try other filters, just by changing a couple of lines.
## DLL Section ##
#
LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
LoadPlugin("C:\Filters25\GripFit_YV12.dll")
LoadPlugin("C:\Filters25\STMedianFilter.dll")
LoadPlugin("C:\Filters25\asharp.dll")
LoadPlugin("C:\Filters25\unfilter.dll")
LoadPlugin("C:\Filters25\undot.dll")
#
####
## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf = 0 # Current frame.
#
####
## Main section and static filters ###
#
Mpeg2Source("Your_D2V_Source_Here")
#
undot()
Limiter()
asharp(2, 4)
GripCrop(Your_GripCrop_Parameters_Here)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.2))
#
#
## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= 2 ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) ,0, 2) ")
#
#
#
GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()
#
#
## Functions ###
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}
#
####
-kwag
You can't see the details anyway on high action, so we just soften the picture and that's music in the ears to the encoder
That's right, but there's a little problem: All encoders i know do have problems with softened Backgrounds with low contrast. Sometimes they will produce a kind of "veiling" in such Areas.
Originally posted by Kika
That's right, but there's a little problem: All encoders i know do have problems with softened Backgrounds with low contrast. Sometimes they will produce a kind of "veiling" in such Areas.
What do you mean by "veiling" :confused:
-kwag
Hard to descripe... (because of my language problem)
Sometimes, if such backgrounds do have some motion, you will notice areas that will NOT move while other parts are still moving. You will also notice Areas with a rythmic changing of Luminance (kind of pulsing).
I've made a lot of tests (i know your Project very well) and got this effekt often. It depants on the source. In some tests, all is OK. It happens only on scenes i descripted before.
That's because i do some research on ways to filter without smoothing Areas (but did not succed yet... :( ).
FredThompson
5th July 2003, 02:44
Are you talking about the swimming effect which is most visible in near-black areas? The same thing can happen in near-white but it's not as visible to the human eye.
Can you make a short sample available?
Originally posted by Kika
Hard to descripe... (because of my language problem)
Sometimes, if such backgrounds do have some motion, you will notice areas that will NOT move while other parts are still moving. You will also notice Areas with a rythmic changing of Luminance (kind of pulsing).
I've made a lot of tests (i know your Project very well) and got this effekt often. It depants on the source. In some tests, all is OK. It happens only on scenes i descripted before.
That's because i do some research on ways to filter without smoothing Areas (but did not succed yet... :( ).
Ok, I know what you mean :) The old "Flashing" effect on static walls, backgrounds, etc. Well, that's basically gone now with the new script. Because of the adaptive nature of the script, the effect is almost barely visible.
Maybe a picture is better that a thousand words! This explains it better ;) http://www.kvcd.net/k-pax-fixed-adaptive.mpg
-kwag
@kwag
That's exactly what i meant.
OK, i'm a fair guy, so i have to test your new Script.
I have done my own tests with differend ways (ask Fred, he knows one of my samples). And i do have some very nice results, but i'm still not able to reproduce the results on every Video.
My way is a combination of Inter- and Intra-Frame Denoising in combination with special Features of TMPGEnc. But it works only for captured Videos, not for DVD-Source.
Hm, like i said, i will give your new Script a try. ;)
Originally posted by Kika
@kwag
I have done my own tests with differend ways (ask Fred, he knows one of my samples). And i do have some very nice results, but i'm still not able to reproduce the results on every Video.
I believe you :)
And probably the only way we could get rid of artifacts and dancing DCT blocks, is if Metro Goldwin Mayer lends us some of their clean master reels (which probably will never happen) :D
( Let me know your results ;) )
-kwag
FredThompson
5th July 2003, 03:12
A lot of what I'm fighting here is probably specific to NTSC interlaced source.
I'm also wondering the effects of DarkSmoother and Tom's anti-DCT filter but, until the field-based implementation of KVCD filtering is working, I can't readily test it.
Bobbing or deinterlacing to get a progressive stream won't help because those introduce fale positives.
There seems to be a common, but erroneous, assumption that DVD source is always "clean." It seems to me the KVCD filtering takes that into account although it could use some anti-DCT enhancement. I'm more interested in focussing on noise from analog capturing but only after their filtering is properly encapsulated so it can be applied to field streams and easily modified.
@kwag
*lol*
Yes, i will let you know my results. But have to do also lot of other Things. Things like my KiDVD-Project (up to 12 Hours on a DVD with a Quality better than VCD - but only for Widescreen-Video).
OK, back to serious things... ;)
Filtering is a very complex Topic. And HOW to filter often enough depants on the Source. Is it DVD-Source? Captured from TV (analogue or DVB)? Captured from VHS/Hi8/DV? Or ist it a DivX-Video which shall be encodet to MPEG1/2?
So i think, there never will be ONE optimized Solution to filter all kind of Sources... :(
FredThompson
5th July 2003, 03:21
Yes, I agree. That's why I described KVCD as filtering-for-compression instead of filtering-from-capture. I'm not sure if AviSynth has enough conditional structures to allow a proper single script. The idea was to have a few global variables at the beginning so Joe Blow can use it without screwing up the internals.
FredThompson
5th July 2003, 03:52
I'm revamping my GeoCities page to add some DV sample clips to show the types of things that bust commonly-used filtering when it's applied to NTSC TV. Filtering, processing, and encoding movies involves conversion to progressive original at 24 fps. That's very different from 25 or 30 fps true-video interlaced TV programs which are designed to be in 10-15 minute chunks.
The process for theatrical movies is pretty well refined, not that it won't get better.
TV captures, camcorder source, and analog captures are what I'm more focussed on.
It's become quite apparent to me that the discussions sometimes break down because of a difference of understanding about the source material. Hope that makes sense.
Wilbert
5th July 2003, 15:23
wrt dropouts, film scratches, etc. I've given up on all filters except SpotRemover
I've seen the picture. Could you provide a short sample?
@FredTompson, kwag
I think "optimal" just means the most "optimal" they've found for what they're doing.
No, haven't looked at that other script. What don't you like about the one at KVCD?
Don't get me wrong. It's a great script (but I didn't experiment with it much), and this conditional filter stuff opens many new possibilities. But I never like the idea that someone finds an optimal script. Whether or not a script is optimal, depends on the source, the target, the preferred filtering time, some people like to leave more noise in it at the cost of blurring, etc. Ok, never mind ...
FredThompson
5th July 2003, 15:40
How many frames do you want? It's NTSC DV. I've just checked. It's alternating fields in 2 pulldown frames. It's also being properly decombed with the current beta of DG's decomb. Still a decent sample for testing droput removal if you don't decomb.
I've just compared how I was filtering vs. raw vs. KVCD. The KVCD seems to be posterizing a little more than I'd like. This is just a quick evaluation and, given the source is B&W, probably not a fair comparison. Without color and looking at single frames under magnification the difference is apparent.
Wilbert
5th July 2003, 15:44
How many frames do you want? It's NTSC DV. I've just checked. It's alternating fields in 2 pulldown frames. It's also being properly decombed with the current beta of DG's decomb. Still a decent sample for testing droput removal if you don't decomb.
Of course, it depends on your account. But 25-40 frames is fine. I just want to see if I can remove the scratches.
FredThompson
5th July 2003, 20:58
Give me a couple of days and I'll have an FTP server set up here. GeoCities only allows 8M. The 4 DV files that are on the page right now are 10 frames each and they use up almost all the allocated space.
Would sure appreciate help coming up with a free filter way of removing dropouts and scratches. I'm sure a LOT of other people would to.
Wilbert
5th July 2003, 21:01
If setting up a ftp server is to much work, 10 frames (deinterlaced) is also ok.
FredThompson
5th July 2003, 21:18
It's not a lot of work, I just can't do it right now. I'm trying to get out the door to run some errands. The only way I can put anything on the GeoCities site is to remove what's there now.
I think it would be best to give you the interlaced source so you can see what it looks like. The source is interlaced NTSC VHS of a film.
FredThompson
6th July 2003, 07:27
new files are being uploaded to http://www.geocities.com/fredthompson6 right now.
The old samples of VHS recorded to DV are removed. Those are really good test samples but I'm putting two others up because they're more relevant for current discussions.
A new script is also going up as are screen shots.
The new script is just the KVCD filtering, DarkSmoother and CNR2. It has lots of code for using other filters but I'm too tired to keep messing with it right now. I'm also not sure if DarkSmoother really does anything that hte KVCD script doesn't.
The sample clips are a B&W VHS tape played through S-Video to DV and a pure DV camcorder shot.
Something in the KVCD script is over-emphasizing white in some parts of the camcorder and also adding a black border to the white overlay text on the pure camcorder. Still, it has done a great job removing the camcorder noise.
@FredThompson,
Get the script again, and look at the change log ;)
http://www.kvcd.net/forum/viewtopic.php?t=3483
-kwag
FredThompson
7th July 2003, 00:34
Done. updated script on the site. The GeoCities online editor isn't loading again (sigh) so the page doesn't reflect this change. Nor is the screenshot I showed you linked to the page. Will fix it later.
Wilbert
10th July 2003, 23:23
I tried to remove the scratches (didn't succeed completely). I used a vdub filter, because I couldn't find anything for AviSynth.
The result is here: http://www.geocities.com/wilbertdijkhof/test3.avi
avs-script:
DirectShowSource("E:\temp\QMF\VHStoDVScratchSample.avi")
Telecide(0)
Decimate(cycle=5)
I encoded to XviD 1-pass, quality 85. I'm very curious about your results ...
FredThompson
11th July 2003, 00:22
Using decomb500b15 and these lines:
Telecide(order=1,guide=1,post=2,vthresh=30)
Decimate()
both scratched frames are totally removed. However, that's not filtering out the junk, it's removing the extra frames since the source is actually film. The 4.x version of decomb didn't do this, some of the junk remained. I don't really know exactly what those settings for the 5.x beta do, I copied them from DG's reply to someone about how to use it.
I played with SpotRemover and was able to remove the entire scratch.
However, I've since come to think dropouts, scratches, and missing film particles should be handled differently.
Here's what I mean by those terms:
dropout - horizontal white streak very often followed by a black dot caused by recording tape
scratch - physical scratch of the source film. The sample I posted is odd because those 2 frames aren't true source material. Maybe they were caused by damage to the tape. In any event, they aren't pure horizontal lines like a dropout.
missing film particle is the odd white shape that shows up due to part of the film actually missing.
Of the three, I think a dropout filter would be the easiest to create due to the consistent horizontal nature. Flash photography usually is only 1 field but takes up more lines. Maybe a distance shot of a rifle being fired could give a false positive but most droouts are fairly consistent. On detecting one, it should be possible to replace from the start of the white to the end of the black sith some kind of interpolated result from the same field on the immediate prior and following frames. Just my thoughts of how I'd build one.
What you show is pretty good. How did you filter it?
Wilbert
11th July 2003, 10:27
What you show is pretty good. How did you filter it?
Strange, I also used SpotRemover (forgot that you also used it). I thought that SpotRemover was shareware, and you had to pay money for it? I used the one from this site: http://konstant.freeshell.org/, which is entirely free. I will post the settings if I'm home again ...
btw, I think I used decomb500b9 or something like that.
FredThompson
11th July 2003, 15:10
SpotRemover is shareware and has a usage limit. After a while, it will start to corrupt the clip you're using it on.
Wilbert
12th July 2003, 18:39
I've no reason not to believe you :) But where do you see that on their webpage?
FredThompson
12th July 2003, 22:12
To: utils@mindspring.com
Subject: RE: Your SpotRemover and DV dropouts
> the compare algorithm works shows weighted
> influence of pervious pixels and things like that.
This is related to smoothing, not to the spot detection.
>1) There seems to be a delay in the preview window when this filter is
>running.
Yes this is called "time lag".
> It is green for a few frames
Green frames are not written to the output file.
>the display is completely corrupted with colored boxes and other things.
>What is this? If it is part of your usage restriction, how do I know how
>many frames before the frames to be analyzed I should start looking?
Yes, this is the shareware limitation.
Since version 3.5.3 this limit was extended.
The limit is set on (approximately) amount of detected spots.
If you decrease the spot detection sensitivity, then the duration will be
longer.
>2) spot removal looks for white objects, I assume.
No. Spots a detected based on comparing intensity.
Deviations to both lower intensity and higher are
compared with "level for detection".
Setting something like 26 for it means just 1/10 of the total
intensity range. (26 over 256)
This is BY FAR not a white(or black) dot.
Konstantin
FredThompson
14th July 2003, 04:16
OK, guys, an update.
First, I apologize for not having the script updated. Testing is done and I need to do a little more work breaking it into pieces. The blurred frame before a scene change is gone.
My Dad showed up on Wednesday and we had to work until about the middle of Saturday. That cut into the time I could put into testing/packaging the script. I'm working on it right now and everything should be updated by the end of Monday.
Also, if all goes well, I will add an ISO file for a test SVCD with color bars and some other stuff for calibration. I know how to do it, just need to gather a little more source material. This should help quite a bit with calibrating analog capture devices.
I've also just received a 2nd-generation VHS tape of a broadcast TV source from a few years ago. Will work on noise reduction for it. To be fair, though, I must point out that I do not believe there is a viable substitute for the SpotRemover VirtualDub plug-in. More than likely, I will recommend using it with Donald Graft's Smart Resize filter as a first step and filtering the resultant file with AviSynth at the compression point.
I've looked at the KVCD methods quite a bit. If you have a progressive source, I highly recommend their methods. If your source has any true interlaced components, my personal opinion is it should stay interlaced if at all possible.
Lastly, there is a very real possibility of some custom filtering being developed for use with captures from laserdiscs. Apparently, some of them have a moving moire pattern among other types of noise specific to laserdiscs. No time line, it's being investigated right now.
FredThompson
14th July 2003, 10:08
I've just posted a new screenshot at http://www.geocities.com/fredthompson6 showing before and after cleanup of an S-VHS capture via DV. The swimming black and some chroma corruption were cleanup up quite well. However, there is an undesirable smear from 4:1:1 colorspace. As soon as I get Xesdeeni's VirtualDub filter designed to help remove this junk, I'll post the new filter set.
FredThompson
15th July 2003, 00:50
I have briefly tested Xesdeeni's 4:1:1 helper with VirtualDub. From what I can tell, it looks quite nice. The horrible chroma noise on what should be black didn't totally go away but it is diminished. Full filters going up soon.
FredThompson
15th July 2003, 07:01
Great news!!
As noted here: http://forum.doom9.org/showthread.php?s=&threadid=56517
I've found a good combination of filters to handle smoothing the near blacks while also almost completely removing the grid-like color problems of 4:1:1 colorspace with very little processing time.
This is really, really cool.
I'm updating the screengrabs on the site to show the results then I'll finish cleaning up the script to incorporate this change.
Also, I should mention that the wavelet noise filter that's here: http://forum.doom9.org/showthread.php?s=&threadid=56871 is very, very good. I've been testing it for a couple of hours tonight and found it's almost good enough to be used by itself. There are, however, some things it's not good at. Unfortunately, it's dog slow, dragging my Athlon 2100 down to 3 fps. If you consider the rest of the script runs at 8-9 fps, even with the near-black smoothing, that's a significant hit. Mind you, the results are incredible.
However, I did NOT look at the results after compression. It may very well be that the lossy nature of MPEG compression would make the post-compression results much less dramatic. Still, keep an eye on this. When 64-bit processors cost the same as Athlons and the wavelet stuff is optimized, it's probalby going to be an incredible jump in quality.
xpavement
29th July 2003, 15:55
I just wanted to say thanks for the script. It has helped me to learn and use AVS scripting techniques. I am currently using the KVCD_Filter part of your script on separatefields on an interlaced source, and I still notice the blur on the frame before a scene change. I'm using the newest version from your site. I noticed above you mentioned something about this being fixed, but I can't tell what part of the script is fixing it?
FredThompson
29th July 2003, 16:23
Oh, well, then I probably haven't uploaded the current one. I got more involved in solving an NTSC DV problem. Lots of things have changed and will continue to change. I'm going to modify it to smooth near-black in the luma only. I'll put a newer script up later today.
t610425
7th August 2003, 08:13
Originally posted by kwag
It can be used as a basic framework to plug in and try other filters, just by changing a couple of lines.
-kwag
Hello kwag, I gave a try at your script, using an NTSC 720x480 VHS capture and I get the following message from Avisynth:
"Plane Difference: Only Planar images (as YV12) supported!
([ScriptClip]: line 1)
This is how I modified the script:
#Last updated on ( July 8, 2003 @15:45 GMT ):
#For DVD and clean material (AviSynth 2.0x):
#Code:
#LegalClip()
#
#unfilter(50,50)
#GripCrop( X, Y )
#GripSize(resizer="BicubicResize")
#STMedianFilter(8, 32, 0, 0, 8, 32)
# SpaceDust() # Optional - for some "not so clean" DVDs.
#temporalsmoother(1,2)
#mergechroma(blur(1.50))
#mergeluma(blur(0.2))
# Convolution3d or DCTFilter for extreme worse cases.
#GripBorders()
#LegalClip()
#For DVD and clean material ( for use ONLY with AviSynth 2.5x )
## Now with Linear Motion Adaptive Filtering ##
### Ver. July 8, 2003 @15:45 GMT ###
#Code:
## DLL Section ##
#
#LoadPlugin("C:\Filters25\MPEG2Dec3.dll")
#LoadPlugin("C:\Filters25\GripFit_YV12.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\STMedianFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\asharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\unfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dustv5.dll") #
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LegalClip.dll") #
####
## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf = 0 # Current frame.
#
####
## Main section and static filters ###
#
AVISource("i:\ws1001.avi",false)
#
#undot()
#Limiter()
#asharp(1, 4)
#GripCrop(Your_GripCrop_Parameters_Here)
#GripSize(resizer="BicubicResize")
#STMedianFilter(8, 32, 0, 0 )
#MergeChroma(blur(MaxTreshold))
#MergeLuma(blur(0.1))
#
#
#For VHS and captures:
#Code:
separatefields()
LegalClip()
unfilter(50,50)
#GripCrop( X, Y )
#GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0)
FaeryDust() # or PixieDust()
mergechroma(blur(1.50))
mergeluma(blur(0.2))
# Convolution3d or DCTFilter for extreme worse cases.
#GripBorders()
LegalClip()
## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:
SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
#
#
#
#GripBorders()
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker!
Limiter()
weave()
#
#
## Functions ###
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}
#
####
The source is YuY2 interlaced.
Pls advice,
tnx in advance
Takis
Wilbert
7th August 2003, 12:47
It means that ScriptClip requires YUY2, thus add a ConvertToYUY2 before applying ScriptClip:
## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:
ConvertToYUY2()
SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
t610425
7th August 2003, 19:03
Originally posted by Wilbert
It means that ScriptClip requires YUY2, thus add a ConvertToYUY2 before applying ScriptClip:
But Wilbert,
the avi is YUY2, at least that's what is reported by vd and I think that "legalclip" requires YUY2. To be honest "planar" is what worries me, cause my source is interlaced, I tried to solve this by "separatefields"..
Maybe I should use converttoYV12 instead?
atb
Wilbert
7th August 2003, 21:13
Maybe I should use converttoYV12 instead?
That's what I meant ...
To be honest "planar" is what worries me, cause my source is interlaced, I tried to solve this by "separatefields"..
This is the correct way of solving that.
FredThompson
12th August 2003, 09:29
It's been a long time since I've been working on this filtering. Got sidetracked with an issue of chroma bleeding in NTSC DV and a few other things. Well, now I'm back to actively working on filtering and I've got some brand spankin' new VHS tapes from my parents' analog cable setup (bleech!!!) There's a few ideas I'm chasing down like a filter to emulate a comb filter. Should have some progress to report fairly soon.
Beak
16th August 2003, 15:52
Hello. This will be my first post in the Capture forum. I recently got a DC-10 card. I captured VHS at around 6000 Kbps.
The quality of the original capture was decent but with lots of noise as well as interlaced via a 3:2 telecine.
Being a newbie,I started with De-interlace MAP as suggested by the guide at Doom9.I compared the output of this filter compared to decomb and a few other filters with virtual dub during encoding.To my untrained eye, this filter appeared to remove the interlacing best while disturbing the picture the least.Default settings were used for all filters I checked.
That left me with the noise, which I used smart smoother to remove,again at default.
The resultant Xvid file is excellent when compared to a lot of stuff I have seen and downloaded. I was most interested in the picture not appearing over-processed or "digitized" if you know what I mean.
Downside of this setup was I was only able to process at just less than 2 frames per second on my aging P3/733. Dual pass xvid is pretty tedious at this speed.
Anyway, I am posting to see if others have found MAP to be a good filter.:D
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.