Video loss measurement (Generate by Kiro (kiro.dev))
✓ Published0🌍 Public
VVioletVivirand
Last edited Dec 23, 2025
Created on Dec 22, 2025
This example compares video quality loss between a source clip and two transcoded outputs (H.264 and H.265) by calculating PSNR and SSIM metrics for matched frames. It demonstrates how to align timecodes using FFmpeg's `setpts=PTS-STARTPTS` filter and then applies the `psnr` and `ssim` lavfi filters to compute per-frame scores, with a note that PSNR above 40 and SSIM above 0.8 indicate acceptable quality. The visualization shows the numeric metric results directly from the FFmpeg console output, highlighting the trade-offs between codec presets.
AI-generated description