Log in

View Full Version : adding grain on h264 in ffdshow ?


Pages : 1 [2]

Nephilis
14th March 2009, 17:45
Hi,
Any suggestion how to use this filter for dark areas only ? (For avoid blocking in dark areas)
Thanx in advance..

poisondeathray
14th March 2009, 18:14
Hi,
Any suggestion how to use this filter for dark areas only ? (For avoid blocking in dark areas)
Thanx in advance..

You might apply the filter in segments using the Trim() command

Nephilis
14th March 2009, 18:24
You might apply the filter in segments using the Trim() command

i mean dark areas in a frame.. :rolleyes:

poisondeathray
14th March 2009, 18:52
i mean dark areas in a frame.. :rolleyes:

A very "ghetto" way to do it is to divide it up using crop, stackvertical, stackhorizontal, trim commands to apply filter to a block segment of a frame for section of frames. I've done this before it is very tedious...

Some of the gurus should be along to provide the "elegant" method :)

Didée
14th March 2009, 19:14
A very "ghetto" way to do it is to divide it up using crop, stackvertical, stackhorizontal, trim commands to apply filter to a block segment of a frame for section of frames. I've done this before it is very tedious...
Why not use MS Paint to manually draw all pixels to your liking?

The elegant way is to use the parameters that are offered by the function.
function GrainFactory3(clip clp,int "g1str",int "g2str",int "g3str",int "g1shrp",int "g2shrp",int "g3shrp",
\ float "g1size", float "g2size", float "g3size",
\ int "g1tex", int "g2tex", int "g3tex", int "temp_avg", int "ontop_grain",
\ int "th1", int "th2", int "th3", int "th4")
{

g1str = default( g1str, 13 ) # [ 0 - ???] strength of grain / for dark areas
g2str = default( g2str, 15 ) # [ 0 - ???] strength of grain / for midtone areas
g3str = default( g3str, 25 ) # [ 0 - ???] strength of grain / for bright areas
.
.
.

Nephilis probably wants to use GrainFactory3( g1str=(something), g2str=0, g3str=0, ... )

See also the examples given in post#43 above.

Nephilis
16th March 2009, 08:51
Nephilis probably wants to use GrainFactory3( g1str=(something), g2str=0, g3str=0, ... )

See also the examples given in post#43 above.

Thanx Didée, that was what i exactly asking for..

Edit:Can be done a defaults option ? e.g. For dark areas only GrainFactory3(defaults="dark") or something similar.. I know i want too much :)

`Orum
9th April 2009, 04:10
First of all, thank you Didée for this awesome filter. Makes film look excellent during playback.

Secondly...
it brings back the grain h264 stole from us :D
What? H.264 isn't "stealing" your grain. If you're losing grain, it's in your encoder or the settings you're using. Personally, I think that x264 with b-adapt 2 and a reasonable number of b-frames is better at maintaining grain than comparable bitrate MPEG-2, and way better than MPEG-4 ASP even when given a lower bitrate.

jkwarras
26th September 2009, 19:02
Hi,

I've used Didee grainfactory a lot for film grain simulation on my shortfilms and music videos. Right now, I've not found any (even commercial) plugin that gives me the ability to change values on shadows, highlights, mids, etc... as this filter, and that gives a so realistic film grain effect.

So thanks a lot for this, it's impressive and my videos can't live without it :)

Working on pro video (mostly P2 and HD formats), I wonder if is there any possibility of supporting other color spaces as YUY2 or RGB, to avoid the YV12 conversion?

Thanks a lot again!

Ivan

kenpachi
20th October 2011, 00:10
I have encoded sth adding GrainFactory3(5,4,3,70,76,90,1.30,1,0.70,0,0,0,0,0,24,56,128,160). Unfortunately, the bitrate seemed to be too low causing blocking. I need to lower the grain down and reencode it with x264 2passes. Can I use previous stats form 1st pass? The only thing I'm going to change is parameters in GrainFactory3 or switching it with AddGrain. Can I do so with no problem and quality loss?

McConnor
2nd January 2019, 18:10
I know this is rather old but upon restoring super8 video material I have finally come to the point that I want to put some grain back in the material I have earlier cleaned an processed. Grainfactory3 seems to work rather good but I am struggeling to get the parameters right.

Can someone give me advice as to which set of parameters is likely to give an authentiv super8 grain look? By trial and error I went with

GrainFactory3(20,40,45,70,80,90,2,1.5,0.9,10,10,0,20)

but somehow it does not seem right. The default settings are giving me too much sharp grain in dark areas... Perhaps someone can give me insight into some proven grain settings for film material.... Thank you very much