Class VFPFingerPrintDB
- Namespace
- VisioForge.Core.VideoFingerPrinting
- Assembly
- VisioForge.Core.dll
Represents a database of video fingerprints for managing and searching video content signatures.
public class VFPFingerPrintDBInheritance
Inherited Members
Remarks
The VisioForge.Core.VideoFingerPrinting.VFPFingerPrintDB class provides functionality to store, retrieve, and manage video fingerprints. It supports serialization to persist fingerprint databases to disk and provides methods to check for duplicate content based on fingerprint signatures.
Constructors
VFPFingerPrintDB()
Initializes a new instance of the VisioForge.Core.VideoFingerPrinting.VFPFingerPrintDB class.
public VFPFingerPrintDB()Properties
Items
Gets or sets the collection of video fingerprints stored in the database.
public List<VFPFingerPrint> Items { get; set; }Property Value
Methods
ContainsFile(VFPFingerprintSource)
Checks whether the database contains a fingerprint matching the specified source configuration.
public bool ContainsFile(VFPFingerprintSource source)Parameters
sourceVFPFingerprintSource-
A VisioForge.Core.VideoFingerPrinting.VFPFingerprintSource specifying the filename and ignored areas to search for.
Returns
- bool
-
trueif the database contains a fingerprint with matching filename and ignored areas; otherwise,false.
Remarks
This method performs an exact match on both the filename and the ignored areas configuration. Two sources are considered matching only if they have the same filename and identical ignored area rectangles (order-independent). This helps avoid duplicate fingerprints and enables fingerprint caching to skip re-processing of previously analyzed videos.
~VFPFingerPrintDB()
Finalizes an instance of the VisioForge.Core.VideoFingerPrinting.VFPFingerPrintDB class.
protected ~VFPFingerPrintDB()GetFingerprint(VFPFingerprintSource)
Retrieves a fingerprint from the database that matches the specified source.
public VFPFingerPrint GetFingerprint(VFPFingerprintSource source)Parameters
sourceVFPFingerprintSource-
The fingerprint source containing the filename and ignored areas to match against.
Returns
- VFPFingerPrint
-
The matching VisioForge.Core.VideoFingerPrinting.VFPFingerPrint if found; otherwise,
null.
Remarks
This method searches for an exact match based on both the filename and the ignored areas configuration. If multiple fingerprints exist for the same file with different ignored areas, only the one with matching ignored areas will be returned.
Load(string)
Loads a fingerprint database from a file on disk.
public static VFPFingerPrintDB Load(string filename)Parameters
filenamestring-
The path to the database file to load. Recommended extension is .vsigx.
Returns
- VFPFingerPrintDB
-
A deserialized VisioForge.Core.VideoFingerPrinting.VFPFingerPrintDB object containing all stored fingerprints. If the file cannot be loaded or contains invalid data, returns an empty database instance.
Remarks
This method gracefully handles errors by returning an empty database if the file is corrupted, inaccessible, or contains invalid data. Error details are logged to the console and debug output. This ensures the application can continue running even if the database file is damaged.
Save(string)
Saves the fingerprint database to a file on disk.
public void Save(string filename)Parameters
filenamestring-
The destination file path for the database. Recommended extension is .vsigx.
Remarks
The entire database, including all fingerprints and their metadata, is serialized to JSON format with custom binary encoding. This allows efficient storage and retrieval of large fingerprint collections.
Exceptions
- IOException
-
Thrown when the file cannot be written due to permissions or disk space issues.