New section: perceptual hashing to compare video content

This commit is contained in:
kfrn 2017-10-14 11:38:26 +13:00
parent f427a05c89
commit d73ae6a382

View File

@ -42,6 +42,7 @@
<a href="#test-files"><button type="button" class="btn contents-list">Generate test files</button></a>
<a href="#repair"><button type="button" class="btn contents-list">Repair a file</button></a>
<a href="#ocr"><button type="button" class="btn contents-list">Use OCR</button></a>
<a href="#perceptual-similarity"><button type="button" class="btn contents-list">Compare similarity of videos</button></a>
<a href="#other"><button type="button" class="btn contents-list">Something else</button></a>
</nav>
@ -1731,6 +1732,43 @@ ffmpeg -i $file -map 0 -c copy $output
</div>
<!-- ends Exports OCR -->
</div>
<div class="well">
<h2 id="perceptual-similarity">Compare perceptual similarity of videos</h2>
<!-- Compare Video Fingerprints -->
<span data-toggle="collapse" data-target="#compare_video_fingerprints"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Compare Video Fingerprints">Compare Video Fingerprints</button></span>
<div id="compare_video_fingerprints" class="collapse">
<h3>Compare two video files for content similarity using perceptual hashing</h3>
<p class="link"></p>
<p><code>ffmpeg -i <i>input_one</i> -i <i>input_two</i> -filter_complex signature=detectmode=full:nb_inputs=2 -f null -</code></p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_one</i> -i <i>input_two</i></dt><dd>assigns the input files</dd>
<dt>-filter_complex</dt><dd>enables using more than one input file to the filter</dd>
<dt>signature=detectmode=full</dt><dd>Applies the signature filter to the inputs in 'full' mode. The other option is 'fast'.</dd>
<dt>nb_inputs=2</dt><dd>tells the filter to expect two input files</dd>
<dt>-f null -</dt><dd>Sets the output of FFmpeg to a null stream (since we are not creating a transcoded file, just viewing metadata).</dd>
</dl>
</div>
<!-- ends Compare Video Fingerprints -->
<!-- Generate Video Fingerprint -->
<span data-toggle="collapse" data-target="#generate_video_fingerprint"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Generate Video Fingerprint">Generate Video Fingerprint</button></span>
<div id="generate_video_fingerprint" class="collapse">
<h3>Generate a perceptual hash for an input video file</h3>
<p class="link"></p>
<p><code>ffmpeg -i <i>input</i> -vf signature=format=xml:filename="output.xml" -an -f null -</code></p>
<dl>
<dt>ffmpeg -i <i>input</i></dt><dd>starts the command using your input file</dd>
<dt>-vf signature=format=xml</dt><dd>applies the signature filter to the input file and sets the output format for the fingerprint to xml</dd>
<dt>filename="output.xml"</dt><dd>sets the output for the signature filter</dd>
<dt>-an</dt><dd>tells FFmpeg to ignore the audio stream of the input file</dd>
<dt>-f null -</dt><dd>Sets the FFmpeg output to a null stream (since we are only interested in the output generated by the filter).</dd>
</dl>
</div>
<!-- ends Generate Video Fingerprint -->
</div>
<div class="well">
<h2 id="other">Other</h2>
@ -1874,39 +1912,6 @@ ffmpeg -i $file -map 0 -c copy $output
</div>
<!-- ends Create ISO -->
<!-- Compare Video Fingerprints -->
<span data-toggle="collapse" data-target="#compare_video_fingerprints"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Compare Video Fingerprints">Compare Video Fingerprints</button></span>
<div id="compare_video_fingerprints" class="collapse">
<h3>Compare two video files for content similarity using perceptual hashing</h3>
<p class="link"></p>
<p><code>ffmpeg -i <i>input_one</i> -i <i>input_two</i> -filter_complex signature=detectmode=full:nb_inputs=2 -f null -</code></p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_one</i> -i <i>input_two</i></dt><dd>assigns the input files</dd>
<dt>-filter_complex</dt><dd>enables using more than one input file to the filter</dd>
<dt>signature=detectmode=full</dt><dd>Applies the signature filter to the inputs in 'full' mode. The other option is 'fast'.</dd>
<dt>nb_inputs=2</dt><dd>tells the filter to expect two input files</dd>
<dt>-f null -</dt><dd>Sets the output of FFmpeg to a null stream (since we are not creating a transcoded file, just viewing metadata).</dd>
</dl>
</div>
<!-- ends Compare Video Fingerprints -->
<!-- Generate Video Fingerprint -->
<span data-toggle="collapse" data-target="#generate_video_fingerprint"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Generate Video Fingerprint">Generate Video Fingerprint</button></span>
<div id="generate_video_fingerprint" class="collapse">
<h3>Generate a perceptual hash for an input video file</h3>
<p class="link"></p>
<p><code>ffmpeg -i <i>input</i> -vf signature=format=xml:filename="output.xml" -an -f null -</code></p>
<dl>
<dt>ffmpeg -i <i>input</i></dt><dd>starts the command using your input file</dd>
<dt>-vf signature=format=xml</dt><dd>applies the signature filter to the input file and sets the output format for the fingerprint to xml</dd>
<dt>filename="output.xml"</dt><dd>sets the output for the signature filter</dd>
<dt>-an</dt><dd>tells FFmpeg to ignore the audio stream of the input file</dd>
<dt>-f null -</dt><dd>Sets the FFmpeg output to a null stream (since we are only interested in the output generated by the filter).</dd>
</dl>
</div>
<!-- ends Generate Video Fingerprint -->
<!-- Scene Detection using YDIF -->
<span data-toggle="collapse" data-target="#csv-ydif"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Exports CSV for scene detection using YDIF">CSV with timecodes and YDIF</button></span>
<div id="csv-ydif" class="collapse">