[FFmpeg-user] FFmpeg & hashing algorithm speed

Peter B. pb at das-werkstatt.com
Thu Nov 7 00:39:44 EET 2019


Hi everyone!

Hashing for fixity and transfer-checking seems to be quite a bottleneck 
for archiving big video/film files for archiving.

Therefore I was considering if using "simpler" algorithms (like CRC 
instead of SHA256) could speed up the process.
I was surprised that e.g. MD5 vs CRC in Python as well as PHP seemed to 
be equally "fast".

------------------------------------
So I was wondering:
Does FFmpeg have/do any speed optimization for hashing functionality 
(framemd5, hash muxer, etc) in its code?
------------------------------------


I've noticed, for example that "-f hash" for MD5 uses only half, SHA256 
just a quarter of my CPU. Input source was H.264/AAC/MP4, which I guess 
decodes multi-threaded?

I'd be very grateful if anyone's interested to provide me some insights 
or ideas in how FFmpeg's hashing could be made faster.



Thank you very much in advance,
Peter B.


PS:
I also found a possibly related claim in a Stackoverflow answer that the 
hashing functions are not implemented as fast as they could be:
https://stackoverflow.com/questions/16122067/md5-vs-crc32-which-ones-better-for-common-use/35484131#comment67221384_35484131


More information about the ffmpeg-user mailing list