I am experimenting with losslessly compressing some raw video. How can I perform a frame hash on the encoded output before or while writing it to the file system? I want to make an original.hashes
and a compressed.hashes
. (I will compare them with another tool later.)
ffmpeg -r 30 -start_number 0 -i "%IMAGES_DIRECTORY%\%%03d.png" ^
-filter_complex "split=3 [copyHash] [copyLossless] [otherIn]; [otherIn] {some filter here} [otherOut]" ^
-map [copyLossless] -c:v libx264rgb -qp 0 -pix_fmt rgb24 "%IMAGES_DIRECTORY%\lossless.avi" ^
-map [copyHash] -f framehash -hash SHA512 "%IMAGES_DIRECTORY%\original.hashes" ^
-map [otherOut] {some other encoding} someOtherFile.idc
ffmpeg -start_number 0 -i "%IMAGES_DIRECTORY%\lossless.avi" -pix_fmt rgb24 -f framehash -hash SHA512 "%IMAGES_DIRECTORY%\decoded.hashes"
comp original.hashes decoded.hashes
So above, I would like to avoid the second call to ffmpeg. Like if I could split the lossless.avi
output of the first call to two new streams: One to the file system and one to a demuxer feeding the hash muxer.