For MP3, I strongly suggest using Lame, considered by many (including me) THE best MP3 encoder, specially for VBR:
sudo apt-get install lame
And to encode:
lame -V 5 file.wav file.mp3
This will create a high-quality MP3 VBR file around ~130kbps, which is great for casual listening. Use
-V 3 for average bitrates around ~200kbps.
If you want to create id3v1 and id3v2 tags at the same time, you can use:
lame -V 5 --add-id3v2 --pad-id3v2 --ignore-tag-errors --ta artist --tl album --tt title --tn track --ty year --tg genre --tc comment file.wav file.mp3
For Ogg, the most traditional encoder is Vorbis:
sudo apt-get install vorbis-tools
And to encode:
oggenc -q 3 -o file.ogg file.wav
Ogg is VBR by default.
-q 3 stands for default quality, you may change 3 from -1 to 10, or omit the option. Also, output file is optional. If you omit
-o file.ogg it will automatically create a file with same name as input and .ogg extension. It also supports multiple input files (you can encode several at once, for example, using *.wav).
And for tagging:
oggenc -a artist -t title -l album -G genre -c comment -o file.ogg file.wav
Last but not least, since you seem to be very interested in encoding, an amazing forum for audio technical details and awesome source of knowledge is HydrogenAudio.
And, for GUI, you said it yourself:
soundconverter is a great choice. It does have VBR for MP3 (for Ogg, its the format's default, so don't worry).