1.3.0 • Published 1 year ago

sh.ff-fingerprinter v1.3.0

Weekly downloads
60
License
MIT
Repository
github
Last release
1 year ago

FF-FingerPrinter

FF-FingerPrinter is a Node.js-based tool that uses ffmpeg and ffprobe to probe and fingerprint media files (anything that your ffmpeg can read). It supports hashing a media file's chapters and streams (currently video-, audio- and subtitle-streams are supported).

Install from npm Current Version

This package can be installed using the following command: npm install sh.ff-fingerprinter.


This tool can be used as a library in your own project or as a standalone CLI-application. JSDoc-typedefs have been created to model the full output. The library exports the single class FFFingerPrinter and some default configurations. The class makes extensive use of async features.

The purpose is to uniquely identify media files and the streams they contain. This helps to identify duplicates and to avoid ID'ing files based on their names/paths or attributes or timestamps (which can easily be changed). Hashing of streams of a file can be done in parallel.

When hashing, the raw data of each stream is taken and put through a cryptographic hasher, such as sha256 (default). Also, properties of streams are hashed deterministically (sorted). Then, a hash for the whole file is computed and the file itself is analyzed using stat. A remux of a file (containing the same streams as the original) will be ID'ed differently, but the streams' hashes will be identical (look below for an example output).

Command Line Interface (CLI)

Here is how to run FF-FingerPrinter from CLI:

In CLI-mode, a configuration file is used. An example can be found in cli/config.default.js.

Example output

In CLI-mode, FF-Fingerprinter writes its result to stdout while logging what it's doing to stderr, so that you can pipe its JSON-based output to a file.

Some noteworthy details:

  • fingerprint: The hash of the entire file, taking into account all streams' and chapters' hashes. Replicates the value from hashInfo.hashAll.
  • hashWithProps: Is a hash over the streams' hash and its (deterministically) stringified properties. numBytes indicates how many bytes were read to create the hash.
  • The output of ffprobe is fully preserved and additional properties, such as hashInfo and fffVersions are added. Also, the settings (hashConf) used for hashing are preserved, so that the results are repeatable.

Testing

Note that for testing, you need to have ffmpeg and ffprobe installed.

1.3.0

1 year ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.0

6 years ago