Find iTunes songs with specific format (MPEG 1, Layer 2)

itunes

Recently I discovered that my iTunes Library contains songs with the MPEG-1, Layer 2 format.
It's impossible to sync them to my iPod. So I want to convert them to AAC or MP3.
But therefor I need a list of all songs that have that format.

Is there any way to get a list of all MPEG-1 Layer 2 formatted tracks in my iTunes library? To make things a little bit harder, they all have mp3 as extension.

Best Answer

If the files have mp3 as the extension, mdfind kMDItemContentType==public.mp2 or searching for kind:mp2 in Finder won't work either.

You could try using mplayer's command line utility. It can be installed with Homebrew or other package managers.

IFS=$'\n'; for f in $(find ~/Music -name *.mp3); do mplayer -identify -frames 0 "$f" 2> /dev/null | grep -q 'layer-2 audio' && echo mv "$f" ~/Desktop/; done