Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing PSNR of two videos, possibly with ffmpeg?

Tags:

video

ffmpeg

I would like to compare a large number of videos to a good reference video in order to find videos with poor quality. I want to do this in a batch mode by calling a command line utility, I'm already using ffmpeg in this manner to grab video frames.

ffmpg will give me a PSNR value to compare the input and output videos if I transcode a video. I was under the impression I could use something like this to compare two separate videos but can't find a way to do it.

Would I be better grabbing a single frame from each video and comparing those somehow? PSNR may not be the best option for me?

I'm not looking for minor differences in quality but for major differences such a sync problems or large amounts of snow.

Any suggestions? Thanks in advance :-)

like image 432
UnixNerd Avatar asked Nov 07 '13 16:11

UnixNerd


1 Answers

This is how you use the psnr filter in ffmpeg to compare two separate videos:

ffmpeg -i input_video.mp4 -i reference_video.mp4 -filter_complex "psnr" -f null /dev/null

On Windows replace /dev/null with NUL.

Documentation says that input_video will be passed unchanged to output_video, and the psnr value will be shown on the command line.

like image 125
pewpew Avatar answered Oct 14 '22 03:10

pewpew