How to use ffmpeg to calculate the ssim value of compressed VP8/VP9 video?

General Tech Bugs & Fixes 2 years ago

1 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 30 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I have a HEVC video. I converted it to VP8 and VP9 by using the FFmpeg commands below:

ffmpeg -i ./hevc.mp4 -vcodec libvpx -crf 18 -b:v 0 -speed 1 ./vp8.webm

ffmpeg -i ./hevc.mp4 -vcodec libvpx-vp9 -crf 18 -b:v 0 -speed 1 ./vp9.webm

The conversion was very successful. But the ssim value I calculated via FFmpeg commands below:

ffmpeg -y -i hevc.mp4 -i vp8.webm -filter_complex "ssim" -f hevc /dev/null

ffmpeg -y -i hevc.mp4 -i vp9.webm -filter_complex "ssim" -f hevc /dev/null

Both of the VP8 and VP9 videos got the ssim values that were smaller than 0.99. These were bad results that I didn't expect.

If I convert the HEVC video to x264, the ssim values will be normal.

Are there any problems among my commands?

profilepic.png
manpreet 2 years ago

To perform SSIM only on a reference and comparison file as of FFMPEG 4.0 and later:

ffmpeg -i test.mp4 -i reference.mp4 -lavfi libvmaf="[0:v][f="https://forum.tuteehub.com/tag/1">1:v]ssim" -f null -

Requires the VMAF filter be compiled into FFMPEG.

See the FFMPEG docs section on SSIM for more info: https://ffmpeg.org/ffmpeg-filters.html#ssim


1 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.