Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th April 2023, 11:53   #2381  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Quote:
Originally Posted by FTLOY View Post
I also tried this, and not sure of the results, and MediaInfo still showed the BT709 of the test clip.
As I said before, it's an encoder thing. Whether it supports frameprops or not, or if it's overriding what's stated in frameprops.

If you don't have control of the whole pipeline you get things like this where it would be most useful to ask to HandBrake devs.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 13th April 2023, 12:14   #2382  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by Dogway View Post
So today I added a few options to FilmGrain+, a skin mask to lower the effect on faces, and emulsion artifact which happens on the U channel as yellow stains.
Here is a comparison, it also shows 'bump' and Path to White:
Code:
FilmGrainPlus(str=3.2,size=1.0,sharpness=0.4,mode="log",bump=0.1,skin=0.7)

Very good I like it alot! But why is the grained image so much softer/blurrier than the original?
anton_foy is offline   Reply With Quote
Old 13th April 2023, 12:39   #2383  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Yes, I knew this would come up :D

Grain is detail, and depending on the amount of grain it defines the detail of the image. I've doing my research and did a reparametrization of the blur depending on several factors like 'sharpness' and 'str' but also resolution. In the last version since I knew many would argue I converted 'preblur' to a float type, so you can type 0.5 for half the blur effect, just mind you, it would look unnatural.

Have a look at this video.

Also reading some studios apply different grain strength to faces, so I added a quick skin mask and you can lower the effect on faces with the 'skin' arg. Also looks like the red channel has typically the less grain so I added a bit more blur to the V plane.

I will now complete the presets I have samples of. I also want to optimize the LMH code block (lo, mid, hi) but kinda don't want headaches right now.
Also refactored Vignette() in GradePack, so it goes well with this for a vintage look.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 13th April 2023, 13:29   #2384  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by Dogway View Post
Yes, I knew this would come up

Grain is detail, and depending on the amount of grain it defines the detail of the image. I've doing my research and did a reparametrization of the blur depending on several factors like 'sharpness' and 'str' but also resolution. In the last version since I knew many would argue I converted 'preblur' to a float type, so you can type 0.5 for half the blur effect, just mind you, it would look unnatural.

Have a look at this video.

Also reading some studios apply different grain strength to faces, so I added a quick skin mask and you can lower the effect on faces with the 'skin' arg. Also looks like the red channel has typically the less grain so I added a bit more blur to the V plane.

I will now complete the presets I have samples of. I also want to optimize the LMH code block (lo, mid, hi) but kinda don't want headaches right now.
Also refactored Vignette() in GradePack, so it goes well with this for a vintage look.
Oh yes I am with you. This video is the Dehancer plugin, I have tried it and it is ok but some things (halation and softening mostly) is not correct IMHO. I made a script for the softening effect here in Avisynth which mimics without actually sacrificing the details. Merely softens instead of blur them away. Can post it for demonstration.
Been scanning 35 and 16mm film for years and there is usually more details than what is shown in the dehancer video but it depends on the scanner alot. Used first Spirit 2k then Scanity (up to 4k+).

Edit: btw. up and running again so tonight I will upload the grain-scans to you.
anton_foy is offline   Reply With Quote
Old 13th April 2023, 13:32   #2385  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 124
@ Dogway,

Can you please comment to my earlier question (in the Red text)

post1985770

Last edited by FTLOY; 13th April 2023 at 13:45.
FTLOY is offline   Reply With Quote
Old 13th April 2023, 13:54   #2386  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Quote:
Originally Posted by FTLOY View Post
Would adding this be of any benefit ??

Code:
- gpu_thread\
    Thread count for interpolation.\
    Using larger values may increase GPU usage and consume more GPU memory. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.\
    Default: 2.
You can try several things if you look into the original plugin repo.
For example skip=true, but as it says it requires the VMFA plugin, and maybe raising gpu_thread, default for HD is 4, maybe try with 6 or 8 but I don't recall it making a change...

Quote:
Originally Posted by anton_foy View Post
I made a script for the softening effect here in Avisynth which mimics without actually sacrificing the details. Merely softens instead of blur them away. Can post it for demonstration.
Yes please, I have no hands on experience on this, just digital. I could use ex_unsharp to blur other frequencies so it has more like a dreamy look and not a plain blur as you state. Maybe, I'm not sure, I could try to calculate standard deviation of the grain and then pass that to the blur so it's more accurate so to speak instead of a visual setting.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 13th April 2023 at 13:57.
Dogway is offline   Reply With Quote
Old 13th April 2023, 14:09   #2387  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 124
Quote:
Originally Posted by Dogway View Post
You can try several things if you look into the original plugin repo.
For example skip=true, but as it says it requires the VMFA plugin, and maybe raising gpu_thread, default for HD is 4, maybe try with 6 or 8 but I don't recall it making a change...
OK, but is gpu_thread something that might need to be enabled in your wrapper, like the rife-UHD the other day ??

I added it the call, and it said it could find it...
FTLOY is offline   Reply With Quote
Old 13th April 2023, 14:48   #2388  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
gpu_thread is not exposed, I'm not sure what it does exactly because I didn't get better performance for HD above 4 threads on my card, so YMMV, that's why.
Try different values and see what works for you.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 13th April 2023, 14:57   #2389  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 124
Quote:
Originally Posted by Dogway View Post
gpu_thread is not exposed, I'm not sure what it does exactly because I didn't get better performance for HD above 4 threads on my card, so YMMV, that's why.
Try different values and see what works for you.
I'm confused, how do I use it then ??

Were you using 4K video, and your GTX 1070 probably hasn't got much vram (unless you've updated recently)
FTLOY is offline   Reply With Quote
Old 13th April 2023, 15:20   #2390  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
The 1070 has 8Gb, it's ngreedia who hasn't updated recently, well yeah, you can get a 4070 for the price of a xx80.

I meant it's not exposed in RIFEwrap, but simply look into the function and edit the argument and change here the gpu threads you want.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 13th April 2023, 15:33   #2391  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 124
Quote:
Originally Posted by Dogway View Post
The 1070 has 8Gb, it's ngreedia who hasn't updated recently, well yeah, you can get a 4070 for the price of a xx80.

I meant it's not exposed in RIFEwrap, but simply look into the function and edit the argument and change here the gpu threads you want.
Wouldn't have a clue what to do with this...

Code:
gpu_thread=isHD ? 4 : 2
Would it be gpu_thread=2 (or 4) ??

I think I might have mentioned this before, I just don't understand "code", it's just letters & numbers to me
FTLOY is offline   Reply With Quote
Old 13th April 2023, 21:27   #2392  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
I must say that you made an amazing effort and the results are GREAT with filmgrain+! Trying to figure out your script as I go home from work here on the subway, how is vstcanny actually meant to be used here? The red channel may be faster reduced by just a simple merge call? Just a thought. It is very realistic looking and a very thougth through script. Await one hour and I will upload the scans
anton_foy is offline   Reply With Quote
Old 13th April 2023, 21:56   #2393  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
I'm currently dealing with the blue/red channel and trying a few things.
I already ported 5248 which is/was a famous stock and also 5279.

What happens is what's described in the charts but at a higher level, blue channel (U plane roughly in this case) is VERY noisy while the red channel is remnant, barely noisy.

Doing things now by plane complicates matters and I'm not sure the results are quite there since we are working in YUV and more importantly, the grain is now decorrelated so we lose the nice white spots/grains.

I think I will leave chroma grain as it is, unless you are inspecting on a grey plate chroma grain is barely noticeable, less so with path to white.

On the vstcanny line, I use it for gaussian blur, the filter was designed for TCanny edge detection but its mode=-1 (gaussian blur) is actually the more performant gaussian blur you can find in AVS+ if you omit removegrain(12) for a gaussian blur of 0.707 and ex_gaussianblur() for big sigmas. The expression in it is only layered expressions, it's not a multi-regression or anything, I tried to plot it in 3D yesterday without success.

The core concept of the filter is replicating grain behaviour on the visual system, by integrating it, that is the lower the 'size' the higher resolution the original grain plate is, then I downscale. Probably this, along 'log' space and the Path to White is what makes it work, preblurring also though.

I'll have a look at your samples tomorrow and implement them.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Old 14th April 2023, 00:27   #2394  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Here is my soft "hack", it may be tweaked for different resolutions etc. but a base of what I use.

Code:
u=last

#Soften
blr = ex_expand(mode="disk",thres=120).removegrain(20).ex_levels(0,0.96,255)
merge(u.sharpen(0.2),blr, 0.52)

interleave(u,last)
Edit: I could not find the script I used before that was much more complex so hacked this together yesterday from memory. Also did you get my PM Dogway? A little bit of a mess of files but maybe first look into "imsc" folder.

Last edited by anton_foy; 14th April 2023 at 11:18.
anton_foy is offline   Reply With Quote
Old 14th April 2023, 01:01   #2395  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 124
Remove Color Banding..

Could someone recommend a good filter to remove color banding.?

For removing (or improving at least) the banding you get in foggy, dark or some underwater scenes.
FTLOY is offline   Reply With Quote
Old 14th April 2023, 12:26   #2396  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Quote:
Originally Posted by anton_foy View Post
Edit: I could not find the script I used before that was much more complex so hacked this together yesterday from memory. Also did you get my PM Dogway? A little bit of a mess of files but maybe first look into "imsc" folder.
Yes thank you! Just downloaded and was sorting the names. Only checked a few of thems but I think you got 2 "Eterna Vivid 8543 160T" samples and 2 "Eterna 8563 250D" samples (the one called ET250D_GR), I see they are samples for shooting with an exposure fade, so only a few frames are useful where exposure is balanced, also there's a big cast to green, so not sure I can pull chroma grain detail from there but I think it will come useful anyways. Most are Fuji and among the Kodaks all are already done except 5201 and 5212, 5205 is not in my list maybe cause it was short lived or something.

I liked your soften example, but maybe I don't know it starts to get into the dilation realm, which is not bad at all but it pertains more into compositing rather than restoration, as denoised movies already have all the camera and lens flaws.

It can be approximated without the dilation with:
Code:
ex_unsharp(-0.4,Fc=width()/1.5)
And with the dilation, it's the same but in one call, presumibly faster but in reality slower, not sure why:
Code:
ex_luts(mode="max",pixels=ex_shape(1,mode="disk"),exprf=" dup x - abs 5 > swap range_max / 1.05 ^ range_max * x ?").removegrain(20)
@FTLOY: Try GradFun3plus/SmoothGradPlus
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread

Last edited by Dogway; 14th April 2023 at 12:34.
Dogway is offline   Reply With Quote
Old 14th April 2023, 12:49   #2397  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Quote:
Originally Posted by Dogway View Post
Yes thank you! Just downloaded and was sorting the names. Only checked a few of thems but I think you got 2 "Eterna Vivid 8543 160T" samples and 2 "Eterna 8563 250D" samples (the one called ET250D_GR), I see they are samples for shooting with an exposure fade, so only a few frames are useful where exposure is balanced, also there's a big cast to green, so not sure I can pull chroma grain detail from there but I think it will come useful anyways. Most are Fuji and among the Kodaks all are already done except 5201 and 5212, 5205 is not in my list maybe cause it was short lived or something.

I liked your soften example, but maybe I don't know it starts to get into the dilation realm, which is not bad at all but it pertains more into compositing rather than restoration, as denoised movies already have all the camera and lens flaws.

It can be approximated without the dilation with:
Code:
ex_unsharp(-0.4,Fc=width()/1.5)
And with the dilation, it's the same but in one call, presumibly faster but in reality slower, not sure why:
Code:
ex_luts(mode="max",pixels=ex_shape(1,mode="disk"),exprf=" dup x - abs 5 > swap range_max / 1.05 ^ range_max * x ?").removegrain(20)
@FTLOY: Try GradFun3plus/SmoothGradPlus
Great! Yes the exposure fade was due to the lack of film I only got short cuts for free Or if you mean the dark ones they are shot with a still camera but with the motion picture stocks.

As for the dilation it was originally meant for my digital footage to look like film so your script will be better for denoised film.
anton_foy is offline   Reply With Quote
Old 14th April 2023, 14:34   #2398  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 533
Quote:
Originally Posted by Dogway View Post
2020 is a shorthand for 2020NCL which is the most common one used, but you can explicitly define 2020CL or 2020NCL. Anyhow I haven't implemented model conversion yet so I think CL is not currently possible from ConvertFormat. You still have the function in TransformsPack - Models. You can see what's going on with show=true panel.

The concept of "matrix" is ill-formed, it was born when most of the model conversions could be done via a matrix transform, like between YCbCr/YPbPr and RGB, or YUV, or YIQ, etc. Now this is not the case, you can't convert to YcCbcCrc with a single 3x3 matrix, and the same applies to IPT, OkLab, and if I'm not wrong to YCoCg nor YUVr.

Also you don't want 709 transfer if working with delivery formats, for example if you are working with a Bluray source you want 1886 transfer which is the same 2020 uses as standard.
Correct with 2020CL. Indeed, it tries to make constant luminance which is by definition making Y' as close to Y of XYZ as possible. To do that it applies part of matrix first on linear values and only then applies nonlinearity and finishes the matrix using Y'.
Balling is offline   Reply With Quote
Old 15th April 2023, 19:36   #2399  |  Link
anton_foy
Registered User
 
Join Date: Dec 2005
Location: Sweden
Posts: 702
Dogway your inbox is full. Did you also want me to send you the grey card grain plates?
anton_foy is offline   Reply With Quote
Old 16th April 2023, 01:38   #2400  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 2,351
Yes sorry, I forgot to delete the PM, deleted just as I got the warning so try when you can. Will be filling the presets for next updates, I think that's all is left for FilmGrain+.
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread
Dogway is offline   Reply With Quote
Reply

Tags
avisynth, dogway, filters, hbd, packs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.