Skip to content

ISCC - Video-Code#

A similarity preserving hash for video content

The Content-Code Video is generated from MPEG-7 Video Frame Signatures. Frame Signatures can be extracted with ffmpeg (see: https://www.ffmpeg.org/) using the following command line parameters:

$ ffmpeg -i video.mpg -vf fps=fps=5,signature=format=xml:filename=sig.xml -f null -

The relevant frame signatures can be parsed from the following elements in sig.xml:

<FrameSignature>0 0 0 1 0 0 1 0 1 1 0 0 1 1 ...</FrameSignature>

Tip

It is also possible to extract the signatures in a more compact binary format. But the format requires a custom binary parser to decode the frame signaturs.

gen_video_code(frame_sigs, bits = 64) #

Create an ISCC Video-Code with the latest standard algorithm.

:param ic.FrameSig frame_sigs: Sequence of MP7 frame signatures :param int bits: Bit-length resulting Instance-Code (multiple of 64) :return: ISCC object with Video-Code :rtype: dict

gen_video_code_v0(frame_sigs, bits = 64) #

Create an ISCC Video-Code with algorithm v0.

:param ic.FrameSig frame_sigs: Sequence of MP7 frame signatures :param int bits: Bit-length resulting Video-Code (multiple of 64) :return: ISCC object with Video-Code :rtype: dict

soft_hash_video_v0(frame_sigs, bits = 64) #

Compute video hash v0 from MP7 frame signatures.

:param ic.FrameSig frame_sigs: 2D matrix of MP7 frame signatures :param int bits: Bit-length of resulting Video-Code (multiple of 64)