[MEncoder-users] Codec-independant objective quality measurement

Matthias Wieser mwieser at gmx.de
Wed Aug 2 18:16:09 CEST 2006


First: I don't know any good non-psnr tool for linux.

Nicolas George wrote:

> - I am not sure whether different codecs evaluate it exactly the same
> way. And even if they do, they do not display it the same way, and it is
> not always easy to know which part of the final statistic of one codec
> should be compared to which part for another codec.

You could use mplayer/TOOLS/psnr-video.sh for this purpose.

> - Codecs evaluate their PSNR with regard to the frame that is given to
> them, disregarding the effect of upstream video filters. That is
> especially true for scaling: if I downscale a video to 32x24, I can get
> lossless quality at less than 300 kbit/s, and the codec will tell me an
> infinite PSNR. But that does not mean that the result is perfect with
> regard to the original content. That example is exaggerated, but it would
> be nice to be able to evaluate whether, at a given bitrate, is is better
> to keep the original resolution or to downscale a little.

That has been one of the reasons for me to write mplayer/TOOLS/psnr-video.sh

This script let's you compare frame by frame the source video with the 
recompressed video. To match differing frame sizes you should give an 
apropriate "scale" option.


1. recompress the video:

  mencoder orig.avi -o recompressed.avi [...] -lavcopts vbitrate=300[...]

2. scale and compress the video:

  mencoder orig.avi -o scaledandrecompressed.avi [...] -vf 
  scale=32x24 -lavcopts vbitrate=300[...]

3. Compare:

  /path/to/mplayer/TOOLS/psnr-video.sh ./orig.avi ./recompressed.avi 500
  mv psnr.dat recompressed.dat
  /path/to/mplayer/TOOLS/psnr-video.sh ./orig.avi ./scaledandrecompressed.avi\
  500 "" "-vf scale=640x480"
  mv psnr.dat scaledandrecompressed.dat


More information about the MEncoder-users mailing list