简体   繁体   中英

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

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?

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][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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM