Going Out Of My Mind Trying To Make This Footage Look Good!

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
User avatar
Melichan923
Joined: Tue May 30, 2006 8:21 am
Location: New Hampshire
Contact:
Org Profile

Going Out Of My Mind Trying To Make This Footage Look Good!

Post by Melichan923 » Tue Jan 18, 2011 3:16 pm

DVD clips and example pictures at the bottom.

Hey everyone,

I've had an AMV idea brewing in my mind for ages and I finally got all the DVDs to do so months back. But it seems no matter what I try, I can NOT make this footage look presentable! I was trying to figure out something without having to ask for help, but if I spend another day on this I'm going to scream. :x The problem is moving noise EVERYWHERE (not dot crawl as far as I know.) It looks so bad I'm considering trying to download RAWS or TV catpures to see if they look any better. The anime I'm using is a kids show so I'm sure they didn't spend a great deal of time encoding, and in some ways I'm lucky this show doesn't have a great amount of detail so I can attempt to remove noise without taking out so much detail.

The problem I'm having? Of course I can remove noise, it's quite easy to toss in a heavy duty denoiser then sharpen to attempt to reverse any blurring it may have caused... my problem is I cannot find a good balance. Removing too much noise causes dark areas to block like crazy to the point you cannot NOT notice it and therefore making my attempt counterproductive and nothing will get rid of it! Removing too little looks like a bad de-interlacing job (so much flickering around edges) and makes me think masking out characters in my video will be almost impossible to look neat.

I'll have to upscale this video when I send it to cons that require HD video, and that just won't be fun if it already looks horrendous at it's original aspect ratio.

The best filter chain I've come up with so far is this:

Code: Select all

mpeg2source("F:\DVDRIPS\001.d2v",cpu=0)
AMVIVTC(mode=1)
crop(6,6,-6,-6)
spline36resize(640,480)
FluxSmoothT(temporal_threshold=4)
TemporalCleaner(ythresh=2, cthresh=4)
HQDN3D(ls=2, cs=1, lt=0, ct=0)
removegrain(mode=1)
converttorgb32()
Now, some of you may look at that and wonder why the heck I have four different noise removers in there with really weird strength values and all I can say is this: it produced the best results so far while I was experimenting. But that's not saying much. I've tried almost every denoiser/degrainer/dotcrawl removers I can find in different orders, strengths, and modes and I can't find anything that's satisfactory yet. I've even tried just temporal and just spatial. No luck. The one above causes the least amount of blocking in dark areas like the main characters hair. I seems to have better results when I blindly toss filters in there then when I read the documentation and try really hard to get them right. :roll:

Anyway, I'll stop rambling now. :lol: Some pictures of my issues:
Spoiler :
Pic 1. Picture in it's original Aspect Ratio:
Image

Pic 2. Resized and cropped:
Image

Pic 3. An example of a typical attempt trying to removing noise with this source. See the bad blocking it introduces in his hair especially around the lines? Not EXTREMELY bad when looking at a non moving image, until you remember that the blocks move from frame to frame:

Image

Pic 4. Picture of the script I used in the code tag above. Still far from perfect and a lot more noise than the picture above, but with a lot less "blocking" or "staining" or whatever that problem looks like. Looks better, but not close to good enough.
Image
Spoiler :
Pic 1. Picture in it's original Aspect Ratio:
Image

Pic 2. Resized and cropped:
Image

Pic 3. An example of a typical attempt trying to removing noise with this source. See the bad "blocking" or whatever it is it introduces in his hair especially around the lines? Not EXTREMELY bad when looking at a non moving image, until you remember that the blocks move from frame to frame:

Image

Pic 4. Picture of the script I used in the code tag above. Still far from perfect and a lot more noise than the picture above, but with a lot less "blocking". Looks better, but not close to good enough.
Image
Spoiler :
Here's a scene with not as many dark areas in it.
Pic 1. Picture in it's original Aspect Ratio:
Image

Pic 2. Resized and cropped:
Image

Pic 3. An example of a typical attempt trying to removing noise with this source. Less noise, but less detail.

Image

Pic 4. Picture of the script I used in the code tag above. More noise than the picture above and this time the picture above looks slightly better.
Image
Spoiler :
Here's a scene with more fine details than the others.
Pic 1. Picture in it's original Aspect Ratio:
Image

Pic 2. Resized and cropped:
Image

Pic 3. An example of a typical attempt trying to removing noise with this source. Less noise, but less detail.

Image

Pic 4. Picture of the script I used in the code tag above. More noise than the picture above and this time the picture above looks slightly better.
Image
Spoiler :
Here's a darker scene.
Pic 1. Picture in it's original Aspect Ratio:
Image

Pic 2. Resized and cropped:
Image

Pic 3. An example of a typical attempt trying to removing noise with this source. Thankfully there isn't "blocking" in this scene. It seems to only happen in black areas.

Image

Pic 4. Picture of the script I used in the code tag above. More noise than the picture above and I think the picture above looks slightly better.
Image
Here are some m2vs of the dvds I uploaded for anybody who would like to experiment, since you can't predict the results with just the pictures:
http://www.megaupload.com/?d=G8STU9B2 (19MB)
http://www.megaupload.com/?d=ICX16OSP (79MB)
http://www.megaupload.com/?d=MRIXC6ZL (13MB)
http://www.megaupload.com/?d=7J26IEAO (21MB)

I've run into similar issues before, but not this bad. Can somebody please help me out? I'd appreciate it more than you know! :) Thank you very much.
Image
Image Image

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by Mister Hatt » Wed Jan 19, 2011 6:11 am

Sorry, where is the noise? I might be quite the experienced encoder but I seem unable to recognise the noise you're talking about. Perhaps you are confusing noise for GRAIN? Grain is a good thing, don't get rid of it. Another terminology mishap you are having is you're calling dirt blocking. Those small macroblocks where grain is being turned into solids are often seen on edges of hair in MPEG-2 encodes on broadcast TV, it's called dirt.

The problems you're having here are that your encoder probably sucks, so rather than preserving grain or dither, you are forcing it to blur. You simply cannot filter small blocks and expect them to not form larger blocks. Your source just needs a proper IVTC (seriously, animeivtc sucks ass) and some cropping/resizing, maybe some REALLY light temporal smoothing because it softens the image, and some anti-dithering just incase for when you throw it into x264.

IMO your filtering is entirely overkill. Let's see how the following goes.

Code: Select all

DGDecode_MPEG2Source("F:\DVDRIPS\001.d2v")
TFM(pp=5, slow=2, mode=2, micmatching=2, clip2=tdeint(mode=3, type=2)).TDecimate()
crop(6,6,-6,-6)
spline36resize(704,480) #can change this if you want to do anamorphic differently, but imo just mux your MKV with a DAR flag
ttempsmoothf(maxr=4,strength=2)
gradfunkmirror(strength=1.01)
Gradfunk might not be needed, see how far it goes in destroying the dither. For the cons that require HD, I would recommend COMPLETELY de-graining your video completely, then upscaling to 960x720 using planar-nnedi with cshifting (or just plain old spline36 if lazy and/or not sure how to write functions), and then re-adding your grain using GrainFactory_3 before running gradfunk with no arguments this time. This will give you a good amount of detail without sacrificing your quality. With this script, when you mux with mkvmerge, set the DAR to 704x510, or for the HD version, use 993x720. This is of course assuming your input is 4:3. If cons require widescreen HD or something, start a new thread. IMO cons have ridiculous 'rules' that have no grounding on actual facts about playback or decoding and rather on them being backwards as possible.

Somewhat related, good denoising or grain removal usually won't blur anything unless you're doing it wrong. Quite often, removing grain at all is 'wrong'.

User avatar
BasharOfTheAges
Just zis guy, you know?
Joined: Tue Sep 14, 2004 11:32 pm
Status: Breathing
Location: Merrimack, NH
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by BasharOfTheAges » Wed Jan 19, 2011 9:01 am

@Mister Hatt: Making it widescreen would just require pillarboxing it with addborders(). No need to complain about anything in that case.
Last edited by BasharOfTheAges on Wed Jan 19, 2011 12:16 pm, edited 1 time in total.
Anime Boston Fan Creations Coordinator (2019-2023)
Anime Boston Fan Creations Staff (2016-2018)
Another Anime Convention AMV Contest Coordinator 2008-2016
| | |

User avatar
EvaFan
Joined: Sun Mar 21, 2004 10:25 pm
Status: (*゚▽゚)o旦~ ー乾杯ー♪
Location: Somerset, KY
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by EvaFan » Wed Jan 19, 2011 9:08 am

I think part of it has to do with full screening. The video will look fine with grain at it's particular resolution but when you full screen to watch it on a 1920,1080 lcd monitor that grain is gonna stick out like a sore thumb. Most people these days probably have these monitors and go for the clear, blurred, smooth look over the detailed, grainy result you see from a full screen.

I will admit I get rid of grain most of the times cause I think it looks ugly full screened, doesn't even look like grain at that point, just looks like large ugly quickly changing/moving discolored chunks. It's not so bad on bright scenes but on darker colors it stands out alot more from what I've seen on vids I've done.

If you're just letterboxing, heavy grain removal seems kinda pointless, cause even at a full screen the video wont be overly sized.
"The people cannot be [...] always, well informed. The part which is wrong will be discontented, in proportion to [...] the facts they misconceive. If they remain quiet under such misconceptions, it is lethargy, the forerunner of death to public liberty. What country can preserve its liberties, if it's rulers are not warned [...] that this people preserve the spirit of resistance? The tree of liberty must be refreshed from time to time, with the blood of patriots and tyrants."-Thomas Jefferson

User avatar
Melichan923
Joined: Tue May 30, 2006 8:21 am
Location: New Hampshire
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by Melichan923 » Wed Jan 19, 2011 4:44 pm

Mister Hatt wrote:Sorry, where is the noise? I might be quite the experienced encoder but I seem unable to recognise the noise you're talking about. Perhaps you are confusing noise for GRAIN? Grain is a good thing, don't get rid of it.
I agree. I usually try to preserve it as much as possible. I usually only put very light filtering in and sometimes will settle for just undot() if I don't see anything nasty. Did you download the clips? My eyes are attracted to moving "noise"/dots throughout each frame as I watch the video. It doesn't look so bad in any still frames though. Maybe I am being too picky? EvaFan is right about viewing it in fullscreen. It doesn't look as bad until I do so, but I watch everything in fullscreen and I think most people do.
Mister Hatt wrote:Another terminology mishap you are having is you're calling dirt blocking. Those small macroblocks where grain is being turned into solids are often seen on edges of hair in MPEG-2 encodes on broadcast TV, it's called dirt.
I didn't realize that's what it was called. Thanks for that info. I'm going to look up extra info on that right now. Good to know. :D
Mister Hatt wrote:

Code: Select all

DGDecode_MPEG2Source("F:\DVDRIPS\001.d2v")
TFM(pp=5, slow=2, mode=2, micmatching=2, clip2=tdeint(mode=3, type=2)).TDecimate()
crop(6,6,-6,-6)
spline36resize(704,480) #can change this if you want to do anamorphic differently, but imo just mux your MKV with a DAR flag
ttempsmoothf(maxr=4,strength=2)
gradfunkmirror(strength=1.01)
Gradfunk might not be needed, see how far it goes in destroying the dither.
Oh, thanks very much for the script! I tried it out and it does look a bit better than the original, but when the video is in motion and in fullscreen it still looks a little iffy, but at least the "dirt blocking" from my other attempts is mostly gone. And I'm afraid when I add in some sharpening to my script it's going to amplify the rest of the moving noise that's in there and make it worse again. The only things I changed in your script where the mode for tdeint since I got an error that 3 wasn't valid (changed it to 0) and I changed the size to 640x480.

Some pics:
Spoiler :
Original:
Image

After your script was applied:
Image
Mister Hatt wrote:For the cons that require HD, I would recommend COMPLETELY de-graining your video completely, then upscaling to 960x720 using planar-nnedi with cshifting (or just plain old spline36 if lazy and/or not sure how to write functions), and then re-adding your grain using GrainFactory_3 before running gradfunk with no arguments this time. This will give you a good amount of detail without sacrificing your quality. With this script, when you mux with mkvmerge, set the DAR to 704x510, or for the HD version, use 993x720. This is of course assuming your input is 4:3. If cons require widescreen HD or something, start a new thread. IMO cons have ridiculous 'rules' that have no grounding on actual facts about playback or decoding and rather on them being backwards as possible.
The only problem I can think of here is, wouldn't attempting to completely degrain it like before still cause the blocks/dirt blocking to appear again? That, when I upscale would look horrendous. Or maybe that's one of the points of putting in GrainFactory_3 and gradfunk after. Bashar is right about the pillarboxing. I think I'll be able to manage that once I can remove the grain when my video is complete.

Any more ideas or suggestions or anything? I could really use them! Thanks.
Image
Image Image

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by Mister Hatt » Thu Jan 20, 2011 12:57 am

The reason you were seeing those blocks was because your denoiser was bad. You need to use something that completely removes the frequency in question. FFT3D or dfttest are both good for this, as they preserve your lines and everything else while being able to ANNIHILATE any granular detail. What the filters you are using do however is blur or smooth while targeting multiple but inaccurate frequency ranges. I would try dfttest and just be careful what strength you use as the two main versions around have rather different parameter scaling.

If the script I gave above isn't working for you at fullscreen, keep in mind how your fullscreen resizer works. When you fs, you are actually running sometimes a software but usually a hardware scaler on it. 9/10 times this will be a bicubic resize filter. Bicubic interpolation tends to work better with what is called static or constant grain, that is, grain that doesn't move. Additionally, tweaking your x264 settings for grain preservation will probably help. I don't have time to explain the 12 or so x264 opts involved but see what happens when you use the film preset in ZarxGUI. If you still don't like it, then run dfttest on appropriate settings and try addgrainc(1,constant=true) at the end of your script. Maybe adjust that number to change strength/size of the grain, the smaller you go, the better it will look at fullscreen, however too small and you might find it being quantized away or making your video enormous.

Grain is a tricky subject. As far as info goes, I would link you to a writeup on the difference between grain and noise, but the blog in question is being rewritten soon and updated.

User avatar
Melichan923
Joined: Tue May 30, 2006 8:21 am
Location: New Hampshire
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by Melichan923 » Thu Jan 20, 2011 7:55 pm

Thanks for replying again Mister Hatt. :) Your post was very helpful to me, especially the part about about the frequency ranges. Ever since I was introduced to Avisynth and filters I've been driving myself nuts trying to figure out WHY sometimes denoising creates hideous results and you may have saved my sanity, LOL.

The very first filter I tried with this source was actually dfttest, go figure. Dfttest(sigma=4, tbsize=3) was what I came up with after experimenting with what looked best and reading some info on the web about that filter. I'll have to retry it now that I have a new de-interlacer as I'm sure that will help the quality some. I noticed some ghosting despite changing the strength and that filter was painfully slow so I got annoyed when I first tried it. Can't hurt to try it again. Since I have been using Scintilla's guide I've learned a little bit about FFT3D (or is FFT3dFilter much different?) before, but for some reason I could never get that filter to load in Avisynth. I'll try it again though and hopefully I can get it to work.

I've been warned about fullscreen resizers in the past and that could be contributing as well, so I think I will try out what you suggested after I can gtet FFT3D to load in Avisynth or Dfttest to coorperate. *Crosses fingers*
Image
Image Image

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by Mister Hatt » Fri Jan 21, 2011 1:56 am

To be honest, FFT3D is a better filter. Also depending on what version you had of dfttest, sigma=4 is either insanely high or low. One version defaults to 1.3, the other to 30. FFT3D is the name of the type of filter, the main filters that use it are FFT3DFilter and FFT3DGPU, which require FFTW.dll in your system library folder. There are better FFT3D filters but they either don't work in Windows or are not designed for avisynth. dfttest also uses FFT's but IIRC it is only a spacial filter, hence why it is so strong as it cannot adapt to temporal strengths.

Not sure what you meant by deinterlacers though. Scintilla's guide is also quite good but also outdated, as are all the other guides on this site. I should really stop being so lazy :V

User avatar
EvaFan
Joined: Sun Mar 21, 2004 10:25 pm
Status: (*゚▽゚)o旦~ ー乾杯ー♪
Location: Somerset, KY
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by EvaFan » Fri Jan 21, 2011 2:31 am

Mister Hatt wrote:I should really stop being so lazy :V
Actually you could just make a simple link guide to where people can go to best read/learn. :beer:
"The people cannot be [...] always, well informed. The part which is wrong will be discontented, in proportion to [...] the facts they misconceive. If they remain quiet under such misconceptions, it is lethargy, the forerunner of death to public liberty. What country can preserve its liberties, if it's rulers are not warned [...] that this people preserve the spirit of resistance? The tree of liberty must be refreshed from time to time, with the blood of patriots and tyrants."-Thomas Jefferson

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Going Out Of My Mind Trying To Make This Footage Look Go

Post by mirkosp » Fri Jan 21, 2011 5:47 am

EvaFan wrote:
Mister Hatt wrote:I should really stop being so lazy :V
Actually you could just make a simple link guide to where people can go to best read/learn. :beer:
That's the problem. There is none yet... people learn on IRC+on their own, mostly...
Image

Locked

Return to “AviSynth Help”