View Full Version : With x264 what settings will raise psnr
chadamir
3rd January 2007, 00:42
I'm already using a cfr of 18 and can't seem to get above 45. What settings and matrices will help me raise this. Also avisynth filters. What should I look out for. How can I maintain transparency while raising the cfr for space?
CruNcher
3rd January 2007, 02:54
To reach visual loslessnes you need very clean source not every second hand source will work, higher the bitrate would be one way another would be to higher the me, those ways will slower encoding but wont affect decoding complexity.
And then ofcourse cleaning the Source would be another but you never gonna reach 5 db with all those ways only with higher bitrate you might be able to reach that, so in your case a lower crf in the 15 range or even lower could help ;)
DarkZell666
3rd January 2007, 10:06
Be careful when speaking of PSNR. Something with a higher PSNR could actually look worse :)
In the facts, matrices usually mess up the psnr, but improve visual quality ^^ (and I believe this is what you're trying to do, so matrices are a good thing, there's a thread from *.mp4 guy with all this matrices).
Personally, using crf18 on anime usually gives me 49,xx dB, but for movies or already compressed material that's another story :)
+1 for the crf15 and/or avisynth, but here's why:
To put this very simply, x264 doesn't like noise. So any noise it might encounter gets more or less accurately thrown away (or smeared/blended with the rest of the picture). This means that some "information" on the picture has "disappeared", which will automatically give you a lower psnr. So, either denoise with avisynth (x264 won't throw as much information away because it has been done beforehand), either push the bitrate up (lower crf), so x264 won't need to throw as much noise away to represent the picture accurately within a certain filesize. Turning deblocking down (ie: -2:-2 or -3:-3) will also help, but you'll have to try this yourself. I agree with Cruncher about the motion-estimation settings: --subme 7 and --me umh should help.
Edit: some filters/scripts that work very well are hqdn3d, fft3dfilter, convolution3d, frfun7 (or frfun3b, they don't do quite the same thing) removegrain, seesaw, Spresso ... all depends on what you're encoding. You'll have to search the avisynth forum for those.
R3Z
3rd January 2007, 10:12
Be careful when speaking of PSNR. Something with a higher PSNR could actually look worse :)
In the facts, matrices usually mess up the psnr, but improve visual quality ^^ (and I believe this is what you're trying to do, so matrices are a good thing, there's a thread from *.mp4 guy with all this matrices).
Personally, using crf18 on anime usually gives me 49,xx dB, but for movies or already compressed material that's another story :)
+1 for the crf15 and/or avisynth, but here's why:
To put this very simply, x264 doesn't like noise. So any noise it might encounter gets more or less accurately thrown away (or smeared/blended with the rest of the picture). This means that some "information" on the picture has "disappeared", which will automatically give you a lower psnr. So, either denoise with avisynth (x264 won't throw as much information away because it has been done beforehand), either push the bitrate up (lower crf), so x264 won't need to throw as much noise away to represent the picture accurately within a certain filesize. Turning deblocking down (ie: -2:-2 or -3:-3) will also help, but you'll have to try this yourself. I agree with Cruncher about the motion-estimation settings: --subme 7 and --me umh should help.
Edit: some filters/scripts that work very well are hqdn3d, fft3dfilter, convolution3d, frfun7 (or frfun3b, they don't do quite the same thing) removegrain, seesaw, Spresso ... all depends on what you're encoding. You'll have to search the avisynth forum for those.
crf15 is pretty much overkill in terms of compression isnt it ?
DarkZell666
3rd January 2007, 11:46
crf15 is pretty much overkill in terms of compression isnt it ?Well, it isn't when the quality provided by crf18 isn't enough (which is what seems to bother chadamir). Personally, I'm ok with crf18, but chadamir seemed concerned by the fact that he doesn't reach near 50db PSNR at crf18.
Actually, any "complaint" based on psnr doesn't mean much, so until chadamir reads all this and gathers his own conclusions ... all we can do is wait ^^
check
3rd January 2007, 12:32
crf15 is pretty much overkill in terms of compression isnt it ?
not always. A recent encode I did fitted in comfortably under a ratefactor of 15, although that was because I was using strong adaptive quantization on a dark source.
R3Z
4th January 2007, 03:01
Well, it isn't when the quality provided by crf18 isn't enough (which is what seems to bother chadamir). Personally, I'm ok with crf18, but chadamir seemed concerned by the fact that he doesn't reach near 50db PSNR at crf18.
Actually, any "complaint" based on psnr doesn't mean much, so until chadamir reads all this and gathers his own conclusions ... all we can do is wait ^^
Wow ! I was under the impression that crf20-22 would provide transparency (not a psnr measure, but a visual perception one).
bkman
4th January 2007, 04:43
Depends on how discerning about quality you are. The threshold of "perceptual transparency" varies from person to person.
Marsu42
4th January 2007, 05:15
So, either denoise with avisynth (x264 won't throw as much information away because it has been done beforehand)
Doesn't it make more sense to let x264 decide for itsself what noise to discard? I usually only apply a light Undot() or Removegrain(mode=2) to kill single pixel noise. If one chooses anything heavier, it might interfere w/ x264 and result in worse quality because avisynth cuts noise that the encoder wouldn't have necessarily thrown away?
check
4th January 2007, 05:59
x264 is a video encoder, not a denoiser. In other words, it will try to encode an output image that looks as close as possible to the input video. If you input grainy footage, it will try to output grainy footage, whereas if you input 'clean' footage, it will try to output clean footage.
The misconception that x264 is a denoiser most probably springs from the fact that it tends to ignore high frequency noise. This is not due to an intent to denoise -- the intent is to save bits (high frequency noise is expensive in terms of bits to encode) in one place and use them in other places; for a picture that is, on the whole, closer to the original.
DarkZell666
4th January 2007, 22:08
We've done a full circle now, since we're back to what Cruncher stated: the cleaner the source, the better =)
And I think we scared chadamir away :D
chadamir
5th January 2007, 05:31
Sorry, I was just standing back more than anything else. I realized that I was watching movies at 1400x900 which more than quadrupled their resolution (normally I watch on a projector at 800x480). I was getting upset about some artifacts, but then realized I've never had an issue with my encodes before.
I really wanted to know what things effect the psnr and what happens to bring it down during an encode, and I get sort of an idea.
DarkZell666
5th January 2007, 09:28
All depends on what artefacts you're looking at, and what resolution the movie is encoded at. You might be watching a movie on a 1400*900 display, but if the video is something like 640*352 or even 720*400, you should be seeing roughly the same thing on the projector.
If you're watching HD content (which has been scaled down by the projector, thus hidding tiny artefacts), it's another matter all together.
chadamir
5th January 2007, 16:45
Just dvd backups, it's usually stuff in the background and yeah I guess I can see it, it's just not as noticable. It tends to be during cloudy scenes are patchy walls wear the lighting is changing slightly at any given moment.
chadamir
6th January 2007, 16:30
x264 is a video encoder, not a denoiser. In other words, it will try to encode an output image that looks as close as possible to the input video. If you input grainy footage, it will try to output grainy footage, whereas if you input 'clean' footage, it will try to output clean footage.
The misconception that x264 is a denoiser most probably springs from the fact that it tends to ignore high frequency noise. This is not due to an intent to denoise -- the intent is to save bits (high frequency noise is expensive in terms of bits to encode) in one place and use them in other places; for a picture that is, on the whole, closer to the original.
X264 does have a noise reduction setting: -nr
I am of course more concerned with the visual quality than a mathematical quality like psnr, however, I dont always watch a backup after I make it and like to have something to quickly gauge it on. I tend to get banding on walls, clouds, and smoke (along with blocking) which is really the issue.
elguaxo
6th January 2007, 16:56
There are a couple of threads that might help you:
http://forum.doom9.org/showthread.php?t=112968
http://forum.doom9.org/showthread.php?t=119486
The M4G Smooth V1 CQM helps a lot: http://forum.doom9.org/showthread.php?t=117041
chadamir
6th January 2007, 17:26
They help, but debanding via ffdshow is something I'd rather not use, I'd rather have it done at encoding. I will take a look at m4g smooth, but how do you know if it needs b-frames removed?
bananacreamandpeca
6th January 2007, 19:36
We've done a full circle now, since we're back to what Cruncher stated: the cleaner the source, the better =)
And I think we scared chadamir away :D
On the contrary alot whats been said here I can really relate to.
Ofcourse it's always been the cleaner the source, the better the output.
It's just a pain when encoders makes an already crappy source far worse.
bananacreamandpeca
6th January 2007, 19:40
X264 does have a noise reduction setting: I tend to get banding on walls, clouds, and smoke (along with blocking) which is really the issue.
Same problem here. Rest of the movie seems pretty OK.
eccept when there are big explosions and lots of smoke indeed.
And you are using DVD-sources.
I was told I get these artifacts because my source was already crappy (LD. MPEG-2)
DarkZell666
6th January 2007, 22:30
It's just a pain when encoders makes an already crappy source far worse.It's precisely *because* the source is crappy that the encoder is having a hard time differentiating motion and noise :) Noise is kinda "random", and can't be reproduced accurately by motion vectors, so it gets coded into a DCT block (which looks inherently uglier than a motion-compensated block). The fact of denoising doesn't just clean the picture, it also simplifies the encoding process to some non-neglectible extent. The fact of having a non-noisy picture makes it easier to reproduce it correctly, which is why we have all sorts of Avisynth filters for all sorts of possible artefacts :p
This explains why sometimes a cleaned source uses up more bitrate when in CRF mode, because the noise is gone, and the picture looks less complex than the noisy original source. (cf. Manao's posts in the recent thread about cqp vs. crf).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.