Is it possible to make iTunes write rating on the file itself?
If anyone else needs something like this I wrote a quick piece of code using Qt 5.4 and taglib 1.14.0 that reads the iTunes database and writes the play count and rating into each mp3 file. You'll have to build it yourself or download the binary; it seems to work for me: https://github.com/carlonluca/ITunesEmbed. Backup your library before using it.