O_oHehe, it's not like it only took 15 minutes to code and compile that filter
That won't be possible given the way VLC video filters work (they work on the decoded frame, the video output is responsible for the scaling if you have a decent graphics card ... which you do)Remember that point of the grain is a) to break down codec artefact pixelation (i.e. the filter should work on the screen/window buffer, not the frame pixels which are big
So basically always change the grain for every new frame? (This is already what it's doing)b)to keep areas that are not changing 'alive' (such as dark areas in horror movies ( - codec says 'they are dark, use won't see if I freeze it)).
So noise amplitude should depend on the base luminosity of a pixel? Or is that something different? (I guess that grain was due to irregularities in the film used when shooting a movie, and the reproduction process. Must mean that the grain isn't really dependant on the frame's content ... except maybe the amount of light it was exposed to)Remember also that the same noise is more visible in some areas than others - in the same frame! Because of instensity. (How to fix that, I don't know.)
Currently it's a fixed size (for speed issues) but changing the grain size would be really easy so I'll probably make it possible (at least chose in a list of presets).Would be nice if one could set parameters like grain size, minimum framerate (to keep alive low fps movies), and % of grain effect to use. Or at least some good defaults, like toon, normal, dark. Then everyone would be able to adapt the grain perfectly to the movie that they have.
More comments are always welcome If you have knowledge about other kinds of algorithms that can be used to add grain to a movie (or precise desciptions about the physical phenomenon involved in the grain's creation in old movies) I would be glad to read those to improve the current algorithm.Let me know if you want me to betatest or assist you if you want. Great work!
Argh! Oh no! What a bummer. That means that pixelated (i.e., low res, you know, "700MB type movies") will only look a little better. (i.e., the CODEC pixelation/smoothing is broken up, but the noise will become apparent, since frame pixels are 2.5x2.5 physical pixels on normal PC screens.)That won't be possible given the way VLC video filters work (they work on the decoded frame, the video output is responsible for the scaling if you have a decent graphics card ... which you do)
Perfect! Don't change a thingSo basically always change the grain for every new frame? (This is already what it's doing)
I read up a bit, and apparently grain is the difference in density (manufacturing processes aren't perfect) of the silver halide layer. The grain becomes more apparent when more photons hit that layer, such as when you overexpose a poorly lit scene. Film makers do this for effect (I know this from my 3D @ Uni) - they decrease the shutter width and/or shutter time, so that fewer photons make it onto the film, and then overexpose it back so you can see something The photons that DID affect the layer are few, only here and there, and so you get a more uneven (exaggerated) layer.So noise amplitude should depend on the base luminosity of a pixel? Or is that something different? (I guess that grain was due to irregularities in the film used when shooting a movie, and the reproduction process. Must mean that the grain isn't really dependant on the frame's content ... except maybe the amount of light it was exposed to)
To me, the main thing with grain size is to have it reduce frame resolution pixelation. The usual movies are around 600x350, which makes each film pixel about 2x2 to 3x3 physical pixels on 1280x1024 screens. With the usual filtering, it's ok for these movies, but any lower and you can see the pixelation clearly. If it's impossible to do grain smaller than the .avi resolution, I don't see any need for grain size. I mainly meant some way of adjusting it if the grain is too big, such as when the .avi is low res.Currently it's a fixed size (for speed issues) but changing the grain size would be really easy so I'll probably make it possible (at least chose in a list of presets).
Framerate is currently set to the original movie's framerate and I don't intend on changing that (as it would imply a completely different type of plugin, which I don't like).
As for % of grain effect, I guess that you mean something like the std deviation of the grain's randomness compared to the allowed luminosity range? (Movies allow 256 levels of luminance, which is basically luminosity, and I was currently using a range of random numbers in the [-15;15] range to add noise, followed by a convolution by a 5x5 gaussian which is what 'sets' the grain size mentioned earlier before applying that noise to the original frame. The two chroma planes are left untouched.)
More comments are always welcome If you have knowledge about other kinds of algorithms that can be used to add grain to a movie (or precise desciptions about the physical phenomenon involved in the grain's creation in old movies) I would be glad to read those to improve the current algorithm.
Code: Select all
vlc --video-filter grain <someinput>
Return to “General VLC media player Troubleshooting”
Users browsing this forum: No registered users and 26 guests