Extract audio from video with FFmpeg

Extracting audio stream from video file by means of ffmpeg in Linux and Windows.

Example 1. In order to try and ensure to have both video and audio of the same length, both audio and video are extracted without re-encoding in the same ffmpeg call:

ffmpeg -i videoaudio.mp4 -c copy -map 0:v video.mp4 -map 0:a audio.mp3

Example 2. If no bitrate is specified, FFmpeg uses the default rate control mode and bitrate of the encoder. So here bitrate for audio is specified explicitly to be the same as the one of the audio stream in the video file:

ffmpeg -i videoaudio.mp4 -c copy -map 0:v video.mp4 -map 0:a -b:a 64k audio.mp3

More on the subject:

More about ffmpeg:

Operating systems