View Full Version : Best 'dancing grain' filter for x265?
crystalfunky
12th June 2020, 23:05
I'm looking for a good "dancing grain" filter for x265.
Since MCTemporaldenoise is not working any longer (can't get it to work on Staxrip), I tried SMDegrain, FFT3D and some other.I I like fft3d so far, but maybe you guys know better filters?
Forteen88
13th June 2020, 05:51
TemporalDegrain2(grainLevel=false)
"Temporal Degrain is a very slow, multi-stage temporal denoiser originally created for killing the dancing grain present in 300."
EDIT: Although it might degrain away real details too much on some sources (and someone here complained that it had artifacts), so be careful.
crystalfunky
13th June 2020, 08:48
I can't find it in Staxrip.
I only have removegrain with repair and mctemporaldenoise (which I don't get it to work)
Forteen88
13th June 2020, 14:23
I can't find it in Staxrip.
I only have removegrain with repair and mctemporaldenoise (which I don't get it to work)I know, I asked the StaxRip-developers to include it, but they never did.
But you can feed StaxRip an *.avs file, that you can put TemporalDegrain2 in.
crystalfunky
13th June 2020, 19:48
Thanks! How do I include the .avs file in Staxrip?
What do you use for resharpening the picture?
I used aWarpSharp2 and I think it's good.
Forteen88
13th June 2020, 20:26
Thanks! How do I include the .avs file in Staxrip?
What do you use for resharpening the picture?
I used aWarpSharp2 and I think it's good.
First install AviSynth+,
https://github.com/AviSynth/AviSynthPlus/releases
Then, in the program AvsPmod (or Notepad), you should write (and save the file as "filename.avs" (without the citationmarks), set what filename you want, but the filename should end with .avs),
LoadPlugin("C:\Program Files\AviSynthPlus\plugins64+\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynthPlus\plugins64+\masktools2.dll")
LoadPlugin("C:\Program Files\AviSynthPlus\plugins64+\mvtools2.dll")
LoadPlugin("C:\Program Files\AviSynthPlus\plugins64+\RgTools.dll")
Import("C:\Program Files\AviSynthPlus\plugins64+\TemporalDegrain-v2.2.1.avsi")
LoadPlugin("C:\Program Files\AviSynthPlus\plugins64+\LSMASHSource.dll")
LWLibavVideoSource("C:\Videos\yourvideofile.mp4", threads=1)
TemporalDegrain2(grainLevel=false)
I think that it will be enough (assuming you use that filepath for TemporalDegrain-v2.2.1.avsi), I don't think that a video-source loading-filter is needed, since Staxrip got an integrated loading-filter.
All the filters (fft3dfilter, masktools2, mvtools2, RgTools) that are needed for TemporalDegrain2 are downloadable here,
http://www.avisynth.nl/index.php/TemporalDegrain2
Extract the filter's .dll files to C:\Program Files\AviSynthPlus\plugins64+
I hear that sharpening is a bit bad for compression, so I rather use a sharpening-filter on playback. So I can't give you good advice on that.
I used to use LimitedSharpenFaster-plugin.
crystalfunky
13th June 2020, 21:47
What do I do with that file then?
Forteen88
13th June 2020, 23:13
What do I do with that file then?You right-click in StaxRip's "Source"-field, choose "Open...", then choose "Single File" and load your *.avs file there.
UPDATE: Oh, I tried my script, and it didn't work, so I added video-loading (LSMASH) in my script above now, and now it works in StaxRip.
I just read that the Staxrip-dev will integrate TemporalDegrain2 into StaxRip, but maybe it takes time for the developer to release that update.
stax76
13th June 2020, 23:35
TemporalDegrain2 is included in the next build.
The docs were updated to describe how to add custom filter profiles:
https://staxrip.readthedocs.io/usage.html#filter-profiles
The custom profile definition:
[Noise]
TemporalDegrain2 =
Import("D:\TemporalDegrain2\TemporalDegrain2.avsi")
TemporalDegrain2(degrainTR=2, postFFT=3, postSigma=3)
All dependencies are included in current version 2.1.3.0 and staxrip detects and loads them automatically.
I hope it's understandable and works.
crystalfunky
14th June 2020, 20:58
answered already in the avisynth thread.
benwaggoner
14th June 2020, 23:57
A quick and dirty option within x265 itself is the --nr-inter filter. This does an adaptive deadzone around high frequency details in predicted blocks. Net effect is that the grain texture of the IDR frame tends to be preserved throughout the GOP without it dancing around so much. It can provide some welcome ABR reduction as well, since random high frequency noise that changes every frame is quite expensive to encode. --nr-inter 500 is a good place to start, although a lower value might be better in practice depending on content and encoding settings.
If you want to get rid of noise even on IDR frames, there is also --nr-intra. But that can soften the image quite a bit, removing non-random detail as well.
crystalfunky
15th June 2020, 08:02
oh thanks, I didn't know I can use them separately, although I always got some really blurry picture with those settings. Probably as you said because of the nr-intra setting.
Will try it out and will let you know how it turns out.
I liked fft3d so far. I wish I could get temporaldegrain2 to work, but so far no luck with staxrip.
Forteen88
15th June 2020, 11:35
... I wish I could get temporaldegrain2 to work, but so far no luck with staxrip.I've confirmed that my method works for that, that I wrote above.
Tell me what error you got if that didn't work for you.
crystalfunky
15th June 2020, 21:36
Staxrip 2.1.3.1 crashes with the following error: 1 (0x1)
Unzulässige Funktion (improper function)
when I start the encoding process.
How good is FFT3d compared to TemporalDegrain2?
Forteen88
16th June 2020, 10:18
Staxrip 2.1.3.1 crashes with the following error: 1 (0x1)
Unzulässige Funktion (improper function)
when I start the encoding process.OK, it is probably wrong filepaths, or not all the required plugins are there, or not correct 64-bit version of the plugins.
IDK about FFT3d.
crystalfunky
16th June 2020, 16:11
OK, it is probably wrong filepaths, or not all the required plugins are there, or not correct 64-bit version of the plugins.
IDK about FFT3d.
The filepaths are solid, because I can encode without the filter without problems.
Staxrip is checking the plugins if they are there. So I guess if something's missing, Staxrip wouldn't even start the muxing process. The same with the 64-bit plugins. But I can be wrong of course.
Is the new staxrip version 2.1.3.1 running on your system with the TemporalDegrain2 filter enabled?
Forteen88
16th June 2020, 16:27
The filepaths are solid, because I can encode without the filter without problems.
Staxrip is checking the plugins if they are there. So I guess if something's missing, Staxrip wouldn't even start the muxing process. The same with the 64-bit plugins. But I can be wrong of course.
Is the new staxrip version 2.1.3.1 running on your system with the TemporalDegrain2 filter enabled?You can test the AVS-script in the program AvsPmod, and if you don't get a frame-window in AvsPmod when you press the F5-key on the keyboard, then you might get a more precise error-message.
No, I can't choose TemporalDegrain2 filter in Staxrip version 2.1.3.1.
EDIT: Sorry, I meant that I tested Staxrip version 2.1.3.0. That's the latest version I see at,
https://github.com/staxrip/staxrip/releases
stax76
16th June 2020, 16:29
@crystalfunky
It runs here, maybe a dependency is missing, staxrip has a detection for dependencies but it could be incomplete, maybe try this:
https://github.com/abbodi1406/vcredist
@Forteen88
If it's not in the menu then you can find it in the Profile editor in the Defaults tab.
Forteen88
16th June 2020, 17:10
@Forteen88
If it's not in the menu then you can find it in the Profile editor in the Defaults tab.My bad, I meant that I tested Staxrip version 2.1.3.0. That's the latest version I see at,
https://github.com/staxrip/staxrip/releases
stax76
16th June 2020, 18:01
My bad, I meant that I tested Staxrip version 2.1.3.0. That's the latest version I see at,
https://github.com/staxrip/staxrip/releases
It was added in 2.1.3.1 Beta:
https://github.com/staxrip/staxrip/blob/master/Changelog.md#2131-beta
Download:
https://staxrip.readthedocs.io/introduction.html#download
Forteen88
16th June 2020, 19:27
Thanks, true, TemporalDegrain2 is integrated in Staxrip 2.1.3.1 Beta. I just tried it out.
I recommend TC to try use the parameter,
TemporalDegrain2(grainLevel=false)
crystalfunky
16th June 2020, 20:20
So I included a screenshot of the error.
Sry why is this so big?
Staxrip76
I installed all the c++ and stuff from your link.
stax76
16th June 2020, 21:23
The image is big because the forum software is old, at the time it was built, 4K screens were not available or popular.
Regarding the error, the error message says unable to get data from stdin, so it's something relating the data pipe, I tried TemporalDegrain2 with avs2pipemod/x265 like you and it starts to encode.
Things you can try are:
- another piping tool, enter pipe in the search field of the encoder dialog.
- other arguments to TemporalDegrain2, start with removing all arguments.
- use VapourSynth it supports TemporalDegrain2
There are various settings you can change or simplify trying to narrow down the problem.
If the preview works and staxrip allows to create a job and encoding fails then it's not a good sign however, maybe it's an issue that is not easy to solve.
benwaggoner
16th June 2020, 22:34
oh thanks, I didn't know I can use them separately, although I always got some really blurry picture with those settings. Probably as you said because of the nr-intra setting.
Will try it out and will let you know how it turns out.
I liked fft3d so far. I wish I could get temporaldegrain2 to work, but so far no luck with staxrip.
Yeah, I generally wouldn't use --nr-intra at more than 25-50% of the --nr-inter value. And won't use it all some times.
While it's not visually the best denoising filter, it has the advantage of working inside the codec, so it results in denoising that is specifically easy to encode. Works best when IDR frames land on edits. A mid-GOP IDR can yield the grain pattern suddenly randomizing when it had been relatively static earlier.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.