View Full Version : Encoding H264 with artificial noise
badmonkey
13th January 2011, 12:11
Hi all. A request for a few thoughts on the following.
I am encoding a video which I've added high levels of artificial noise to in post, for artistic reasons (essentially to fake detail on what is a pretty poor quality source).
H264 predictably enough eliminates much of the noise on encoding at bitrates appropriate for web distribution.
I am wondering if there are any tricks I can play with in order to either keep the noise, with encoding optimized for it, or get the compression artifacting to actually look like noise / grain (in which case I could remove the artificial version from the video, or at least dial it down).
Any suggestions? I would be using x264.
Encoding time is not an issue.
nm
13th January 2011, 12:22
Upload a sample clip of the source video. (To MediaFire, for example.)
What's your target bitrate, resolution and encoder settings?
J_Darnley
13th January 2011, 12:25
--tune grain
badmonkey
13th January 2011, 12:49
The resolution is 640x480, I consider 2 mbps to be rather ridiculous but a barely acceptable upper limit - half that if possible but even at 2 it's rubbish out of MainConcept. No encoder settings yet cos I'm here to get a starting point :)
nm
13th January 2011, 13:15
Ok, so you haven't even tried x264 yet. 1 Mbps is usually enough for decent grain/noise retention at that resolution if the framerate is 30 fps or below. It won't be transparent, but much much better than the standard youtube pulp.
If there are problems with the noise even with x264, maybe it's at tad too high frequency. A sample clip would tell more.
badmonkey
13th January 2011, 14:42
Oh wow I just did an encode via x264vfw using the "grain" tune preset, at 2000 kbps for comparison with the above, and it's WAY better than MainConcept. The latter ex Premiere is just rubbish compared to this. Holy hell I thought there wasn't much in it between the two codecs?!
So that's a good start. Here's the sample requested, this is an extract of the above x264 encode:
elshul_wind_x264_extract.avi (www.petersmith.net.nz/photos/video/elshul_wind_x264_extract.avi)
You can best spot my artificial noise against the land at the right where there is greenery.
Blue_MiSfit
18th January 2011, 03:08
:)
Welcome to x264 :D
There is a huge difference between H.264 encoders. Mainconcept (in my opinion) comes in second place for most things, and Elecard is up there as well.
x264 is also free... :devil:
About the only feature it's missing is 4:2:2 encoding, but even that is small peanuts for all but mastering purposes.
badmonkey
18th January 2011, 03:32
Right, well for now I have done my encode at 1200 kbps using the veryslow and --tune grain presets.
I tried --tune film and honestly couldn't detect much difference, but between 1200 and 1000 kbps the quality started to deteriorate.
Any suggestions for tweaks based on the sample ^ ?
Dark Shikari
18th January 2011, 03:36
As far as I can tell, you seem to be using 1-pass ABR mode; the start of your video gets more bits than the rest of it, so the comparison may be slightly unfair. If you're going to target a bitrate, use 2-pass mode. Otherwise, use CRF.
If you're looking for options to muck with for grain retention, basically everything that matters is wrapped up in Psy-RD and Psy-Trellis. These algorithms are the magic that makes x264 retain grain well (especially when using --tune grain, which is optimized for relatively even grain retention across a video, at the cost of absolute quality).
badmonkey
18th January 2011, 03:38
LOL no I'm using 2-pass. Not quite that dumb :) (But that sample is an extract of a 90 second encode, not a standalone)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.