MP3 is a managed format. A license fee must be paid to either Fraunhofer or Thomson for the purpose of encoding MP3 using their technology. They are the mommy and daddy of the format.
There is an open source encoder available called LAME. The free Audacity audio production program makes you download and use LAME in order to produce MP3-compliant files. If they did it internally, Audacity couldn't be free.
I have an audio program that has a Fraunhofer license. The control panels read a lot like MPEG2. You can choose all sorts of quality and shortcut values.
LAME, on the other hand, has those controls, too, but can be a little scattered as befits an open source project. LAME is reputed to work really well at high quality levels blowing everybody else out of the water. At low quality or small file sizes, you might want a Fraunhofer license.
The reason I bring all this up is that LAME will run from the command line:
> lame myfile.aiff myfile.mp3 -h [enter]
That will produce one high quality MP3 file and I don't see any reason you can't put batch commands in there to run on multiple files by itself.
Koz