Install FFmpeg (if not already installed):
sudo apt-get install ffmpeg
brew install ffmpeg
Opening a Command Prompt or Terminal
Open a command prompt or terminal and navigate to the folder where the video you want to convert is located.
Calculate PSNR value with ffmpeg:
ffmpeg -i src.mp4 -i compressed.mp4 -lavfi psnr -f null -
The PSNR value is given in dB (decibels). A higher value means that the original video and the reference video are more similar, while a lower value indicates greater differences between the two videos. An ideal PSNR value is 48 dB.
Note: The PSNR value is not always a good indicator of the visual quality of the video, as it only takes into account the quantitative differences between the original and reference video and not the viewer's subjective perception.