Added "streamhash" recipe.

This commit is contained in:
Peter Bubestinger-Steindl 2019-11-04 22:55:07 +01:00
parent b45b2d79e1
commit c88008a68f

View File

@ -1997,6 +1997,47 @@
</div>
<!-- ends Get checksum for video/audio stream -->
<!-- Get checksum for all video/audio streams -->
<label class="recipe" for="get_streamhash">Get individual checksums for all video/audio streams ("Streamhash")</label>
<input type="checkbox" id="get_streamhash">
<div class="hiding">
<h5>Get individual checksums for all video/audio streams ("Streamhash")</h5>
<p><code>ffmpeg -i <em>input_file</em> -map 0 -f streamhash -hash md5 - -v quiet</code></p>
<p>
The outcome is very similar to that of "-f hash", except you get one hash
per-stream, instead of one (summary) hash. Another benefit is that you
don't have to know which streams, or how many to expect in the source
file. This is very handy for hashing mixed born-digital material.
</p>
<p>
This script will perform a fixity check on all audio and video streams in
the file and return one hashcode for each one. This is useful for e.g.
be able to change to container/codec format later on and validate it
matches the original source.
</p>
<p>
The output is formatted for easily processing it further in any kind of
programming/scripting language.
</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <em>input_file</em></dt><dd>path, name and extension of the input file</dd>
<dt>-map 0</dt><dd>map ALL streams from input file to output. If you omit this, ffmpeg chooses only the first "best" (*) stream: 1 for audio, 1 for video (not all streams).</dd>
<dt>-f streamhash -hash md5</dt><dd>produce a checksum hash per-stream, and set the hash algorithm to md5. See the official <a href="https://www.ffmpeg.org/ffmpeg-formats.html#streamhash-1" target="_blank">documentation on streamhash</a> for other algorithms and more details.</dd>
<dt>-</dt><dd>FFmpeg syntax requires a specified output, and <code>-</code> is just a place holder. No file is actually created. Choose an output filename to write the hashcode lines into a textfile.</dd>
<dt>-v quiet</dt><dd>(Optional) Disables FFmpeg's processing output. With this option it's easier to see the text output of the hashes.</dd>
</dl>
<p>
The output looks like this, for example (1 video, 2 audio streams):
<code>
0,v,MD5=89bed8031048d985b48550b6b4cb171c
0,a,MD5=36daadb543b63610f63f9dcff11680fb
1,a,MD5=f21269116a847f887710cfc67ecc3e6e
</code>
<p class="link"></p>
</div>
<!-- ends Get checksum for all video/audio streams -->
<!-- QCTools Report -->
<label class="recipe" for="qctools">QCTools report (with audio)</label>
<input type="checkbox" id="qctools">