PDA

View Full Version : NMS: No Mo Snow, 2-pass denoise script for noisy sources (TV caps, DV)


Toast
5th April 2004, 07:30
Well, a picture really is worth a thousand words. So for those of you who want to see what this script can do, scroll down to the screencaps below.

I tuned this script as a way to effectively denoise material containing *LOTS* of noise without sacrificing any noticeable detail. This is primarily targeted for use on analog TV caps and also on DV video. I call it No Mo Snow or NMS. Reasons why I was dissatisfied with other denoisers:

1. Denoising filters which keep a good amount of detail are generally too weak to remove a significant amount of noise from analog TV caps. The few filters which remove the majority of noise from analog TV caps blur the picture to a completely unacceptable amount.
2. The available denoisers work fairly well on still scenes containing minimal motion. However, they all stumble when motion is introduced into the frame. When a object initally picks up motion, or the camera begins to pan, there is very little denoising activity for several frames. The result is a substantial amount of noise intially which gradually subsides until the object stops movement.

Now, I've basically implemented two ideas which I thought would help address the above issues respectively.

1. Processing with inverted colors (negative images)
2. Processing the clip in reverse order

The reason for #1 is that I've noticed Pixiedust (the primary filter used) filters out dark colored noise much better than lighter colored noise. By inverting the colors and running a 2nd pass, Pixiedust should be able to catch and filter out more noise.

The reason for #2 is to address the motion+noise issue. If we were to attack the clip in reverse order, then objects going into motion would initially have a very small amount of noise followed by a gradual increase in noise (when played in the forward direction). If we filtered the clip in both forward and reverse order, then objects would initially have a minimal amount of noise which would gradually increase as the object picked up speed (and hence become blurred) and die back down as the object came to a halt. That way, the most visible noise would be masked by the objects movement, which is much less objectionable then noise surrounding a slow moving object.


USAGE:
You'll need to load Dust, HybridFuPP (http://forum.doom9.org/showthread.php?s=&threadid=70734) , as well as the latest version of these plug-ins:
VagueDenoiser.dll (http://forum.doom9.org/showthread.php?s=&threadid=56871)
RemoveDirt.dll (http://forum.doom9.org/showthread.php?s=&threadid=70856)

FluxSmooth.dll
MaskTools.dll
MPEG2Dec3dg.dll
MSharpen.dll
UnDot.dll
UnFilter.dll

I've included calls to load the above plugins in the script assuming they're installed in the default folder for Avisynth. Change as necessary.

The scripts themselves are very simple. Almost trivially so. But as you might have guessed, running this process will take just a little bit (hehehe) of time :) It will also require a decent amount (read lots and lots) of hard drive space as well.

Directions:
1. Load your clip into the barebones "NMS_SOURCE.AVS" and make sure to include deinterlace, IVTC, and/or decimate commands as necessary. Progressive material fares much better than interlaced and/or telecined content. Demux audio as necessary. Make sure you do any frame trimming here as we will be inverting and reversing the clip the first pass. I find trying to cut out commercials and such to be a pain-in-the-you-know-what when the clip is alienized and overwritten with demonic chants ;) This script will be called in "NMS_PASS1.AVS"
2. Open up NMS_PASS1.AVS in VDub. Make sure to properly locate "NMS_SOURCE.AVS" as your avisource. Use Fast Recompress and HuffyUV compression to save the video.
3. Open up NMS_PASS2.AVS in VDub. Make sure to properly locate the output from step 2 as your avisource. Use Fast Recompress and HuffyUV compression to save the video. Or encode directly to another format if desired.


Scripts and comments about settings below. Screenshots further below.

Toast
5th April 2004, 07:33
Edit - Added colorspace conversion checks to NMS_PASS1.AVS and NMS_PASS2.AVS
Edit - Script modified to return original colorspace



NMS_SOURCE.AVS

# NMS_SOURCE.AVS
# NO MO SNOW DENOISER - SOURCE FILE
# SEND TO NMS_PASS1.AVS
#
# LOAD PLUGINS



# SOURCE
AviSource(" ")

##########################################################################
# INSERT ANY DEINTERLACE, TELECIDE, AND/OR DECIMATE COMMANDS HERE


##########################################################################
# CROP AS NECESSARY
# USE MOD8 RESOLUTIONS
# DO NOT CROP LATER ON UNLESS YOU STAY WITH MOD8 RESOLUTIONS


##########################################################################
# IMPORT TRIMSET



NMS_PASS1.AVS

# NMS_PASS1.AVS
# NMS - 1ST PASS SCRIPT
# SAVE OUTPUT TO HUFFY-UV FILE
#
# LOAD DUST IF NOT AUTOLOADING


# SOURCE
AviSource("NMS_SOURCE.AVS")
OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = IsYUY2() ? "YUY2" : "RGB"

##########################################################################
# INVERT COLORS, REVERSE ORDER, AND THEN DENOISE
Invert()
Reverse()

OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
Pixiedust(limit=2)

##########################################################################
# OUTPUT ORIGINAL COLORSPACE
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()

return( last )




NMS_PASS2.AVS

# NMS_PASS2.AVS
# NMS - 2ND PASS SCRIPT
# SAVE OUTPUT TO HUFFY-UV FILE
#
# LOAD PLUGINS
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll")

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FluxSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MPEG2Dec3dg.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MSharpen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnFilter.dll")


# SOURCE
AviSource("NMS_PASS1.avi")
OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = IsYUY2() ? "YUY2" : "RGB"

##########################################################################
# INVERT COLORS, REVERSE ORDER, AND THEN DENOISE
Invert()
Reverse()

OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
Pixiedust(limit=2)
VagueDenoiser(threshold=4, method=0, nsteps=6, chroma=true)
RemoveDirt(athreshold=20, mthreshold=40)


##########################################################################
# FILTER+RESIZE, USE EVEN IF NOT RESIZING
# ENTER FINAL CLIP SIZE INTO HYBRIDFUPP LIKE BELOW
#hybridFupp(512,384,preset="high")
OrigColSpace != "YV12" ? ConvertToYV12() : NOP
hybridFupp( , ,preset="high")


##########################################################################
# OUTPUT ORIGINAL COLORSPACE
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()

Toast
5th April 2004, 07:34
Note on Settings:

Stronger values for PixieDust are not always desireable for 2 pass noise reduction. Compression gains are minimal at the cost of greatly increased blurring. In fact, setting Pixiedust strength too high can hurt compression and detail.

I prefer method=0 "hard" threshold for VagueDenoiser. With the default settings, I see compressibility tests jump to around 3-4x baseline on noisy caps after the complete 2 pass. So it's unlikely you'll need even more compression. However, changing this setting to "soft" threshold usually nets a big jump in compression at the expense of a softer image throughout. If you get error messages about your clip not being large enough, reduce "nsteps" until the error message goes away.


Approximate relative impact of each step:

Original File Size - 100%
1st Pass - 88%
2nd Pass - 74%

2nd Pass Details
Initial Size - 88%
After PixieDust - 79%
After VagueDenoiser - 75%
After RemoveDirt - 74.5%
After hybridFUPP (with no resize) - 74%

The amount of final compression obviously depends heavily on the amount of noise in the clip. The most I have seen file size dip so far is into the low 60% range after the script, with very good detail retention.

I have not fooled around much with hybridFUPP's settings. So that may be worth tinkering with for best results. I like it primarily as it tends to blur motion (where we find noise) separately from no/low motion scenes so as to best preserve visual detail and bitrate. I suspect altering some of the filtering chains at the very least would allow for some nice gains.

I've tried several times to substitue IIP(disabling the call to PixieDust) for hybridFUPP in the script with various parameters. But I encounter serious artifacts and the net result is not pretty. Other users may have more luck than I. If so, please post the settings you used. I still do love IIP for my DVDs though.

Toast
5th April 2004, 07:40
Ok, here are some screencap comparison. All pics are 688x472. I recommend you DL the pics to your HD so you can switch back and forth to compare.

Source clip is IVTCd and decimated via the following script with no other filters applied using Decomb 5.1.1:
Telecide(order=1,guide=1,post=2,vthresh=65, nt=20)
Decimate(cycle=5)
Crop(8,4,688, 472)

Source frame
http://home.comcast.net/~toasteroven/Source2.PNG


Same frame after processing
http://home.comcast.net/~toasteroven/Processed2.PNG



Here are several other frame grabs to compare:
Source1 (http://home.comcast.net/~toasteroven/Source1.PNG) Processed1 (http://home.comcast.net/~toasteroven/Processed1.PNG)
Source3 (http://home.comcast.net/~toasteroven/Source3.PNG) Processed3 (http://home.comcast.net/~toasteroven/Processed3.PNG)
Source4 (http://home.comcast.net/~toasteroven/Source4.PNG) Processed4 (http://home.comcast.net/~toasteroven/Processed4.PNG)

Schrade
5th April 2004, 09:49
Very nice work! How did you get Dust to work with AviSynth 2.55? Did you use oldPlugins.avsi?

I've tried to get it working but the PixieDust line in NMS_Pass1.avs crashes the whole process :-/

Toast
5th April 2004, 09:59
Yep, I'm using oldPlugins.avsi to get it working with AviSynth 2.55. To get everything working, I created a folder named "old" inside my Avisynth plugins folder. Inside that folder, I have DustV5.dll, LoadPluginEx2.dll, and DustV5.avs

Contents of DustV5.avs (Credit to author)



##Dust Version 5 by Steady 01/23/2003

LoadPlugin("DustV5.dll")
AVIsource("my.avi")

## Faerydust (temporal only) maximum detail
#FaeryDust([limit=2],[output="RGB/RGB32/RGB24/YUY2"])

## PixieDust (Temporal + spatial) max compression
PixieDust([limit=5],[output="RGB/RGB32/RGB24/YUY2"])

## GoldDust (heavy spatial) max noise removal
GoldDust([limit=8],[output="RGB/RGB32/RGB24/YUY2"])

## SpaceDust (Spacial only) max speed
SpaceDust([output="RGB/RGB32/RGB24/YUY2])

## Version 5 changes:
## Greatly reduced blockiness with motion
## many small changes

## Known issues:
## Very slow
## Only one instance per script


Inside my plugin folder, I dropped in oldPlugins.avsi contents of which are:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\old\LoadPluginEx2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\old\DustV5.dll")

Hopefully, that'll get you up and running. I do remember I had a helluva time trying to figure out how to install Dust as well :D

Schrade
5th April 2004, 10:50
Yeah I have all that set up correctly too :-/ It all just crashes on me when it gets to PixieDust in the script. (I can comment it out and it works fine)

Erf I think I just figured it out. I was using ConvertToYV12() to make the deinterlacing commands work. Dust apparently doesn't like that.

Basically what I am working with is NTSC DV AVIs.

Any suggestions? I see you mentioned that this script would be useful for DV video so I'm hoping you have some experience with this too :)

DarkNite
5th April 2004, 11:59
Thank you for the excellent reason to go buy another storage array! ;)

Seriously though, this method worked quite nicely for the 5 minute capture I just tested it with.

UPN 20 eh? *runs down the street, knocks on Toast's door, and runs away*

@Schrade

Were you looking for settings advice, or suggestions on getting your script running? I honestly can't tell for sure from your post...

If your script is crashing on the PixieDust line you may need to insure that you're in the YUY2 colorspace before Dust is called.

If you're looking for a particular setting then you might want to avoid settings above 3 in PixieDust as it may get blocktastic in cetain situations, and you'll be running it twice anyways. Although the blocktastic effect is most pronounced/likely when working with animation of variable framerates or heavy motion/frequent scene changes (I'd never seen 16x16 blocking before that) it has also struck a few times with film based action material when using settings of 4 and above.

That's just my experience though, all of 3 times in 200+ sources, so not a frequent issue. Your milage may vary.

Didée
5th April 2004, 12:07
Dust can only handle clips in YUY2. The script, however, doesn't check the input colorspace, and only does a blind "ConvertToYV12()" before calling HybridFupp. Seems Toast is working with YUY2 input only ...

So, you could either manually put PixieDust into a "ConvertToYUY2() / ConvertToYV12()" - Sandwich, or (much more elegant) check the input colorspace at the beginning of the script with the "IsYUY2()/IsYV12()" functions, and then apply colorspace conversions in the script only when necessary.

- Didée


edit: seems I missed a post or two, befor posting ;)

Toast
5th April 2004, 15:45
Schrade - If you can't get it working post your NMS_SOURCE.AVS so we can debug for you. I've used the script to process DV footage in order to remove grain from low level light conditions. The camera I use from time to time (Panny PV-DV953) doesn't do so well in low level lighting conditions and the filtering process does a good job helping out there.

DarkNite - LOL, well I hope you're in the right city since I see a few UPN 20 stations. Otherwise, could be a bit of a run! Hint: There's this really big 5 sided building close by... :rolleyes: :D Anyhow, glad the script worked well for you. I'm anxious to see how it works out for everyone.

Didée - Doh! Should have been more careful with the script. You're right I mainly work with YUY2 input so that one flew right over my head. I took your advice and edited the scripts to check for colorspace. Sorry about the confusion everyone.

Didée
5th April 2004, 16:26
Toast: on the right way, but:
somewhen posted by neuron2

Close, but no cigar ;)

Ideally, a script should always

- accept any input colorspace

- return always the same colorspace as the input originally was in

Now, to be honest, most times I don't follow these 'rules' by myself, *chough* ...

However, integrating something like this can avoid many "bug" eports:# ... ...
# whatever may come above
# ... ...

OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = ISYUY2() ? "YUY2" : "RGB"

# First, doing a YUY2-only filter
# -------------------------------
OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
AnyYUY2Filter(parameters)

# ... ...
# whatever may come inbetween
# ... ...

# Now, doing a YV12-only filter
# -----------------------------
OrigColSpace != "YV12" ? ConvertToYV12() : NOP
AnyYV12Filter(parameters)

# ... ...
# whatever may come inbetween
# ... ...

# Finally, return the same colorspace the input originally was
# ------------------------------------------------------------
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()

return( last )

If we forget for the moment about potential interlaced/progressive YUV, or RGB24/RGB32 issues, most colorspace irritations should be avoided this way.
The rest can be done in similar way, but I didn't want to make this example too long.

;) Didée

Toast
5th April 2004, 16:59
LOL, I thought that was too easy ;)

Didée, I see what you're saying and agree that it's a good idea. I modified the scripts to implement this. :thanks: Thank you for the helpful bits of code. Your experience here (and my lack thereof) clearly shows.

Mug Funky
5th April 2004, 17:15
very good idea there!

i can't really test this atm because i haven't anywhere near the disk space.

would it be possible to replace the intermediate files with avisource refs to the actual scripts? i haven't used dust so i don't know how it behaves with random access (i started using avs seriously at 2.5+, and could never make loadpluginex work for me, as i like autoloading too much :))

Toast
5th April 2004, 17:20
AFAIK, that's not possible. Apparently, you can only have one instance of Dust per script. If you try and call it more than once, you get this weird pattern of stutters and repeating series of frames. And somehow your clip becomes ~50% longer than it started out at.

Schrade
5th April 2004, 20:07
Don't have much time here so am just going to post my NMS_Source.avs script. I had to ConvertToYV12 in it in order to get the Telecide/Decimate commands to work.

Doing that conversion broke PixieDust. Does doing too many of these sandwiched colorspace conversions mess with the output too much?


# NMS_SOURCE.AVS
# NO MO SNOW DENOISER - SOURCE FILE
# SEND TO NMS_PASS1.AVS
#
# LOAD PLUGINS
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\UnDot.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\UnFilter.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\Decomb511.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\FluxSmooth.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\MaskTools.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\MPEG2Dec3dg.dll")
LoadPlugin("C:\Apps\AviSynth 2.5\Plugins\MSharpen.dll")

# SOURCE
AviSource("DV-PlayingWithCats.avi")

ConvertToYV12()

###################################################################
# INSERT ANY DEINTERLACE, TELECIDE, AND/OR DECIMATE COMMANDS HERE
Telecide(order=1,guide=1,post=2,vthresh=65, nt=20)
Decimate(cycle=5)


###################################################################
# CROP AS NECESSARY
# USE MOD8 RESOLUTIONS
# DO NOT CROP LATER ON UNLESS YOU STAY WITH MOD8 RESOLUTIONS
BicubicResize(720,528)


###################################################################
# IMPORT TRIMSET

Toast
6th April 2004, 04:07
Ok, the reason you had to do a conversion is that your DV codec probably only supports RGB. Decomb works with both YUY2 and YV12 colorspaces but not RGB so a conversion is needed.

First question is are you running the newly revised scripts? That should take care of your problems. If that doesn't solve it, then most likely you have a problem somewhere with your setup. Make sure you can call Pixiedust without a problem by creating a simple script and running it to check.

I don't think doing colorspace conversions mess with the output. Just adds overhead. On that note, you should call ConvertToYUY2() instead of YV12() in your NMS_SOURCE.AVS as you'll save yourself some unnecessary conversions.

Schrade
6th April 2004, 05:38
Yeah I'm running the new scripts. I switched the ConvertToYV12() to ConvertToYUY2() but now Invert() complains about it not being YV12 :-P

Oi...my head is starting to hurt!

What DV codec do you normally use? I believe I'm currently using the Sony DV Codec. Any particular one you suggest?

Mug Funky
6th April 2004, 11:30
i suggest FFDshow latest binary... it will decode DV through DirectShow and now through VfW if you tell it to.

very fast and doesn't mess with the DV stream like others do (all it does is clamp the colours to RGB scale, dammit). it'll return any colourspace you ask of it.

themichael
8th April 2004, 20:07
Just the filtering I was looking for, but.....

I had to change the AviSource to DirectShowSource for the NMS_SOURCE file to work. Not a problem really.

After running NMS_PASS1 on a 25 min clip for 9 hours (out of 2 days) the file was of the first (last) frame 2 minutes long.

Removing Invert(), Reverse(), and Pixiedust() the file played ok. Uncommenting Invert() the file played ok. Putting Reverse() back in, the file stayed on the first frame.

Checking NMS_PASS2 I get " Script error: MotionMask does not have a named argument "thY1" (oldPv, line 127) (oldPv, line 100) (oldPv, line 88) (AVSEdit-path\Preview.avs, line 39)"

I have downloaded the latest versions. Any ideas? And how do I make it run faster? System is 2800 AMD with 768Meg RAM. I have 26 hours of VHS to save and looking at 2 months just to clean....?

zeus163
12th April 2004, 08:32
To be honest this is exactly what I'm looking for to clean up some footage I have. However, most of my scripts are cut and pastes from this board since I don't seem to be that great at script experimentation--OK, I digress.

My problem with this script is I seem to be lost. I got the first *.AVS file to load by adding a ConvertToYV12() as YUY2 input kept erroring the second script out. When I loaded the second script that calls upon the original script into VirtualDub to process the .avi file, it starts at the middle of the video I'm trying to convert, then goes to the end and then shows the beginning. It's like it's not in the correct running order. I wonder if that makes any sense whatsoever. What could I have done wrong? *Edit* It is playing the file backwards! Woah! *Edit end* This is what is in the script:
AviSource("E:\avis to work on\Ben Lee\ben lee no more snow.AVS")
OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = IsYUY2() ? "YUY2" : "RGB"
Invert()
Reverse()
OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
Pixiedust(limit=2)
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()
*edit*
I can't get the final script to load though. It gives me an error about needing yv12 data although, I thought I converted it to that in the first script to get the second script to load in virtual dub. Back to the drawing board in the morning.
*End Edit*

I'm trying it right now, but I will have to check it in the morning or when I get home from work. Any help would be superb!

*More edit*
Now I'm getting an error with removedirt--it states something not having an arugment named athreshold. Maybe it's because I had to add a converttoYV12 line into the final avs file to get it past one of the lines. I have now spent too much time on this for the evening and will attempt this tomorrow when I get home from work.*End Edit*

Thanks!

Gambler's Ruin
1st May 2004, 10:50
Hi, I'm getting similar problems to these other few guys. VirtualDub keeps giving an error about Inverse() needing YV12 input. I've tried using Didee's YV12 conversion line before Inverse() in both pass1 and pass2, but this just crashes virtualdub upon opening. The only way to make it work seems to be to manually input converttoyv12() in NMS_SOURCE, but I haven't tried putting it in NMS_PASS1 to make NMS_PASS2 work yet, since (the way i see it) pass1.avi needs to be encoded with the yv12 line inserted, which I didn't do originally. Is it okay to manually put these converttoyv12's in?

I've been trying to study how the inverse() command works but avisynth's dictionary definition was a little short and confusing. My input is virtualvcr-captured analong in YUY2(or so I think)using picvideo's mjpeg 19, so why does inverse() choke on it? Seems like inverse is supposed to take YUY2, YV12, or RGB anyway. Some of the more technical discussions suggest that Inverse() may not like MJPEG's colorspace?? I have no idea. I'd appreciate any suggestions.

troy
2nd May 2004, 11:06
Ok i totally edited this post so that soonUdies reply is appreciated but is not relevent. I installed the latest hybridfupp and latest avisynth. I also changed my avisyth registry to properly point to the plugins folder (damn u dvd2dvdr). I also loaded the libmmd.dll file into my system32 folder. I can open the original NMS_SOURCE.AVS with no problem. In the NMS_PASS1.AVS file it complains about the invert command needing yv12 data. So if I do the ConvertToYv12() in the NMS_SOURCE.AVS and then try to open the NMS_PASS1.AVS file it opens but with only this green screen of death???

My source is a dv capture exported from premiere with cdvc codec.
___________________________________________________________________
# NMS_SOURCE.AVS
# NO MO SNOW DENOISER - SOURCE FILE
# SEND TO NMS_PASS1.AVS
#
# LOAD PLUGINS
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\UnDot.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\UnFilter.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\Decomb510.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\FluxSmooth.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\MaskTools.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\MPEG2Dec3dg.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\MSharpen.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\old\loadpluginex2.dll")

# SOURCE
avisource("d:\nms\nmstest.avi ")
ConvertToYv12()
##########################################################################
# INSERT ANY DEINTERLACE, TELECIDE, AND/OR DECIMATE COMMANDS HERE


##########################################################################
# CROP AS NECESSARY
# USE MOD8 RESOLUTIONS
# DO NOT CROP LATER ON UNLESS YOU STAY WITH MOD8 RESOLUTIONS


##########################################################################
# IMPORT TRIMSET
_____________________________________________________________________

# NMS_PASS1.AVS
# NMS - 1ST PASS SCRIPT
# SAVE OUTPUT TO HUFFY-UV FILE
#
# LOAD DUST IF NOT AUTOLOADING
#LoadPlugin("D:\Program Files\AviSynth 2.5\Plugins\dust.dll")

# SOURCE
AviSource("d:\nms\NMS_SOURCE.AVS")
OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = IsYUY2() ? "YUY2" : "RGB"

##########################################################################
# INVERT COLORS, REVERSE ORDER, AND THEN DENOISE
Invert()
Reverse()

OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
Pixiedust(limit=2)

##########################################################################
# OUTPUT ORIGINAL COLORSPACE
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()

return( last )
____________________________________________________

SoonUDie
2nd May 2004, 11:43
Originally posted by troy
I get the error:
ResetMask:RGB32 data only
Check this (http://forum.doom9.org/showthread.php?s=&threadid=75057) thread.

SomeoneElse
12th June 2004, 04:33
Hi,

I am trying to load the NMS_PASS1.AVS file and it complains it needs yv12 data. My source is a DV avi.

Here is what I am using. Could anyone help ?

Thanks!

# NMS_PASS1.AVS
# NMS - 1ST PASS SCRIPT
# SAVE OUTPUT TO HUFFY-UV FILE
#
# LOAD DUST IF NOT AUTOLOADING


# SOURCE
AviSource("NMS_SOURCE.AVS")
OrigColSpace = IsYV12() ? "YV12" : ""
OrigColSpace = IsYUY2() ? "YUY2" : "RGB"

##########################################################################
# INVERT COLORS, REVERSE ORDER, AND THEN DENOISE
LoadPlugin("C:\MyStuff\NotBurned\VideoStuff\AviSynth2\plugins\MaskTools.dll")
Invert()
Reverse()

OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP
Pixiedust(limit=2)

##########################################################################
# OUTPUT ORIGINAL COLORSPACE
OrigColSpace == "YV12" ? ConvertToYV12()
\ : OrigColSpace == "YUY2" ? ConvertToYUY2()
\ : ConvertToRGB()

return( last )

MfA
12th June 2004, 05:18
Originally posted by Toast
The reason for #1 is that I've noticed Pixiedust (the primary filter used) filters out dark colored noise much better than lighter colored noise.

So have you verified wether it actually helps much? :) I would have given far better odds on this being caused by gamma (which you can do nothing about from script).

Wilbert
12th June 2004, 15:54
Invert doesn't need YV12, so I'm a bit confused. Does the following script work

# SOURCE
avisource("d:\nms\nmstest.avi")
Invert()
Reverse()
ConvertToYUY2()
Pixiedust(limit=2)

Btw, if the clip is already YUY2, which is probably the case for your DV (but it could also be RGB depending on the codec), then ConvertToYUY2 doesn't do anything. Thus the line

OrigColSpace != "YUY2" ? ConvertToYUY2() : NOP

is not necessary.

Fizick
12th June 2004, 16:02
Why we can not use two Dusts in one script?
may be with some hex hack it is will possible?

Wilbert
12th June 2004, 16:08
Why we can not use two Dusts in one script?
may be with some hex hack it is will possible?
Dust uses some global variables.

SomeoneElse
12th June 2004, 19:16
Hi
I am using the panasonic DV Codec. If I put ConvertToYUY2() I get the whole screen Green In virtualdub! Any ideas ?

Thanks!

Fizick
14th June 2004, 12:45
Wilbert,
How we may get to know the names of this global variables?

Wilbert
14th June 2004, 23:33
I have no idea.