Command to extract audio from video without conversion
ffmpeg -i video.mp4 -vn -acodec copy audio.aac
Here’s a short explanation on what every parameter does:
-i
option specifies the input file.-vn
option is used to skip the video part.-acodec copy
will copy the audio stream keeping the original codec.
As a complementary answer, with a command that doesn't need the specific name of the file.
For a video containing aac audio:
ffmpeg -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a
To use in a context menu command, a form like this works:
bash -c 'ffmpeg -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a' %f
Replace with corresponding audio format output for other video format input.
Initial source here.