Tuesday, 26 December 2017

Linux script to cleanse unwanted MP3 tags

After making a copy of my CD collection converted from FLAC to MP3, I found it failed to play in a 5-year-old car stereo on a USB stick... My Ford Focus SYNC car stereo said "Indexing USB" for about an hour, then eventually said "Bad USB Media".  (Sync is "powered by microsoft" which probably explains its general crapiness).

From web searches, apparently some MP3 taggers include cover art and other crazy tags, which can confuse the Ford car stereos. Maybe my FLAC-to-MP3 script pulled in some such tags (as it seemed to go to internet to pull tag data).

So here's a quick and dirty Ubuntu script to iterate over my entire MP3 collection and rip out any dicey looking tags.

strip_unwanted_id3_tags.sh

for TAG in TCOP APIC PRIV TXXX TCOP MCDI POPM TCON TDAT TENC TLEN TPUB TSSE WXXX
do
   echo Stripping tag $TAG from all MP3 files below current folder...
   find . -name *.mp3 -exec id3v2 -r $TAG  '{}' \; >/dev/null
done

The list of tags to remove came by using 'id3v2' to examine the entire collection, removing the more rarely used tags plus the album art ones.   

This seems to make my Ford Focus accept the 128GB FAT32 USB stick. In early testing however it has failed to play tracks in correct order - grrr....

By contrast a VW car stereo of a similar age (their RNS 315 unit) accepted the original unaltered MP3 files on a 128GB FAT32 SD card and just worked!  Much more impressive...

No comments:

Post a Comment

Spammers: please stop wasting my time. All comments are moderated before publication.