How to compare mp3 programmatically

后端 未结 8 690
南笙
南笙 2020-12-29 00:25

I like to be able to compare mp3’s programmatically. The problem I don’t know by what. Header? Histogram? channels? Does anyone have experience with this subject?

8条回答
  •  醉酒成梦
    2020-12-29 00:47

    I like to be able to compare mp3’s programmatically

    I had the same question. I found that itunes had altered many of my Amazon MP3 downloads, changing the time/date stamps, the file sizes and therefore the MD5 signatures. My backups suddenly had many near duplicate files.

    When I did a VIM diff, I could see that the changes were limited to very small parts of the files. The files looked identical side by side in Audacity even at a close zoom.

    My solution is to create a headerless WAV dump of the mp3 and then compare the MD5 signatures of each WAV. FFMPEG can do the translation quite easily.

    ffmpeg -y -i $mp3 $mp3.wav;
    md5sum $mp3.wav
    

    I created a hash with MD5 as key pointing to the original MP3 file spec. Put the wav file on an SSD for speed.

    Brute force, but it works.

提交回复
热议问题