Denoising Addon for Blender: script generator for avisynth or virtualdub


(Mobiledeveloper) #1

Hi,

I have made an addon for the Blender that will generate AviSynth script and do some additional stuff. In advance, I would like to sorry for my English ;/.

This is a small part of the script “film restoration script by videoFreed” (I’m very thankful to him for his script)

Current version restrictions:

  1. animation frame must have width and height divided by 2 - for an example 2, 4, 6, 8 and so on (another example ok resolution will be 1280x720, but neither 1279x720 nor 1280x719)

  2. the plugin may not work on Linux or other systems than windows (I have only tried on windows)

  3. rendering output have to be one of the following:
    a) “AVI_RAW” (this is preferred option),

b) “FFmpeg video” - AVI container with codec H.264 and lossless quality (I haven’t tried to use other quality options),

c) PNG (require an FFMPEG installed, but all frames will be connected to AVI file and then it will be processed as input for denoising,

Plans for the future:

  • get selected preview frames in the Blender “render result” window,
  • more filtering options.

How to use:
-Download and install addon in the Blender,

you can download addon here

https://dl.dropboxusercontent.com/u/26042452/avi/avisynch_script_generator.py

and now the project has an official page on bitbucket

https://bitbucket.org/stefan_wyszynski/blender_addon_denoising_script/src

download additional software

[TABLE=“class: grid, width: 500, align: center”]

program
download link
Add program paths to “path” environment variable

for example

Avisynth


C:\AviSynth
C:\AviSynth\plugins

DOWNLOAD plugins and copy to Avisynth\plugins dir
https://www.dropbox.com/s/xcgvdvqy1e7i2df/plugins.zip?dl=0

Download Virtualdub (used by script to convert video if you want to)


C:\VirtualDub-1.10.4

Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)

Needed for some plugins
https://www.microsoft.com/en-us/download/details.aspx?id=8328

[/TABLE]

ADITIONAL SOFTWARE HELPFULL BUT NOT REALLY NEEDED (addon will work without it, but it won’t be fully functional)

[TABLE=“class: grid, width: 500, align: center”]

program
download link
Add program paths to “path” environment variable

for example

avsPmod (used by script to display video preview end edit script)


C:\AvsPmod_v2.5.1\AvsPmod
C:\AvsPmod_v2.5.1\AvsPmod ools

FFmpeg (used by script to automatically convert input video to output - if you want to)
https://ffmpeg.zeranoe.com/builds/
C:\ffmpeg-3.2.2-win32\bin

k-lite codecs pack (helpfull codecs needed for many things )
https://www.codecguide.com/download_kl.htm

[/TABLE]

If you won’t download avsPmod you can’t generate movies by it, same as FFmpeg. But you can use VirtualDub which was recommended for downloading. K-lite codecs pack will be useful if I extend plugin functionality to use another kind of input than AVI_RAW

PLUGINS USED BY SCRIPT (you don’t have to download it. This is only for information purposes)

[TABLE=“class: grid, width: 500, align: center”]

MvTools plugins for AviSynth
http://avisynth.nl/index.php/MVTools

SmartSmootherHQ plugin for AviSynth
http://rationalqm.us/hiq/smoothhiq.html

Script is inspired by film restoration script by videoFreed so it uses this:
https://forum.doom9.org/showthread.php?t=144271

[/TABLE]

if you still can’t run denoising script then you could additionally download

Hybrid:
http://www.selur.de/downloads
and you don’t have to install this but just open this exe as a zip archive and copy AviSynth plugins from it to Avisynth\plugins folder

=====================================================================

How to use in the blender:

then you can change some denoising setting and click generate a script

The script will be generated with a name as the avi animation file and extension .avs .

there is a combo box “Run script with” with option how the script will be run.

So you can generate the script and:

  • open it with VirtualDub (to make/preview a final movie),
  • open it with avsPmod and edit/preview changes,
  • generate final raw avi movie from input by using FFmpeg,
  • generate final raw avi movie from input by using avs2avi

Finally. As you can see in the screens. There are two methods (known by me) for a good denoising,

first one: render 8 samples (or more if you want to) with compositor filtering node setup (I have given a blender setup scene in dropbox folder - download if you want), and then use denoising script

this method is a base but there will be more blurry result than if you use the second method.

the second one method of denoising: download Lucas denoising build. Render 8 sample (or more) animation with his denoising method and then denoise with script (addon)

To get the best denoising result in animation you could use modified blender version with LWR denoiser from lukasstockner97 as a base for denoising script

https://blenderartists.org/forum/showthread.php?395313-Experimental-2-77-Cycles-Denoising-build/page47

compare the screens attached to the thread and you will know what is best.

you can download example movies from my dropbox folder

but please !! don’t watch it online - you won’t see any difference in videos - because of strange filtering in dropbox video preview encoding algorithm

edit: new version available (link is the same - plugins.zip on my dropbox is updated too)

  • Added deflicker,
  • added dirt remover,
  • added stabilization (but currently it’s less useful)

anyway, this version gives better quality because of this changes.

I have tried to denoise new test scene and old script gives weak result so I have added more functionality from the base “Film restoration script by videoFreed”

here is a Gif generated from the result video comparison

https://dl.dropboxusercontent.com/u/…ndAvisynth.gif

Attachments





(tjindy) #2

Kiepski czas na testowanie :smiley:
This addon is very promising. Waitin for someone tests :slight_smile:

All the best and Happy Nowego Year!


(Mobiledeveloper) #3

Thanks :slight_smile: (nom kiepski czas :). Wczoraj zrobilem i chcialem dzis przed sylwestrem wrzucic :slight_smile: )

I would like to add denoising preview and other kinds. But currently, I don’t know how to extract animation frame using denoising script and load it to “render result” in the blender or any other place to just preview denoising result :). I will think about that. There are a lot of places in the addon that need to be improved :).


(karab44) #4

The addon looks promising :slight_smile:

Happy New Year!

Best Regards!
Albert


(Mobiledeveloper) #5

thanks :).

I have to add more denoising methods.

Happy New Year! :slight_smile:


(BigBlend) #6

Looks very promising. I’ll try to try it :slight_smile:


(BigBlend) #7

I’m sorry. This is a bit of a hassle to make. If I had an animation to do then I would gladly do this.

I wish there was one button solution to install this. Sorry, I’m that lazy :frowning:


(Mobiledeveloper) #8

I would like to add one click solution but I don’t know if I will break any license by uploading AviSynth plugins or any needed software in one bundle :/.


(YAFU) #9

Hello, I have seen that you had posted a message in VapourSynth thread, anyway I ask you: Do you think you could translate your Avisynth filters to VapourSynth?. VapourSynth is OpenSoure and cross-platform. For GUI, there is some experimental method out there that allows Avidemux to run VapourSynth scripts.


(BigBlend) #10

Avisynth is GPLv2. Unless you edit the source code you can distribute it in any way or form.

Edit: Found the license for that plugin:

/*
Smart Smoother Filter for VirtualDub – performs structure
retaining noise reduction/smoothing.
Copyright © 1999-2000 Donald A. Graft

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.


This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.


You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


The author can be contacted at:
Donald Graft
[EMAIL="[email protected]"][email protected][/EMAIL].

*/

You’re good to go :slight_smile:


(Mobiledeveloper) #11

I have modified the first post description because I have forgotten to add an important thing. That script is inspired by “film restoration script by videoFreed”

so you will need plugins that videoFreed script uses:

https://forum.doom9.org/showthread.php?t=144271

so download the zip and copy plugins dlls to AviSynth plugins folder.

@YAFU: I will try but I am a newbie in scripting. I have seen your conversation in vapoursynth thread but I could not initialize vapoursynth environment in my Windows so I gave up and tried another way. I have tried Avisynth with success.

This addon was started 3 days ago, so if I find a little time then I will try to improve it.

Anyway

@bigbad thanks for the help but there are multiple scripts. One dll could need others related. I don’t really know for sure what files are exactly needed by scripts.

But I have updated the description with the link to needed DLLs. Now this should work.

Basically. Just download AviSynth and install C:\avisynth
download hybrid.exe (look at the first post) and open this exe with zip explorer. then copy AviSynth plugins *.dlls from this exe archive to C:\avisynth\plugins

next download the mentioned videoFreed script zip which contains additional AviSynth plugins dlls (search dlls in this zip). So copy this DLLs to C:\avisynth\plugins

now scripting should work but if you want to use smart smoother (this option is changeable in the plugin in the blender) then you should download additional smart smoother HQ dll plugin and avs script (I have described it in the first post).

Of course, you should download VirtualDub and set environment variables (as I described in the first post) however the plugin download is the base think.

You don’t have to download avsPmod, avs2avi, FFmpeg, or k-lite codec pack, so configuration could be simpler, but if you want the full functionality of the plugin then you can download.

I will try to simplify the process (if I find a time) but for now, it’s hard to setup :confused:


(Mobiledeveloper) #12

there is a new version. Now you can add auto resize on the final stage.

And I want to sorry because there was a python error in the plugin for some time (because of code formatting - I am not the python developer and I didn’t expect such kind of errors :slight_smile: ). Anyway here is a new version:

https://dl.dropboxusercontent.com/u/26042452/avi/avisynch_script_generator.py

I am looking for free auto configuration and installation software that could help or automate configuration process


(Mobiledeveloper) #13

I have added all needed AviSynth plugins

https://dl.dropboxusercontent.com/u/26042452/avi/plugins.zip

So if someone has problems with plugins this can resolve all problems. Now just install AviSynth add plugins from this zip and add the avisynth\plugins folder to environment path variable.

If there will be any problems then let me know.

if someone manages to run the script - then let me know :).

edit: I have rewritten the first post. Now it will be much easier to configure and use everything.


(Mobiledeveloper) #14

I would like to announce the new version of the blender denoise addon.

you can download addon here https://dl.dropboxusercontent.com/u/...t_generator.py

  • Added deflicker,
  • added dirt remover,
  • added stabilization (but currently it’s less useful)

anyway, this version gives much better quality because of this changes.

I have tried to denoise new test scene and old script gives weak result so I have added more functionality from the base “Film restoration script by videoFreed”

here is a Gif generated from the result video comparison

https://dl.dropboxusercontent.com/u/26042452/avi/lucasDenoiserAndAvisynth.gif

Download gif because it takes a long time to load it. Of course, there is a video which is a source of this gif but it takes more time to download) - it is on my dropbox (see the first post). I hope someone will finally manage to run and test the plugin. https://blenderartists.org/forum/images/smilies/sago/smile.gif

aaa I have added some plugin dlls to plugins zip. Dowload it from my dropbox (see the first post)


(Mobiledeveloper) #15

Project is now on bitbucket

https://bitbucket.org/stefan_wyszynski/blender_addon_denoising_script/src/

I will write posts less frequently. I hope someone will use this project.


(burnin) #16

nice work…
now am just hoping for some spare time to give it a spin along with the experimental build

BTW
your Dropbox link is corrupt: Error (404)
maybe happened, after editing the post
bitbucket works

thanks, for everything


(Mobiledeveloper) #17

burnin: thank you very much :).

About the links. Yes, I noticed this today. it’s because I have edited the post (maybe my English grammar checker (grammarly) is breaking links)

I have added some links again. If you will use any link and it still doesn’t work then let me know :).

Anyway here is the main dropbox folder:


(3dcal) #18

Mobiledeveloper,
thanks very much for the addon and this thread.
I will try it as soon as possible with Lukas Stockner’s Denoise 2.77 Build, and post images and/or videos.

BTW, your English is very good. :wink:


(juang3d) #19

Indeed! Thanks for this, I have to study it but if crossframe denoising does not arrive in 2.79 this will be very useful! :slight_smile:

Thanks!


(Mobiledeveloper) #20

Thank you :)!.

I hope you will manage to run this addon. If you will have any problems you can ask for help in here - I will try to help. Anyway, I will be happy to see the results :).