Cycles noise reduction with VapourSynth

ehm virtualdub has a few temperal noise filters (noise per frame), is that what your using here ?
its very easy to use.

Yes, I saw that virtualdub have that kind of noise reduction, but I use Linux. Could you do some tests to compare? I put a scene in my previous message.

Could you render the movie as AVI with jpg enocding ?.
The virtualdub version i use doesnt work with mpg encoding.
You can PM /Mail me here to send the avi with yousendit / dropbox / ā€¦
Then iā€™ll do some virtualdubbing with it.

Isnā€™t the idea to use an uncompressed image sequence?

Yes, it would be better that the tests be made from lossless source.
@Razorblade , I can generate a FFV1 lossless video in avi container from the png files. Seem that VirtualDub support this format:

Anyway, my upload bandwidth is bad and unstable. Iā€™ll PM you if I can upload the video (it will have around 100MB to 200MB)

Hello all
How about coding blender-vapoursynth-blender addon?
Can anyone do that? It will be much better than any other denoising tools!

Ok well, I used blender to open the MPG file and saved it as AVI using jpg encoding.
Sometimes i forget how good Blender is in video editing :))

First of all there are a lot of methods to denoise something in virtualdub.
Here one can find filters : http://rationalqm.us/hosted.html
And here is a larger list of filters : http://www.infognition.com/VirtualDubFilters/
I mostly use virtualdubā€™s Deshaker filter, as its better then most deshakers (but it can be complex to configure). And i often make the final video compression using virtualdub when the whole project is (near) uncompressed video.

To denoise the movie I used the folowing filters in the folowing order :

2D cleaner v0.9 ( http://rationalqm.us/2dcleaner.html )

  • settings :
    blending treshold 20
    radi around source pixel X= 4 and Y= 4

MSU denoiser 2.5.1 ( http://www.compression.ru/video/denoising/index_en.html )
-settings :
automatic MSU
algorythm MSU Denoiser
use GPU
disabled automatic noise estimation
disabled carefull scene change processing
under advanced button noise estimation every 10th frame
Temporal denoising (Harder) set to 100
Spatial denoising (softer) set to 22

Here is the movie i rendered using above, its only 10Mb slightly larger then original.
I could have made it smaller using more compression **
movie link : https://www.dropbox.com/s/z338himaxa0k18c/VirtualDub-orig0001-0150.avi?dl=0

The result has artifacts visible when pauzing the movie, a bit like the ones when we want to render motion blur in blender.
Okay motion blur is better, sure. But on normal speed they are hard to see.

Film was encoded in x264vfw-H.264 AVC codec > a more recent version then i had is here ( http://sourceforge.net/projects/x264vfw/ )
You might checkout the Doom forums, or some virtualdub blogger on how to set it up if it doesnt work.
Or get some package with virtualdub and tons of codecs/ filters
Only 10MB movie output, with settings :
optimized for Animation, using Single pass quantizer (CQP) with Quantizer set to 2 (ea high quality)
without enforced keyframes.

** => which in some situation also helps denoising, ea noise is random thus lots of data> compression takes main ā€˜dataā€™ removing some noise

Ok well, I used blender to open the MPG file and saved it as AVI using jpg encoding.
Sometimes i forget how good Blender is in video editing :))

First of all there are a lot of methods to denoise something in virtualdub.
Here one can find filters : http://rationalqm.us/hosted.html
And here is a larger list of filters : http://www.infognition.com/VirtualDubFilters/
I mostly use virtualdubā€™s Deshaker filter, as its better then most deshakers (but it can be complex to configure).

To denoise the movie I used the folowing filters in the folowing order :

2D cleaner v0.9 ( http://rationalqm.us/2dcleaner.html )

  • settings :
    blending treshold 20
    radi around source pixel X= 4 and Y= 4

MSU denoiser 2.5.1 ( http://www.compression.ru/video/denoising/index_en.html )
-settings :
automatic MSU
algorythm MSU Denoiser
use GPU
disabled automatic noise estimation
disabled carefull scene change processing
under advanced button noise estimation every 10th frame
Temporal denoising (Harder) set to 100
Spatial denoising (softer) set to 22

Here is the movie i rendered using above, its only 10Mb slightly larger then original.
I could have made it smaller using more compression **
movie link : https://www.dropbox.com/s/z338himaxa0k18c/VirtualDub-orig0001-0150.avi?dl=0
The whole denoising went pretty fast.

The result has artifacts visible when pauzing the movie, a bit like the ones when we want to render motion blur in blender.
Okay motion blur is better, sure. But on normal speed they are hard to see.

Film was encoded in x264vfw-H.264 AVC codec > a more recent version then i had is here ( http://sourceforge.net/projects/x264vfw/ )
You might checkout the Doom forums, or some virtualdub blogger on how to set it up if it doesnt work.
Or get some package with virtualdub and tons of codecs/ filters
Only 10MB movie output, with settings :
optimized for Animation, using Single pass quantizer (CQP) with Quantizer set to 2 (ea high quality)
without enforced keyframes.

** => which in some situation also helps denoising, ea noise is random thus lots of data> compression takes main ā€˜dataā€™ removing some noise


If your on linux and use Wine, virtualdub might work / or notā€¦ people report different results about that.

A third party vapoursynth addon for Blender would be great. But I think it would be better if Blender 3D officialy incorporated a self noise reduction system independently of those third-party VapourSynth filters/plugins. There are VapourSynth filters that have bugs, some in developing, others that are no longer maintained. Blender can not be dependent on those circumstances.

@Razorblade, What you used as source video? some of the videos I uploaded? Or did you make the render with the file I had uploaded to doom9 forum? Weird things are seen in this video from VirtualDub, like this ghosting effect.
Here I uploaded the lossless video from PNGs. See if you can open it in VirtualDub:

Well, with the tests Iā€™ve done for now I have seen good results with VapourSynth noise reduction. Perhaps a more realistic and practical situation would be not use so little samples as extreme examples we are using here. The problem I noticed is that different materials in the scene may have very different levels of noise. So I guess it would be better to separate objects in layers according to the materials, to apply different levels of noise reduction and then composing. Iā€™ve never done this so I do not know how it would be the result.

PS: I had tried VirtualDub with Wine time ago, is a pain. And really, I do not need it for now.

As source i used orig seq https://dl.dropboxusercontent.com/u/ā€¦files/orig.mp4 from BrotherMechanic.
When he posted about
superF1 = core.generic.GBlur(input, 1.0)

Now i used both movies, (had to export it again to AVI-jpg, codec was not suported).

The weird things originate from MSU filter on most extreme temporal setting.
MSU did good in balancing it a bit more out (low noise variations), of the cost of delayed blur like artifacts.
I make another attempt with your fileā€¦ i report soon, but will try some other filters settings too.

I see in your new video you use a texture on the white balls, can you upload a denoised movie of that since that is pretty hard to denoise if the balls move. (a filter would likely be unable to know what previous texture area was where in the previous frame.) only if a denoiser was inside blender during rendering such info could be used in denoising, and soā€¦ this test is a bit harderā€¦

Well despite those consā€¦ i did found a noise filter which pretty easy to use (by now i tested a lot of them(trial error)). And came to find Donald Grafts Smart Smoother pretty fast and nice

settings
-diamter 9 pixels
-treshold 161

  • no banding effects
  • no artifects
  • low noise rumble still there a little.
  • quite powerfull, and not as CPU hungry (or GPU) as some more super advanced filters
    ? It seams slightly smoothed on sharp edges of cube; but this is denoise in action.
    One could add a sharpening to get sharpiness back there (but there are lots of these kind of filters to).

If some developers are reading this, perhaps try to contact the original developer.
Source code, and the filter itself are here : http://rationalqm.us/smooth.html
(apperantly it was used there also to optimize cartoon animations).
He created lots of free filters for virtualdub, and this one is pretty close to i think what we want.
Givven that this filter was not even optimized to do cycles noise, but rather normal real video noise.

Iā€™ll either use this one now, or MSU (i dont mind MSUā€™s artifacts that look like blur)
The 2Dfilter was good too, but it couldnt get all the noise out.
2Dcleaner depending on taste could remove that loww rumble noise, and add sharpness.
But no time now to find an ideal mix of smart shooter and 2D cleanerā€¦ needs more of my time.

My result : https://dl.dropboxusercontent.com/u/54767531/SmarthSmootherVirtualDub-orig0001-0250.avi

// i also tested Alpary Soft Denoise, (with logo in screen unregistred) for about a hour
// but that one did extreme denoise with banding super sharp, but with litle artifects.
// In the i did not render it as movie

Just wondering how hair would denoise ā€¦ its probaply harder to denoise.

As I had mentioned in message #60 I added a Checker Texture in the spheres to better detect distortions in video (as happens with ā€œhard-denoise.vpyā€ in post #47)
ā€œKNLMeansCLā€ is one of the plugins ā€œhard-denoise.vpyā€ script uses, and it had a problem which distortions generated in the borders of the video. I have reported and ā€œKNLMeansCLā€ in GitHub is supposedly fixed now (Thanks to the devel Khanattila). You note that ā€œKNLMeansCLā€ uses OpenCL.
So this is the video using ā€œhard-denoise.vpyā€ script with some minor changes in values, KNLMeansCL from git:

*Original Video:

*Denoised:

*Script:
http://www.pasteall.org/61303

So, ā€œhard-denoiseā€ script delivers an output with minimal banding and hard noise reduction.
In this video I used more images because in the lossless ā€œaviā€ I uploaded early I used less images to save size. But this video is at 30 fps because I donā€™t know yet how to get 24 fps output with vapoursinth, and I do not want to use PNG as output because it modifies slightly the original colors.

Also note that this hard-denoise script may be too strong for other materials with small details textures and it could remove detail on those materials/textures. Thatā€™s why I think it necessary to apply different levels of noise reduction according to the materials, but honestly I have no idea how to do it and if this could have problems with the alpha channel and edges.

@Razorblade. Your video from VirtualDub is more or less the same bitrate than mine, and I do not see it as good as those obtained with VapourSynth. I can really see some banding and the result is somewhat blurry. You try to register to some VirtualDub forum and you ask how you could improve the result. You mention there that you are trying to reduce noise to images obtained from Ray Tracing render engine, maybe they know some better settings.

The videos are comparable in quality, your video was done in a larger in dimensions.
I based it on your source that you posted in 960x 540, your new video is 1280x738 (not all filters work on this non standard sizes).
It seams the cubes in my video are slightly sharper edged, and are slightly less averaged (more transparency vs large area with averaged color). (im comparing my time 0:08 and your 0:03), more obvious is sharpens in front cube, and see trough in back cube.
The 2D filter could remove sharpiness and see trough to get it more like yours
And there is still a bit low rumble noise in my video the 2D filter can reduce, iā€™ve used virtualdub for many years now and its often about finding the right mix of filters for a certain scenario (best result in shortest time), much like well in this threat.

But the banding is strange, i dont see it in the red area in my version, but i do see it in your last upload in the red area.
I think a differences in monitor calibration and or codec and decoder effect?. (probaply the latest i think).

Maybe improve the test video, to include finer details, and maybe something with moving hair, and grass, i will experiment more on denoising too. ā€¦Perhaps put a slightly noisy photo of a poster in the back (will it maintain such noice in the movie on static objects?)

Iā€™ll keep you updated, or should i post in another thread perhaps. It would be pretty if your version would work for all operating systems and is simple to install.

You know I once chatted with one developer Lucas, and well they know the denoising at tile rendering could be a better way to reduce noise (then there is much more data available to let a noise filter work with), ea it knows textures / surfaces light orientation etc. these things are not known in a final result (what meshdata it originally originated from, that data isnt available in a 2d picture, or 2d+time movie. Good denoisers can do a lot on movies, but dont have acces to such data yet. In a sense Adaptive Sampler version was an early tryal in that direction i think.

Besides that i think it would be nice if blender had denosing inside compositor and as effect strips in sequencer.

Hi. The lossless avi I had uploaded is 1280x720. Perhaps a problem with VirtualDub?. You open the video in some player or other program and you see video info.
The other videos I uploaded are also 1280x720.

PS: I had set my player to open videos in full screen and I had not realized that your video had lower size.

ow crap, thats because i extended the original movie with your new movie so it took dimensions from the first oneā€¦ my fault

Yaā€™ll might want to try this:
https://www.neatvideo.com/examples.html

Hello Guys!

I finally managed to setup the whole VapourSynth Denoising under Linux Manjaro! It was quite difficult for me as Iā€™m rather new to linux. So I thought Iā€™ll share what I found out, in case some one else has the same problems. Maybe it even helps for other distros.

So what do we need?

Basically we need VapourSynth, the VapourSynth Editor (vsedit) and a bunch of Plugins for VapourSynth.

The problem is that those Plugins are not included/installed by default. At least if there is no preconfigured package for your distro like the one ā€˜djcjā€™ offers for Ubuntu (https://launchpad.net/~djcj/+archive/ubuntu/vapoursynth)

So, how do we get everything to work under Manjaro?

First check if python 3.5 is installed. That should be no problem as Manjaro is a rolling release. You can check that with the package manager (pacman).

For all the next steps be sure that ā€œSearch in AURā€ (AUR - Arch User Repository) is activated, as we are going to use a lot of packages that are not included in the official repositories.

Now install ā€œvapoursynthā€ and ā€œvapoursynth-editorā€.

If we now try to run the scripts provided by brothermechanic and YAFU, VapourSynth will throw an error complaining about an unknown Plugin named ā€œimwriā€. This imwri problem has been addressed in some posts before. Imwri is a plugin to read image sequences in VapourSynth. But by default itā€™s NOT included in the builds/installations. However, it IS included in the source code. So to get it working, you have to build VapourSynth on your own.

But in order to build VapourSynth with imwri we first need to install following packages with pacman:
cython, yasm, image magick

Then go to https://github.com/vapoursynth/vapoursynth/releases and download the source code. Extract the zip. The start your terminal:
navigate with the ā€œcdā€ command to the extracted folder. Then
$ sh autogen.sh

$ sh configure ā€“ help (this one is optional. Just in case you want to see more possibilities to configure the build)

$ sh configure --enable-imwri (this will force to build the imwri plugin)

$ make
$ sudo make install

ā€œ$make installā€ will install the build resulting from $make. As $make install threw an error I tried it with sudo and it worked. BUT I think it installs it in some wrong directory, as I found out, that the VSEditor wonā€™t start up with just this version of VapourSynth installed. Thatā€™s why I wrote before, that you have to install the vapoursynth from pacman. Maybe I did something wrong with the installation. As I said, Iā€™m pretty new to Linux.
Anyway, to solve the imwri problem you now have to copy the manually builded ā€œlibimwri.soā€ file from ā€œ/usr/local/lib/vapoursynth/libimwri.soā€ to the folder which belongs to the vapoursynth package from pacman: ā€œ/usr/lib/vapoursynth/ā€

Now we just have to install/build the rest of the needed plugins via pacman:

vapoursynth-plugin-mvtools
vapoursynth-plugin-fft3dfilter-git
vapoursynth-plugin-fmtconv
vapoursynth-plugin-mvtools
vapoursynth-plugin-knlmeanscl

And voila, you are done! Happy denoising!

Btw, if you want you can build the VapourSynth Editor manually. Download the repository here: https://bitbucket.org/mystery_keeper/vapoursynth-editor/downloads
Start your terminal, navigate with the ā€œcdā€ command to the ā€œproā€ directory of that repository an do the following:
$ qmake
$ make
This will build everything and places the executable in a freshly created ā€œbuildā€ directory. As this is a QT Project, you will have to have QT installed in order to build it.

I hope this post helps you guys to get it working with less frustration then I had in this process.
Cheers,
Johannes

Me again! Now that everything is running fine, I have a few questions:

How can I process the whole ImageSequence at once? I mean the script processes only the current frame of the preview (f5)ā€¦
I want to be able to run ONE command to denoise all the pictures in the source folder and save all the resulting images to the destination folder.

@YAFU Did you find any solution for the color change occuring when saving as png? Would it be possible to use an uncompressed AVI as output, or is there a color change, too? And if it is possible, how do I have to set it up, so that it renders an uncompressed AVI?

Thanks in advance!

any solution tutorial for windows? Thanks

Hi.
I have not experimented much with PNG as output.
For lossless video you try ā€œffv1ā€ with ffmpeg:

From the terimal you can use (Open the terminal at the same location where you have the script.vpy):

vspipe --y4m script.vpy - | ffmpeg -i pipe: -c:v ffv1 -an ffv1_output.avi