Log in

View Full Version : Mainconcept prefilters


fjdogar
11th July 2010, 12:43
Hi , i have noticed that when i encode my videos with the mainconcept AVC/h2.64 codec (from sony vegas 8) , it does a decent job on the noise reduction.

are there any avisynth or virtualdub filters that i can use to achieve similar results.

i use footage from canon hv30 , canon t2i and flip ultra hd.
i have been trying to figure out the denoising techniques from the last couple of months , trying different filters and posting on forums. but i was always told to first know what type of noise i am trying to remove. the mainconcept codec doesnt ask for any denoising settings , but it doest a good job on all type of video sources.

i really wanna learn this whole noise and denoising stuff , if you can point me to the right direction , where i can start from step 1 and not directly to step 223 which usually happens when i try google or forum posts.

onesloth
11th July 2010, 13:01
<points to 'avisynth usage' category>

LoRd_MuldeR
11th July 2010, 13:02
Hi , i have noticed that when i encode my videos with the mainconcept AVC/h2.64 codec (from sony vegas 8) , it does a decent job on the noise reduction.

are there any avisynth or virtualdub filters that i can use to achieve similar results.

Just to name a few: MDegrain1/2/3, FFT3DFilter, RemoveGrain, DeGrainMedian, MCTemporalDenoise, HQDN3D, FluxSmooth, etc. pp.

(Also note that x264 has a simple denoise filter built-in, available via "--nr" parameter)

onesloth
11th July 2010, 13:03
http://avisynth.org/mediawiki/External_filters#Denoisers

nm
11th July 2010, 22:33
the mainconcept codec doesnt ask for any denoising settings , but it doest a good job on all type of video sources.
So have you actually asked for any kind of noise reduction? What other encoding settings have you used?

Denoising that "just happens" is no good in general and it may be due to a number of reasons. Too low bitrate, bad encoder or bad encoding settings come to mind first.

fjdogar
11th July 2010, 23:20
Just to name a few: MDegrain1/2/3, FFT3DFilter, RemoveGrain, DeGrainMedian, MCTemporalDenoise, HQDN3D, FluxSmooth, etc. pp.

i have tried a couple of them , fft3dfilter which was very slow and created blocks , wasnt able to understand MDegrain parameters . i am going to try the others.
i have a question though , how can i find out the colorspace of my source video and does it effect the quality of the video i switch back and forth to colorspaces as often as i see in most of the scripts?

So have you actually asked for any kind of noise reduction? What other encoding settings have you used?
i m using sony vegas 8 pro to encode and the codec is MainConcept AVC codec

no there isnt any denoise option but i do check the deblocking filter.
no of reference frames to use 3.
Variable bitrate ... max: 2Mbps and min:768Kbps
Profile : Main ... theres another profile option called "baseline" , i dont know what these profiles mean for this codec
thats about it

LoRd_MuldeR
11th July 2010, 23:29
i have tried a couple of them , fft3dfilter which was very slow and created blocks , wasnt able to understand MDegrain parameters . i am going to try the others.

Try like this:

AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)


i have a question though , how can i find out the colorspace of my source video and does it effect the quality of the video i switch back and forth to colorspaces as often as i see in most of the scripts?

If your source is MPEG-2 or MPEG-4 ASP (DivX, Xvid, etc) or H.264 (x264, etc) then the color-space is YUV 4:2:0, aka YV12.

And yes, every color-space conversion causes rounding errors. Avoid unneeded conversions...

To get colorspace information at runtime, try this:

AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
Info()


no there isnt any denoise option but i do check the deblocking filter.

The deblocking filter of H.264 is something completely different!

It tries to hide "block" artifacts introduced by the H.264 compression, it does NOT (intentionally) remove any artifacts already present in your source.

I assume the denoising you are noticing is more a result of the encoder not being able to keep the noise ;)

Of course "destroying" the noise by compression is much different from a properly denoised clip! Also in many cases retaining the noise/grain is preferable anyway...


Profile : Main ... theres another profile option called "baseline" , i dont know what these profiles mean for this codec

Better inform yourself about H.264 profiles: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles

You can get significant better quality (at same bitrate) with a "High" profile capable encoder, such as x264 ;)

...given your playback device supports "High" profile, of course.

fjdogar
11th July 2010, 23:42
thanks a lot lord_mulder. i really learnt a lot from your reply. is there anyway i can use x264 with sony vegas without frameserving . one more thing do you think its a good idea to save your work with a high bitrate x264 encoded file , which would be later used to create DVDs and online videos or maybe downscaled later DV for SD broadcast ?

LoRd_MuldeR
11th July 2010, 23:46
thanks a lot lord_mulder. i really learnt a lot from your reply. is there anyway i can use x264 with sony vegas without frameserving.

If I'm not mistaken, Vergas supports VFW Codecs, doesn't it? If so, using the x264 VFW Codec may be the workaround for your:
http://komisar.gin.by/old/1666/x264vfw.1666kMod.generic.x86.exe

one more thing do you think its a good idea to save your work with a high bitrate x264 encoded file , which would be later used to create DVDs and online videos or maybe downscaled later DV for SD broadcast ?

Well, as an "intermediate" format I'd use something "lossless", rather than a lossy format. This avoids generation loss :)

One option for this is lossless H.264. And yes, x264 can created lossless H.264 streams: Just use CQP mode with QP=0. It will require a "High 4:4:4" capable H.264 decoder though!

Note that there are other lossless Codecs, such as HuffYUV, FFV1 and Lagarith.

nm
12th July 2010, 08:59
i m using sony vegas 8 pro to encode and the codec is MainConcept AVC codec

no there isnt any denoise option but i do check the deblocking filter.
no of reference frames to use 3.
Variable bitrate ... max: 2Mbps and min:768Kbps
Do you mean average 768 Kbps? Even if you're encoding 640x480/24p video, that is very low for a noisy source and it's definitely the reason for losing the noise -- and most details. You'll get much better quality overall by removing the noise properly before encoding. You should also select the two-pass encoding mode if you continue using MainConcept in Vegas.

Choosing the average bitrate depends on the video content and the target medium, but 768 Kbps is really too low for almost anything serious even after removing the noise. For high-quality encodes, 2 Mbps could be adequate for SD steadicam footage and 4-8 Mbps may be needed for high-motion and handheld shots. With x264, you can use constant quality encoding (CRF) to let the encoder decide how many bits should be used to get approximately the quality you want.

one more thing do you think its a good idea to save your work with a high bitrate x264 encoded file , which would be later used to create DVDs and online videos or maybe downscaled later DV for SD broadcast ?
If lossless is too large, a high bitrate 'mezzanine' file encoded with x264 is a good idea. People often use CRF=8..12 for this purpose.

fjdogar
13th July 2010, 06:01
Do you mean average 768 Kbps?
i dont think its average , the encoded files are really good looking . i tried encoding the file with x264 and i noticed that the noise isnt removed. i think mainconcept codec included with the vegas has some kind of noise reduction built into it .

x264 is not producing as good results as the mainconcept codec with the same bitrate settings . i am using x264vfw version with virtualdub , do u think this can be the cause of the slower encoding ? its very slow like 3-4 fps (on the medium preset) , the others presets can reach upto 6 fps but the encoded files look crappy.

nm
13th July 2010, 08:13
i dont think its average , the encoded files are really good looking .

There is no minimum bitrate setting in the dialog, as far as I can tell from screenshots (http://www.flickr.com/photos/davedugdale/4520987031/) floating on the net. The lower bitrate is the average, as it says.

Could you post sample clips? Source and the MainConcept encode.

i think mainconcept codec included with the vegas has some kind of noise reduction built into it .

I highly doubt that because denoising without asking the user would make the encoder useless in general.

LoRd_MuldeR
13th July 2010, 12:39
i tried encoding the file with x264 and i noticed that the noise isnt removed. i think mainconcept codec included with the vegas has some kind of noise reduction built into it.

What you are seeing probably are the awesome Psy-optimizations of x264, which manages to keep grain and fine detail where most of the other encoders fail and smooth out the detail ;)

Sharktooth
13th July 2010, 15:38
that's for sure. also dont confuse noise with grain, they're different. noise is just an annoying artifact not intended to be there, while grain is another story. each director chooses the film by its characteristics, including grain... so grain it is MEANT to be there. in the digital era, directors add digital grain (since there is no film involved) that is a "simulation" of the film emulsions.
remember that removing noise/grain will also need accurate filters that will preserve details. most fast/common denoising filters will destroy fine details without mercy...

pandy
13th July 2010, 16:53
Mainconcept probably use median filter then check AdaptiveMedian and mentioned already DeGrainMedian. Also if speed is really important for You - try to play with ffdshow filters

Sharktooth
13th July 2010, 18:34
as i said... accurate filters... not just median filters. those are exactly the ones destroying details...

pandy
13th July 2010, 18:52
as i said...

This is highly subjective - if someone is happy with Mainconcept median why force this someone to use something else than median?

It is almost like with question about "best" settings - there is no one universal answer for that question so...

Personally i don't like median filters, i don't like plastic looking faces washed from everything but many people expect such picture: mind&eye blowing bright, high contrast, high saturation - grass is more green than in real life, sky is more blue than in real life etc. but for many people this is "digital quality".

sorry for OT but can't resist.

Sharktooth
15th July 2010, 13:13
sorry, but that's not "digital quality"... that's "digital crap".
the idea is simple: a denoiser should remove noise... not details.
median filters destroy details... it's just not a denoiser... it's a "median"...

Didée
15th July 2010, 13:45
the idea is simple: a denoiser should remove noise... not details.
Exactly. That's the idea of what a denoiser should do.

Only problem is: There is not even one such denoiser in the world.

All de-noisers, or de-grainers, or de-whatevers, just do filter peaks in the input signal. The various filters may have different opinions which of those peaks are wished or not-wished, signal-or-noise. But there is no existing filter that magically does it all right. All of those filters will fail at some point.

And, by terminology, film grain is noise. When people say "film grain is detail", then this is wrong terminology. Grain is a random spatio-temporal fluctuation. The original scene is defined by the light that made its way through the camera lense. That's the true original, and at this point there is no grain in the signal.

A spatio-temporal fluctuation that is not present in the original scenery, but comes into play only at a later stage, must be rated as "noise", by definition.

I'm not arguing for or against grain to be removed or to be kept. (That's a personal preference, and the more videophile preference is to keep it, in most cases).

The point is that grain IS noise. If you like, you can call it a "special kind" of noise. But noise is all that it is.

Sharktooth
15th July 2010, 14:28
true, there is no perfection but still there are accurate denoising filters and gross denoising filters.
regarding the grain/noise debate i wont add much. i already explained how the human eye is limited and how it adds "grain" (yes, rods and cones inside the human eye produce a "noisy" signal and have a specific pattern etc...) to the image it is watching to...
however, if you want to look at grain as a particular kind of noise, then i will add that grain doesnt hurt and adds depth to the picture while noise is just... annoying...

fjdogar
4th August 2010, 21:02
thank you very much everybody. i really learnt a lot . i have tried fft3dfilter and i think its one of the best filters i have tried . but its extremly slow on my computer . are there any other filters which are comparable to fft3dfilter in results but a bit faster ?

my notebook is 1.73 ghz with 1 gb ram.
i am getting 1-2 fps on hd 1080p material with fft3dfilter

Gser
4th August 2010, 21:58
thank you very much everybody. i really learnt a lot . i have tried fft3dfilter and i think its one of the best filters i have tried . but its extremly slow on my computer . are there any other filters which are comparable to fft3dfilter in results but a bit faster ?

my notebook is 1.73 ghz with 1 gb ram.
i am getting 1-2 fps on hd 1080p material with fft3dfilter

fft3dGPU.

fjdogar
4th August 2010, 22:01
thanks but i have already tried it , it doesnt work on my notebook . all i see is noise. i tried degrainmedian with the maximum values and doesnt remove any noise at all , any idea ? i am trying it on hd 1080p footage

onesloth
5th August 2010, 06:22
It sounds like you might be using avisynth incorrectly. Could you briefly describe how you are using the programs that are processing your video and post the avs files you used for fft3dgpu and degrainmedian? When you use those filters with very high settings they definitely remove noise (and most detail too).

fjdogar
5th August 2010, 13:01
i cant upoad multiple video files due to my crappy internet connection which disconnects every 5 minutes . but i am attaching the frame grabs with all the filters i use and the generic avs script that i have been using.


LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dgpu.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\degrainmedian.dll")
DirectShowSource("2.mov")


#degrainmedian(limity = 255, limituv = 255)
#fft3dfilter(plane=4, bw=48 , bh=48 , bt=3 , sigma=15)
#fft3dgpu(plane=4, bw=48 , bh=48 , bt=3 , sigma=15)
sharpen(0.75)


i have been activitaing one filter at a time to create the snaps.

Source image
http://img10.imageshack.us/img10/196/sourcesb.png

degrainmedian full values
http://img192.imageshack.us/img192/9560/degrainmedian.png

fft3dfilter
http://img180.imageshack.us/img180/5425/fft3dfilter.png

fft3dgpu (i think it doesnt work because my computer' graphic card is not supported)
http://img293.imageshack.us/img293/783/fftedgpu.png

do you know any fast motion compensated noise removal filter ?

onesloth
5th August 2010, 15:22
FFT3dfilter is working. Just the sigma is way too high. Using Sigma less than 6 will probably work better. I don't know why FFT3DGPU is producing noise. I would assume it would just cause avisynth to error out if the card wasn't compatible. Did you follow the install directions from the docs. Check for compatibility there.

As far as a fast degrainer, the question is do you want it fast or do you want it good? That's a really noisy source, so likely anything faster than fft3d is still just going to kill what little detail there is. If you actually want to try to get some detail out of the mess, I would go with mdegrain with an pre-filtered analysis clip. Though, there's probably no way to tweak that process to be faster than fft3dfilter while still producing better results.

fjdogar
5th August 2010, 15:47
thanks for your help onesloth. but i wonder y degrainmedian is not working . i tried it on a less noisy source once too but it didnt work at all then too.
if i lower the sigma there is noise left , can you suggest any better filter settings ? i read the fft3dfilter readme but i dont understand the bw bh , what effect would be with the larger or smaller box , and also the overlaping .

do u think degrainmedian is not working because my noise is larger in size ?

onesloth
5th August 2010, 17:42
I haven't used degrainmedian much but the docs recommend using much smaller limit values. That could be your problem. Check out the docs for usage examples. Degrainmedian is still just at best going to give you a blurry mess with this source.

onesloth
5th August 2010, 17:45
.. Oh and sharpening is not appropriate for an image that blurry. That could very well be contributing to all the nasty artifacts in the degrainmedian example.