llewxam Posted September 20, 2015 Share Posted September 20, 2015 (edited) 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. EnjoyIan Edit 9/26/15 - updated code ID3 Clean 1.24.au3 Edited September 26, 2015 by llewxam My projects: IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged. INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them. PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses. Sync Tool - Folder sync tool with lots of real time information and several checking methods. USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions. Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent. CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction. MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app. 2048 Game - My version of 2048, fun tile game. Juice Lab - Ecigarette liquid making calculator. Data Protector - Secure notes to save sensitive information. VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive. Find in File - Searches files containing a specified phrase. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now