dano

dano is a powerful tool that acts as a wrapper for ffmpeg, designed to checksum the internal file streams of ffmpeg compatible media files. This checksum is stored in a format that can be used to verify the media files later, ensuring that changes to metadata tags or file names do not affect the checksum integrity. This functionality is particularly useful for maintaining data integrity across media libraries.

Key Features

  • Non-media path filtering (optional)
  • Highly concurrent hashing with customizable thread count
  • Multiple operational modes: WRITE, TEST, PRINT, DUMP, and DUPLICATES
  • Supports various checksum algorithms including murmur3, MD5, adler32, CRC32, SHA160, SHA256, and SHA512
  • Option to decode the stream before executing the hash function
  • Write checksums to xattrs or a hash file, and read back from both

Why Use dano?

The inspiration behind dano comes from the FLAC audio format, which supports the writing and checking of the streams held within its container. The question arose: why isn't this functionality available for other media formats? With ffmpeg's capabilities, it is possible but often underutilized. dano bridges this gap by making ffmpeg's functionalities more accessible.

For lossless files, dano confirms that a file decodes to the exact bitstream originally encoded. For all files, checksums remain stable against changes such as metadata alterations, file name changes, or moving bitstreams between different media containers.

Use Cases

Checksum Verification

dano ensures that media stream checksums remain consistent:

 dano -w 'Sample.mkv'
murmur3=2f23cebfe8969a8e11cd3919ce9c9067 : "Sample.mkv"
 dano -t 'Sample.mkv'
"Sample.mkv": OK

File Renaming

Changing file names does not affect checksum verification:

 mv 'Sample.mkv' 'test1.mkv'
 dano -t 'test1.mkv'
"test1.mkv": OK

Metadata Changes

Changing metadata or re-encoding into a new container retains the same checksum:

 ffmpeg -i 'test1.mkv' -metadata author="Kimono" 'test2.mp4'
 dano -w 'test2.mp4'
murmur3=2f23cebfe8969a8e11cd3919ce9c9067 : "test2.mp4"

FLAC File Support

dano can import FLAC file checksums directly:

 dano --import-flac 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac'
MD5=fed8052012fb6d0523ef3980a0f6f7bd : "Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac"
 metaflac --show-md5sum 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac'
fed8052012fb6d0523ef3980a0f6f7bd
 dano -t 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac'
"Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac": OK

ALAC File Support

dano can also handle ALAC files:

 ffmpeg -i 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac' -acodec alac 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.m4a'
 dano -w --only=audio --decode --hash-algo=md5 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.m4a'
MD5=fed8052012fb6d0523ef3980a0f6f7bd : "Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.m4a"
 dano -t "Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.m4a"
"Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.m4a": OK

Finding Duplicate Files

dano helps find duplicate media files based on internal bitstreams:

 cp 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac' 'Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance-copy1.flac'
 dano -w -x ./*
 find . -type f | dano --dupes
murmur3=ff95fc73a64ace424964f30af3ed932 : "./Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance-copy1.flac"
murmur3=ff95fc73a64ace424964f30af3ed932 : "./Pavement - Wowee Zowee_ Sordid Sentinels Edition - 02-02 - 50 - We Dance.flac"
WARN: Duplicates found.

Inspired By

dano draws inspiration from tools like hashdeep, md5tree, flac, and ffmpeg.

Check out the GitHub repository for more details and installation instructions.

Similar Projects

Rustfinity.com

Links

  1. Home
  2. Learn Rust
  3. Get Started
  4. Practice Rust
  5. Challenges
  6. Tutorials
  7. Blog
  8. Open source
  9. Learn Gleam

Socials

  1. GitHub
  2. X

Legal

  1. Privacy Policy
  2. Terms of Service