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. The iscc-sdk uses ffmpeg to extract frame signatures with 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 = ic.core_opts.video_bits) #

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

Parameters:

Name Type Description Default
frame_sigs ic.FrameSig

Sequence of MP7 frame signatures

required
bits int

Bit-length resulting Instance-Code (multiple of 64)

ic.core_opts.video_bits

Returns:

Type Description
dict

ISCC object with Video-Code

gen_video_code_v0(frame_sigs, bits = ic.core_opts.video_bits) #

Create an ISCC Video-Code with algorithm v0.

Parameters:

Name Type Description Default
frame_sigs ic.FrameSig

Sequence of MP7 frame signatures

required
bits int

Bit-length resulting Video-Code (multiple of 64)

ic.core_opts.video_bits

Returns:

Type Description
dict

ISCC object with Video-Code

soft_hash_video_v0(frame_sigs, bits = ic.core_opts.video_bits) #

Compute video hash v0 from MP7 frame signatures.

Parameters:

Name Type Description Default
frame_sigs ic.FrameSig

2D matrix of MP7 frame signatures

required
bits int

Bit-length of resulting Video-Code (multiple of 64)

ic.core_opts.video_bits