The -q flag can use any value between 0 and 1, with 1 being highest-quality; according to this, 0.55 averages to a bit rate of 192 kb/s; a lower -q of around 0.4 would probably actually be perfectly suitable for most music listening. Experiment to find out what works best for you.

Unfortunately, this won't keep the metadata; but you can transfer the metadata from input.ogg to output.m4a with a second command:

This is really a comment, not an answer to the question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.
–
Mitch♦Aug 21 '12 at 9:58

@AAC Even better, you could expand this answer to explain how to obtain foobar2000, how to get it working in Ubuntu with Wine (since it's a Windows program), and specifically how to use it to convert files (screenshots would be a plus, too).
–
Eliah KaganAug 22 '12 at 8:28