videoffmpegtranscodingvideoquality

How to quantify and compare video quality


I have a set of uncompressed videos in YUV format.

I have obtained several derived copies in various formats and resolutions from these yuv files using FFmpeg transcoding. (YUVs ----> X Derived Copies)

What I have also done is, transcode the yuv's into same resolution AVIs, and now obtained the same set of derived (transcoded) videos treating the AVIs as master. (AVIs ----> X Derived Copies)

Now I wish to compare the quality of transcoded videos, when derived from AVIs to those derived from YUVs.

Is there any way for me to do this using FFmpeg. How? If not, can you please suggest some good open source software to do this.

Thanks


Solution

  • If you have the time this is what I've done in the past. 1. Use ffmpeg to split both the video files into their component frames (make sure that you have the disk space first):

    ffmpeg -i file1.avi -f image2 file1-%015d.bmp
    ffmpeg -i file2.avi -f image2 file2-%015d.bmp
    
    1. Use imagemagick compare to determine the differences in each frame (Replace NNNNNN with the number of frames that ffmpeg gave you):
    for FNAME in {1..NNNNNN}; do
        compare file1-$FNAME.bmp file2-$FNAME.bmp tmp.png
        compare -metric PSNR file1-$FNAME.bmp file2-$FNAME.bmp tmp.png >> results
    done
    1. Open the file results in a spreadsheet and work out the average, std-dev, etc ... this will tell you how much the files differ.