Log in

View Full Version : Keeping Grain in AVC Video


twolfe18
12th April 2007, 01:12
let me start out by saying that i hope that i am in the right section here, and i will describe my problem from the beggining. i have recorded a lot of video of my sister playing soccer, and my family wants to keep all of the video... on my computer :mad: . so i want to compress these files, because otherwise i will have to invest way to much in hard drives.

that said, i have started to encode some of it in x264, and i am not impressed. the problem i am having is that in the source video i have, there is a lot of grass, and i cant keep x264 from completely smudging it into one big mess. now, i realize that sometimes there is nothing you can do to make up for a higher bitrate, but i have experimented with higher bitrates (up to 1100kb/s, which is too much for what i need, something like 500-800 would be nice if possible).

now, i am no avisynth or x264 genius, so i was wondering if you guys had any recommendations for me. i need to preserve as much detail in the area that is not the traditional focus of codecs, the area that doesnt move much, and has no big hard lines.

or if you guys think that my goal is pretty much unattainable, let me know, and i will start to look into other compression methods... or maybe just buying a bunch of new hard drives :( .

:thanks:

twolfe18
12th April 2007, 01:16
and let me say one more thing, the resulting video does not have to be 'HD' by any means, it just cant look like they are playing on one big green screen, i need the appearance of grain. the input video (from the family camcorder) is not that good, so if there is not that much detail in the players, that is fine. i just want a way to shift the focus of x264, so that it puts bits down evenly on the frame, instead of focusing on the details in the players.

:thanks: again.

check
12th April 2007, 05:15
you can try reducing the deadzone parameters to smaller values, and using a high detail matrix (mp4guy's, for example), but you should focus primarily on simply filtering out the grain. At those low bitrates, you really can't keep grain, especially not on a high motion source such as soccer.

Manao
12th April 2007, 06:10
Firstly, you're encoding home made video. It's likely they are interlaced. Did you deinterlace them ?

Then, you could try the adaptive quantization ( in patched x264 builds ), to see if it helps. You could also reduce the resolution a bit.

You do not want to keep grain.

DarkZell666
12th April 2007, 06:49
+1 for the hints mentionned already.

Did you try 1-Pass ABR ? or 2-pass ? 2-pass is much better (just in case, since you didn't mention it).

Also, what does a 1-pass CRF 18 give you ? It's the simplest way to have an idea of how compressible your video is, but home-made videos are always difficult to compress (unless you had a stand for your camera and you are a skilled cameraman :p) ... that's life ^^

I think the most effective hint here is downsizing your picture (to something like 640*480, 576*432, or if you really need it, 512*384).

i need to preserve as much detail in the area that is not the traditional focus of codecs, the area that doesnt move much, and has no big hard lines.
Use LanczosResize(x,y) and it should be ok.

ToS_Maverick
12th April 2007, 09:04
also try CQ 18 and compare it to CRF18.

you said your "grass" isn't moving much, but even a little bit of shaking will trigger the standard qcomp of 0.6. i tested a short clip from a footballgame someone on this board posted some time ago.
CRF smoothed out the grass, and CQ kept it.

lpvtech
12th April 2007, 10:36
Well.. If you want the grain anyway.. I wold suggest you to go with XviD... Test encoding a little of your video with XviD and decide to yourself.. This is applicable only for a bitrate of atlease above 800Kbps. Lesser than that XviD is no match for x264 in terms of quality.

jeffy
12th April 2007, 10:39
It would probably be better if you posted a small sample of the original video file you are trying to compress.

R3Z
12th April 2007, 11:17
but i have experimented with higher bitrates (up to 1100kb/s, which is too much for what i need, something like 500-800 would be nice if possible

Honestly, grain and fine detail retention isnt going to happen even with 1100kbps at standard resolutions.

As has been suggested, its better to filter out as much grain as you can. That will save those precious bits for your grass :)

*.mp4 guy
12th April 2007, 13:08
If X264 is killing the grass, chances are that any denoising, except perhaps really, really slow denoising, will only make the problem worse. Also, X264 can keep fine detail aswell or better then Xvid, until you get into really high, dvd-like bitrates, in which case it is anyones guess which one will do better. X264 will keep your grain sharper and more temporally randome, but will keep less of it, Xvid will keep more grain, but will blur it, temporally and spatially.


You should do the following to get the most detail out of X264.

1 - lower inloop deblocking as far as you can without getting what you consider to be an unacceptable levels of artifacts.

2 - lower the deadzone settings, inter should always be about ~15-33% higher then intra, use the same method as used for inloop deblcocking to find a good value.

3 - lower your resolution, this seams counter-intuitive, but with almost all digital cameras the detail in the image is lower resolution then the image itself (IE, you can downsize without loosing any detail, though lines may be blurred slightly)

4 - use a higher bitrate, you can't expect to keep everything in the source (that you can see) with a quantizer value of more then 12, 90% of the time.

5 - use a cqm that gives a "look" that you like.

6 - use high quality (IE, slow) filters to bring out detail, and tone down noise in the source, most fast filters will only make detail retention worse at low bitrates, or will introduce an unacceptable level of artifacts.

7 - Tweak advanced settings in x264, I would go into further detail, but I am very tired of explaining, and re-explaining this.

8 - use slower encoding options in X264.

9 - skip everything I just said, buy a dvd burner and make a dvd (for lazy people who want a quick fix)

twolfe18
12th April 2007, 13:30
wow, i am beginning to think that i should have posted this in the newbies forum! :eek: i will start by trying to answer some of your questions: first, i always used a two pass encode on the hd-insane preset, and i did deinterlace it (i analyzed it with the avisynth script creator in MeGUI, i forget which method it came out to, but it was interlace with bottom field first). i used lanczos resize always, and as someone mentioned, no i didnt use a tripod (dont have one), and my camera work skills (at least with a camcorder, i'm very good with a dslr) are not that stellar, so the video is pretty shaky. i cant post a sample of the video right now, but i will see what i can do in a couple days.

from what i gather, i can do a couple things to improve the quality: use matrices (which i dont really know how to use, but i'm learning), use inloop deblocking (which i also dont know how to use), or change the deadzone settings (again, i'm clueless). i rely mostly on the avisynth script creator, but i have learned to edit the script manually a bit. so at this point, i appologize for being unable to make the most of your advice, and if you have no more patience to deal with a n00b, then i can understand.

i will try to do some of this stuff and post a clip in a little bit. thanks for your help!

twolfe18
12th April 2007, 13:34
i may take *.mp4guy's last ditch advice and just burn a bunch of dvd's.

PuzZLeR
12th April 2007, 16:43
Your last post may be more sensible than humor.

I've been through this thread, and I can see how it may be overwhelming for somebody new to x264.

As well, keep in mind, the H.264 codec isn't magic. It really only "looks" as good as an MPEG-2 source at about 50% of the original file size. Lowering the bitrate and the file size below that is compromise really.

I go as low as 20% for some video, much like the bitrates you wanted to use, but that's only because these clips are not as important to me and I accept the fact that I'm losing info along the way.

For now, I would recommend you backup your video onto DVD to free up your HD. DVD-R's are so cheap nowadays anyway.

This is exactly what I did at the beginning until I could do some experimenting. After some tests, with small clip samples, I found my "sweet spot".

It will take some time my friend, but this is the only way really.

And BTW, as far as important family videos are concerned, you should back them up on DVD. Lossy compression methods shouldn't be employed on your most prized and cherished assets.

*.mp4 guy
12th April 2007, 16:58
And BTW, as far as important family videos are concerned, you should back them up on DVD. Lossy compression methods shouldn't be employed on your most prized and cherished assets.

Both DVD and DV video formats are lossy, though both are capable of being archive quality if handled properly.

PuzZLeR
12th April 2007, 17:21
Both DVD and DV video formats are lossy, though both are capable of being archive quality if handled properly.

Absolutely.

I guess what I meant by "lossy compression methods" is squeezing video down to the bitrates that twolfe18 wanted between 500kbps-1100kbps from an assumed DV or DVD source. As wonderful as x264 is, this would be much more lossy than just doing the transcoding necessary to transfer it to a standard DVD.

twolfe18
12th April 2007, 20:19
i uploaded an untouched 300 frame sample at:

http://www.mediafire.com/?6whtumwkw1k

feel free to make your best shot at a good encode and post it up for me to see if you want.

giandrea
13th April 2007, 02:10
Sorry, but the quality of that clip is very low. I think you can safely deinterlace and downsize it to 640x360, or even better 480x270. At this point you can archive at 1000 kbps without any problem of missing grain (that I can't see in your clip anyway).

plane
13th April 2007, 02:29
i uploaded an untouched 300 frame sample at:

http://www.mediafire.com/?6whtumwkw1k

feel free to make your best shot at a good encode and post it up for me to see if you want.

xvid:
http://www.mediafire.com/?8mmyjimmi23

x264:
http://www.mediafire.com/?6mmm3mmmojd

I did a quick test, it looks like xvid perceived the grass better than x264 at about the same file size/bitrate - 1142k.