Note: There might be a slight delay the first time you authenticate as the SDK downloads and installs necessary updates
Generate Fingerprint
First, generate a fingerprint from the media file you. You can either generate a fingerprint to ingest into your custom database or you can generate a fingerprint to initiate a search with.
# CREATE AUDIO FINGERPRINT FROM MEDIA FILEft = client.fingerprint_file("/path/to/file.mp3", pex.FingerprintType.AUDIO)# CREATE MELODY FINGERPRINT FROM MEDIA FILEft = client.fingerprint_file("/path/to/file.mp3", pex.FingerprintType.MELODY)# CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft = client.fingerprint_buffer([]byte, pex.FingerprintType.AUDIO)# CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft = client.fingerprint_buffer([]byte, pex.FingerprintType.MELODY)
// CREATE AUDIO FINGERPRINT FROM MEDIA FILEft, err := client.FingerprintFile(inputFile, pex.FingerprintTypeAudio)if err !=nil {panic(err)}// CREATE MELODY FINGERPRINT FROM MEDIA FILEft, err := client.FingerprintFile(inputFile, pex.FingerprintTypeMelody)if err !=nil {panic(err)}// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft, err := client.FingerprintBuffer([]byte, pex.FingerprintTypeAudio)if err !=nil {panic(err)}// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft, err := client.FingerprintBuffer([]byte, pex.FingerprintTypeMelody)if err !=nil {panic(err)}
// CREATE AUDIO FINGERPRINT FROM MEDIA FILE$ft = $client->fingerprintFile(INPUT_FILE, [Pex\FingerprintType::Audio]);// CREATE MELODY FINGERPRINT FROM MEDIA FILE$ft = $client->fingerprintFile(INPUT_FILE, [Pex\FingerprintType::Melody]);// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILE$ft = $client->fingerprintBuffer([]byte, [Pex\FingerprintType::Audio]);// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILE$ft = $client->fingerprintBuffer([]byte, [Pex\FingerprintType::Melody]);
// CREATE AUDIO FINGERPRINT FROM MEDIA FILElet ft =awaitclient.fingerprintFile("video.mp4", [pex.AUDIO])// CREATE MELODY FINGERPRINTlet ft =awaitclient.fingerprintFile("video.mp4", [pex.MELODY])// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILElet ft =awaitclient.fingerprintBuffer([]byte, [pex.AUDIO])// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILElet ft =awaitclient.fingerprintBuffer([]byte, [pex.MELODY])
Note: Our SDK's computations are single-threaded. If you need to process larger volumes of files, running computations in parallel is recommended. This can significantly improve processing capacity.
For information on the difference between audio and melody fingerprints and the use cases they address, please see our FAQ page
Searching Functionality
Generate Fingerprint
Before performing any searches you need to generate a fingerprint from a media file:
# CREATE AUDIO FINGERPRINT FROM MEDIA FILEft = client.fingerprint_file("/path/to/file.mp3", pex.FingerprintType.AUDIO)# CREATE MELODY FINGERPRINT FROM MEDIA FILEft = client.fingerprint_file("/path/to/file.mp3", pex.FingerprintType.MELODY)# CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft = client.fingerprint_buffer([]byte, pex.FingerprintType.AUDIO)# CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft = client.fingerprint_buffer([]byte, pex.FingerprintType.MELODY)
// CREATE AUDIO FINGERPRINT FROM MEDIA FILEft, err := client.FingerprintFile(inputFile, pex.FingerprintTypeAudio)if err !=nil {panic(err)}// CREATE MELODY FINGERPRINT FROM MEDIA FILEft, err := client.FingerprintFile(inputFile, pex.FingerprintTypeMelody)if err !=nil {panic(err)}// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft, err := client.FingerprintBuffer([]byte, pex.FingerprintTypeAudio)if err !=nil {panic(err)}// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILEft, err := client.FingerprintBuffer([]byte, pex.FingerprintTypeMelody)if err !=nil {panic(err)}
// CREATE AUDIO FINGERPRINT FROM MEDIA FILE$ft = $client->fingerprintFile(INPUT_FILE, [Pex\FingerprintType::Audio]);// CREATE MELODY FINGERPRINT FROM MEDIA FILE$ft = $client->fingerprintFile(INPUT_FILE, [Pex\FingerprintType::Melody]);// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILE$ft = $client->fingerprintBuffer([]byte, [Pex\FingerprintType::Audio]);// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILE$ft = $client->fingerprintBuffer([]byte, [Pex\FingerprintType::Melody]);
// CREATE AUDIO FINGERPRINT FROM MEDIA FILElet ft =awaitclient.fingerprintFile("video.mp4", [pex.AUDIO])// CREATE MELODY FINGERPRINTlet ft =awaitclient.fingerprintFile("video.mp4", [pex.MELODY])// CREATE AUDIO FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILElet ft =awaitclient.fingerprintBuffer([]byte, [pex.AUDIO])// CREATE MELODY FINGERPRINT FROM BYTE BUFFER HOLDING A MEDIA FILElet ft =awaitclient.fingerprintBuffer([]byte, [pex.MELODY])
Note: Our SDK's computations are single-threaded. If you need to process larger volumes of files, running computations in parallel is recommended. This can significantly improve processing capacity.
For information on the difference between audio and melody fingerprints and the use cases they address, please see our FAQ page
Initiate Search
Once the fingerprint has been generated, you are ready to initiate a search:
// THE STARTSEARCH FUNCTION DESCRIBED IN THE PREVIOUS SECTION WILL AUTOMATICALLY RETRIEVE THE RESULTS WHEN THE SEARCH IS COMPLETED
Interpret Search Results
To view details on what's contained in a search response, please see the following section: Search Response
Catalog Management
Add Fingerprint to Custom Database
Now that the fingerprint has been generated, you can add that fingerprint file to your custom database. You can associate a "custom_id" string of your choosing for each fingerprint (to help you uniquely identify each fingerprint that is in your database):
Note: After ingesting an asset, it will take a short time (generally a few minutes) before it is available in your custom database to be searched against
Archive Fingerprint from your Custom Database
If you would like to remove an asset from your Custom Database so that it can no longer be matched against, you can do so with this command:
If you would like to view what assets are currently in your Custom Database, you can do so with the Lister functionality:
lister = client.list_entries(pex.ListEntriesRequest())// To limit the number of entries:// lister = client.list_entries(pex.ListEntriesRequest(limit=5))while lister.has_next_page: entries = lister.list()for entry in entries:print(entry)
lister := client.ListEntries(&pex.ListEntriesRequest{})// To limit the number of entries:// lister := client.ListEntries(&pex.ListEntriesRequest{// Limit: 5,// })for lister.HasNextPage { entries := lister.List()for _, entry :=range entries { fmt.Println(entry) }}
$lister = $client->listEntries(newPex\ListEntriesRequest());// To limit the number of entries:// $lister = $client->listEntries(new Pex\ListEntriesRequest(limit: 5));while ($lister->hasNextPage()) { $entries = $lister->list();foreach ($entries as $entry) {echojson_encode($entry, JSON_PRETTY_PRINT).PHP_EOL; }}
let lister =client.listEntries({});// To limit the number of entries:// let lister = client.listEntries({limit: 5});while (lister.hasNextPage()) {let entries =awaitlister.list();for (constentryof entries) {console.log(entry); }}