Bulk extract audio files from video files using FFMPEG

Do you ever have a bunch of videos but you really only want the audio from them? This article shows a very fast and free method using FFMPEG to losslessly extract AAC (m4a) audio from videos (mp4). This is a bash function.
function ffextractaudiofromvideos() {
  if [[ $# -eq 0 ]] ; then
    echo 'Please specify a folder containing .mp4 videos that have an AAC audio stream. ie: "ffextractaudiofromvideos ~/Movies/videos"'
    cd "$1"
    for i in "$1"*.mp4; do
        [ -f "$i" ] || break
      ffmpeg -i "$i" -vn -acodec copy "${i%.mp4}".m4a

Internal References

External References

Article Type