Log in

View Full Version : Disabling PSNR and SSIM for performance


photoguy123
18th February 2009, 17:06
Anyone have an idea how disabling psnr could reduce performance 20% in ffmpeg/x264?

Also is it true that disabling ssim using ffmpeg is not possible?

Sample command line here:

FFMPeg.exe -y -i script.avs -f mp4 -s 240x144 -vcodec libx264 -crf 31 -acodec libfaac -ac 1 -ab 16k -threads 0 -coder 0 -subq 6 -me_method umh -g 250 -keyint_min 25 -sc_threshold 40 -refs 6 -flags -psnr +loop -qmin 10 -qmax 51 -qdiff 4 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.60 -flags2 +mixed_refs -partitions +parti4x4+partp8x8+partb8x8 -me_range 16 -cmp +chroma -i_qfactor .71 -level 13 -bf 0 -bufsize 232KiB output.m4v

Only adding the -psnr flag reduces fps from around 217 to around 170.

Audionut
18th February 2009, 23:22
Let me ask you a question.

What does psnr do?

cogman
19th February 2009, 01:02
No calculation is free. PSNR is a sort of statistical calculation to approximate how close a film is to the original. By disabling it (IE not putting in the -psnr flag) you tell x264 not to do that calculation on each frame. Hence, your encoding goes faster because you aren't wasting as much time worrying about measuring quality.

Sagekilla
19th February 2009, 02:57
Except that makes absolutely no sense why photoguy123 lost 47 fps when he explicitly told ffmpeg not to calculate psnr.

Sounds like a bug to me.

Audionut
19th February 2009, 03:15
Only adding the -psnr flag reduces fps from around 217 to around 170.

This gels with the command line posted. So I guess he made an error in his first sentence.

Dark Shikari
19th February 2009, 03:24
This gels with the command line posted. So I guess he made an error in his first sentence.-psnr turns off PSNR :p

Audionut
19th February 2009, 04:07
Well that's backwards.

burfadel
19th February 2009, 04:16
Yeah it does sound backwards! but its something that can't be changed now as it would cause even more confusion!

On a completely separate performance note, I'm very impressed with the encoding speed on my new Q9400, I'm getting twice the encoding speed as with my E6600. The E6600 was running at 3.0Ghz, the q9400 at 3.2ghz. Thats a comfortable overclock for me, especially considering its summer here! (the only thing I changed was the cpu). The reason why I point that out is that is scales pretty well.

LoRd_MuldeR
19th February 2009, 04:17
-psnr turns off PSNR :pWell that's backwards.

FFmpeg uses "+" and "-" prefixes for its options. So "+psnr" would turn it on and "-psnr" does turn it off.

(Still the question how disabling a feature, which performs additional calculations, can make the encode go slower)