
Simply reference the stream id with the -map option in the following format.įfmpeg -i video.mkv -map 0:1 -acodec pcm_s16le -ac 2 audio.wav Stream #0.1 and #0.3 are both audio streams, but #0.1 is English AC3 5.1 and #0.3 is Hebrew MP3 stereo.

Stream #0.3(heb): Audio: mp3, 48000 Hz, stereo, s16Īt least one output file must be specifiedįrom the example above, you see that Stream #0.0 is labeled as being an English video stream with h264 encoding. If you want more control over which stream you are using, first identify them all with ffmpeg.ĭuration: 01:30:38.78, start: 0.000000, bitrate: N/A For example, you may have both English AC3 and DTS channels, but you may also have other audio streams for other languages, directors comments, etc. It should also be mentioned that your source video file may have multiple audio channels or streams.

This very well could have been an AVI, MPEG, or any other video format that FFmpeg can decode.įfmpeg -i video.mkv -acodec pcm_s16le -ac 2 audio.wav Here’s an example of extracting the audio from a video file called video.mkv and saving it to a file called audio.wav. Another method using FFmpeg instead of Mplayer was also pointed out in the post titled Add Stereo Audio Tracks to MKV Files, and I figured it would be useful to outline the quick one-step process in a post all by itself. Previously, I described how to Extract Audio from Video Files to WAV using Mplayer.

Posted by admin on Decemunder Tech Tips | Read the First Comment Extract Audio from Video Files to WAV using FFmpeg
