Batch transcoding of mp4 to mp3 using ffmpeg on ubuntu

for vid in *.mp4; do ffmpeg -i "$vid" -vn -acodec libmp3lame -q:a 4 "output/${vid%.mp4}.mp3"; done

Found on http://askubuntu.com/questions/221026/how-can-i-batch-extract-audio-from-mp4-files-with-ffmpeg-without-decompression with own modifications to bitrate based on https://trac.ffmpeg.org/wiki/Encode/MP3