Search the Community
Showing results for tags 'id3'.
Found 1 result
I was trying to clean up my MP3 collection and was not happy. Not happy because apps claiming to remove all ID3 tags were leaving lots behind. What do geeks do when they are not happy? Yup, do it themselves! It turned out to be MUCH more difficult than I had imagined! ID3V1 are easy, they come at the end of the file and are fixed length. ID3V2 are insane, and can be many times the size of the song itself! Combine that with other re-tagging or tag removal apps doing a bad job at housekeeping and you can have some pretty broken tags. MP3 files are designed to be streamable and are built in packets called frames. The frame headers contain information such as sample rate, samples per frame, bitrate, and padding, and those 4 key pieces of information are used to determine how many bytes the frame will be. Of course it isn't actually that simple, since some of those factors depend on what MPEG version it is and if it is layer 1, 2, or 3. But once you find a good header and can get the frame length, you jump to the next position and check to see if it is a valid header, get the frame length, rinse and repeat. It is suggested to verify at least 3-5 headers but I found that totally insufficient. My collection of nearly 11,000 songs in various encodings showed me that to be reasonably certain that we were out of the ID3V2 madness I had to verify at least 10 headers, but that was often not even enough. I settled on 50 being the default value, and allow 150 verified headers to be REALLY sure. There of course is a time penalty, but it is surprisingly quick - my standard benchmark of 423 songs, some of which have 5 or more ID3V1 tags and ID3V2 tags that go over 300KB deep, only takes 2 and a half minutes verifying 50 frames. Enjoy Ian Edit 9/26/15 - updated code ID3 Clean 1.24.au3