Update 27 Feb 2010
Fixed one bug related to image saving; version updated to 0.2.1.
Update 21 Feb 2010
Apparently Ubuntu people won't release updated libav* libraries until 10.10. This is a bit sad. Nevertheless, I've released them as well latest binaries. Just scroll below at known issues.
Update 20 Feb 2010
Finally got confirmed that libav*.so.* in Ubuntu 9.10 (and apparently even 10.04) are broken (ie. don't support finalized Theora format).
Update 18 Feb 2010
As seen as PSNR is good but another objective measure does exist, I've added to this tool even the ability to compute SSIM (invoke with -a ssim or -a avg_ssim to compute it)
I wanted to compute PSNR of some movies, to perform test analysis on codecs; unluckily on Linux I could not find any native tool (eg. tools usable without emulation/wine). One way to compute PSNR is to use mplayer, extract all the frames you're interested into a temporary directory, then invoke some other processes to perform it and finally write it on a file.
This approach has many issues. The most important are that is slow, it requires a lot of disk space and involves fiddling around. This is not good. Another issue is that usually PSNR is computed between two sources, a reference and a derivative of the reference (usually the derivative is lossy compressed). Problem is that I would like to perform the PSNR of a reference video vs. multiple derivatives (like the derivatives compressed with same codec but different bitrate/settings) and the mplayer script approach doesn't really make it.
Then I decided to write (in C++ naturally)
my own tool, relying on libavcodec to get
the frames of video streams; once I wrote the base classes to handle
video frames, I then moved on the next big thing to do: make it extremely quick!
Luckily I reused previously written threading (threads and thread pools) and synchronization (semaphores) classes.
As seen as those had been already tested it has been very straightforward to implement few bits and put the togheter.
In order to achieve quick performance and
resposiveness I've developed the following architecture: