A hashdeep/md5tree (but much more) for media files
danodano is a wrapper for ffmpeg that checksums the internal file streams of ffmpeg compatible media files, and stores them in a format which can be used to verify such checksums later. This is handy, because, should you choose to change metadata tags, or change file names, the media checksums should remain the same.
dano? Because FLAC is really cleverTo me, first class checksums are one thing that sets the FLAC music format apart. FLAC supports the writing and checking of the streams held within its container. When I ask whether the FLAC audio stream has the same checksum as the stream I originally wrote to disk, the flac command tells me whether the checksum matches:
➜ flac -t 'Link Wray - Rumble! The Best of Link Wray - 01-01 - 02 - The Swag.flac'
Link Wray - Rumble! The Best of Link Wray - 01-01 - 02 - The Swag.flac: okThe question is -- why don't we have this functionality for video and other media streams? The answer is, of course, we do, (because ffmpeg is incredible!) we just never use it. dano aims to make what ffmpeg provides easier to use.
For lossless files, this means we can confirm that a lossless file decodes to the exact bitstream we encoded, but, for all files, this means our checksums are stable against metadata changes, file name changes, and/or moving a bitstream, or many bitstreams, from one media container into another.
So, for example, when I ask whether a media stream has the same checksum as when I originally wrote it to disk, dano tells me whether the checksum matches:
➜ dano -w 'Sample.mkv'
murmur3=2f23cebfe8969a8e11cd3919ce9c9067 : "Sample.mkv"
➜ dano -t 'Sample.mkv'
"Sample": OK
# Now change our file's name and our checksum still verifies,
# because the checksum is stored in a xattr
➜ mv 'Sample.mkv' 'test1.mkv'
➜ dano -t 'test1.mkv'
"test1.mkv": OK
# Now change our file's metadata and *write a new file in a
# new container* and our checksum is the *same*
➜ ffmpeg -i 'test1.mkv' -metadata author="Kimono" 'test2.mp4'
➜ dano -w 'test2.mp4'
murmur3=2f23cebfe8969a8e11cd3919ce9c9067 : "test2.mp4"dano with my FLAC files?Of course you can. dano will even import your FLAC file's checksums directly:
…I get it! For serious collectors, if you can't verify your checksums later when you change the album art, what use is a checksum?
dano allows you have to store a stable checksum, and verify it later, just like FLAC:
…dano to find duplicate files?If you've ever used fdupes, you know how cool it is. fdupes can recursively search a file tree to discover duplicate files. The only issue is -- what if some of your media files have the same internal bitstreams, but distinct file checksums? Perhaps such bitstreams are contained within different/distinct containers, and/or have different file metadata/tags attached?
dano makes it easy to find such duplicate media, based upon their internal bitstreams:
…Inspired by hashdeep, md5tree, flac, and, of course, ffmpeg.
For Debian-based distributions (like Ubuntu), I maintain a personal package archive, or PPA. See the linked repository for instructions on how to use.
For Debian-based and Redhat-based Linux distributions (like, Ubuntu or Fedora, etc.), check the tagged releases for native packages for your distribution.
You may also create and install your own native package from the latest sources, like so:
➜ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
➜ cargo install cargo-deb
➜ git clone https://github.com/kimono-koans/dano.git
➜ cd ./dano/; cargo deb
# to install on a Debian/Ubuntu-based system
➜ dpkg -i ./target/debian/dano_*.deb
# or convert to RPM
➜ alien -r ./target/debian/dano_*.deb
# and install on a Redhat-based system
➜ rpm -i --replacefiles ./dano*.rpmFor now, dano depends on ffmpeg and metaflac if you want to import FLAC files.
You may install rustup and build dano like so:
➜ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
➜ cargo install danoNote: In addition to what your package manager or OS may provide (for instance, apt install rustc cargo, security-minded users may be interested to know that there are alternative methods for installing the rustc compiler and cargo besides the method described above, which allow you to verify the rustup before install.
Caveat: dano is only tested on MacOS and Linux, and will probably only compile and run on Unix-y Rust supported platforms, but a Windows is version is likely to compile with only minor changes. My further thoughts on a Windows version can be found in this linked issue.
No open issues yet, or sync has not completed.