0

I have an avi file.i am converting avi file to .mp4 codec H.264 and ain second case to .mp4 file codec H.265.Now i want to calculate the PSNR/MSE/MSAD between the ref file(avi file) and the converted mp4 file using ffmpeg.Came across ffmpeg command line filters for PSNR and SSIM calculation but it gives the average PSNR value not the PSNR value frame by frame.Also i want to do it using code and not using command line.Read several examples in demuxing.c it is separating the whole file into frames in av_read_frame before calling decode but how can i convert pkt to frame and able to calculate PSNR or MSE values.

Regards Mayank

1 Answer 1

2

FFmpeg has a psnr video filter which will give you per-frame PSNR as per-frame metadata. You probably want to use this, since it also allows simply extending the code to add SSIM (using the ssim filter) without too much effort on your end.

You should be able to find documentation about hooking up libavfilter with your decoded AVFrames without too much effort.

3

Not the answer you're looking for? Browse other questions tagged or ask your own question.