Tip extracting audio from video file

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

There are few simple ways to extract audio from various types of video files (mpeg, avi, divx etc).

Use Mediainfo command line to find out the audio-stream information of the video file.

[edit] Using ffmpeg

ffmpeg -i video_file -f mp3 audio_file.mp3

In order to specify a different bit rate for your output file, use the -ab switch (in Kb/s).

ffmpeg -ab 192 -i video_file -f mp3 audio_file.mp3

[edit] Using mplayer

mplayer -dumpaudio -dumpfile audio_file.mp3 video.avi

That is, if the audio stream is in mp3 format. If it isn't, change extension appropriately.

Personal tools