FFmpeg is a free software project that produces libraries and programs for handling multimedia data.

 wav to mp3
ffmpeg -i input.wav -codec:a libmp3lame -qscale:a 2 output.mp3

 m4a to mp3
ffmpeg -i input.m4a -acodec libmp3lame -ab 128k output.mp3

 extract sound from video to mp3
ffmpeg -i input.avi -vn -ar 44100 -ac 2 -ab 192k -f mp3 output.mp3

 trim audio
starts at 10" | ends at 16"
ffmpeg -i input.format -ss 10 -t 6 -acodec copy output.format
trim from 00:02:14 to end of file
ffmpeg -i input.format -ss 00:02:14 -acodec copy output.format
trim from 00:02:14 for 5min
ffmpeg -i input.format -ss 00:02:14 -t 300 -acodec copy output.format

 avi to mp4
ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

 mov to mp4
ffmpeg -i input.mov -qscale 0 output.mp4

 gif controls
ffmpeg -i input.gif -f mpegts output.ts
ffmpeg -i "concat:input01.ts|input01.ts" -pix_fmt rgb8 output.gif

 I wanna go home
     just get me back
        get me outta here