简体   繁体   中英

ffmpeg psnr after cropping

I am trying to calculate PSNR of two images that have slightly different width/height:

ffmpeg -y -i /tmp/ff-021407597-sn-1029-516-C-0-956542137 
          -i /tmp/ff-021407597-ff-1029-516-C-0-362227908 
          -filter_complex "[0:v]crop=1028:514;[1:v]crop=1028:514" 
          -filter_complex "psnr"  %03d.png

This does not work and I get this error:

Input #0, png_pipe, from

'/tmp/ff-021407597-sn-1029-516-C-0-956542137': Duration: N/A,

bitrate: N/A

Stream #0:0: Video: png, rgb24(pc), 1029x515, 25 tbr, 25 tbn, 25 tbc Input #1, png_pipe, from

'/tmp/ff-021407597-ff-1029-516-C-0-362227908': Duration: N/A,

bitrate: N/A

Stream #1:0: Video: png, rgb24(pc), 1029x516, 25 tbr, 25 tbn, 25 tbc Cannot find a matching stream for unlabeled input pad 0 on filter

Parsed_psnr_0

Is there some way to map the outputs of the crop filter so that it is passed into the psnr filter?

Use

ffmpeg -y -i /tmp/ff-021407597-sn-1029-516-C-0-956542137 
          -i /tmp/ff-021407597-ff-1029-516-C-0-362227908 
          -filter_complex "[0:v]crop=1028:514[a];[1:v]crop=1028:514[b];[a][b]psnr" -f null -

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