Class VFPFingerPrint
- Namespace
- VisioForge.Core.VideoFingerPrinting
- Assembly
- VisioForge.Core.dll
Represents a video fingerprint containing unique characteristics of video content for identification and comparison. Supports serialization and deserialization of fingerprint data with metadata.
public class VFPFingerPrintInheritance
Inherited Members
Constructors
VFPFingerPrint()
Initializes a new instance of the VisioForge.Core.VideoFingerPrinting.VFPFingerPrint class.
public VFPFingerPrint()Properties
Data
Gets or sets the binary fingerprint data representing the video content signature.
public byte[] Data { get; set; }Property Value
- byte[]
Duration
Gets or sets the duration of the fingerprinted video segment.
public TimeSpan Duration { get; set; }Property Value
FrameRate
Gets or sets the frame rate of the source video.
public double FrameRate { get; set; }Property Value
Height
Gets or sets the height of the source video frames used for fingerprinting.
public int Height { get; set; }Property Value
ID
Gets or sets the unique identifier for this fingerprint.
public Guid ID { get; set; }Property Value
IgnoredAreas
Gets the collection of rectangular regions that were ignored during fingerprint generation.
public List<Rect> IgnoredAreas { get; set; }Property Value
OriginalDuration
Gets or sets the total duration of the original source file.
public TimeSpan OriginalDuration { get; set; }Property Value
OriginalFilename
Gets or sets the path to the source file from which this fingerprint was generated.
public string OriginalFilename { get; set; }Property Value
SupportsMirrorDetection
Gets or sets whether this fingerprint supports mirror-aware comparison.
public bool SupportsMirrorDetection { get; set; }Property Value
Remarks
This corresponds to fingerprint Version 2 and later. Older fingerprints (Version 1) do not support mirror detection.
Tag
Gets or sets an optional user-defined tag for categorizing or identifying this fingerprint.
public string Tag { get; set; }Property Value
Version
Gets or sets the fingerprint format version.
public int Version { get; set; }Property Value
Remarks
Different versions use different algorithms and data structures. Always use the latest version (2) for new fingerprints unless compatibility with older versions is required.
Width
Gets or sets the width of the source video frames used for fingerprinting.
public int Width { get; set; }Property Value
Methods
~VFPFingerPrint()
Finalizes an instance of the VisioForge.Core.VideoFingerPrinting.VFPFingerPrint class.
protected ~VFPFingerPrint()Load(string)
Loads a video fingerprint from a file on disk.
public static VFPFingerPrint Load(string filename)Parameters
filenamestring-
The path to the fingerprint file to load. Recommended extension is .vsigx.
Returns
- VFPFingerPrint
-
A deserialized VisioForge.Core.VideoFingerPrinting.VFPFingerPrint object containing the fingerprint data and metadata.
Remarks
This method deserializes fingerprint data saved in JSON format with custom binary encoding for the fingerprint data array. The file format supports both current and legacy versions.
Exceptions
- FileNotFoundException
-
Thrown when the specified file does not exist.
- JsonException
-
Thrown when the file contains invalid or corrupted fingerprint data.
Load(byte[])
Loads a video fingerprint from a byte array in memory.
public static VFPFingerPrint Load(byte[] data)Parameters
databyte[]-
A byte array containing the serialized fingerprint data.
Returns
- VFPFingerPrint
-
A deserialized VisioForge.Core.VideoFingerPrinting.VFPFingerPrint object containing the fingerprint data and metadata.
Remarks
This method is useful for loading fingerprints that have been transmitted over a network, retrieved from a database, or stored in memory. The data must be in the same JSON format used by the VisioForge.Core.VideoFingerPrinting.VFPFingerPrint.Save method.
Exceptions
- JsonException
-
Thrown when the data contains invalid or corrupted fingerprint information.
Save(string)
Saves the fingerprint to a file on disk.
public void Save(string filename)Parameters
filenamestring-
The destination file path. Recommended extension is .vsigx (.sig for legacy compatibility).
Remarks
If the file already exists, it will be deleted before writing the new fingerprint data. The fingerprint is serialized to JSON format with custom binary encoding for efficient storage. Legacy extension .sig is supported for backward compatibility, but .vsigx is recommended.
Exceptions
- IOException
-
Thrown when the file cannot be written due to permissions or disk space issues.
Save()
Serializes the fingerprint to a byte array for in-memory storage or transmission.
public byte[] Save()Returns
- byte[]
-
A byte array containing the serialized fingerprint data in JSON format with binary encoding.
Remarks
The returned byte array can be stored in a database, transmitted over a network, or kept in memory. It can later be deserialized using the VisioForge.Core.VideoFingerPrinting.VFPFingerPrint.Load(System.Byte[]) method. The data is compact and includes all fingerprint metadata and settings.