1

I have 120,000 MIDI files. A couple hundred of them are corrupted. So far I have been able to identify some of those, playing them one by one with two different media players (Foobar 2000 and Van Basco's Karaoke Player). Both players report that the file can't be played because is corrupted.

Since I'm talking about hundreds of files, it is very time-consuming doing it that way. I'm not necessarily looking to fix them, I just want to identify them. Is there a way to identify corrupted MIDI files in batch?

I can work with Linux or Microsoft Windows. I can't use MacOS though.

3d1l
  • 493

1 Answers1

1

Wanted to at least give you something to try.

Try using the file command. I created a fake midi for comparison on output.

file *.mid 

OR

file -i *.mid

fake_rename.mid: XML 1.0 document, Unicode text, UTF-8 text, with very long lines (65359), with no line terminators MIDI_sample.mid: Standard MIDI data (format 1) using 6 tracks at 1/480

Creating a one-liner or script to move/remove bad files will take a little work.

Found this one-liner that can possibly be modified to fit MIDI

find <your_recovery_drive_mount_point> -iname '*.mp3' | while read f; do echo "mplayer -ss 10 -endpos 1  '${f}' | grep -iq failed && echo '${f}' >> bad.lst" >> check.sh ; done

How can I find and delete corrupt files on Linux?

Czar
  • 262