Web Projects Consulting

Ripping a Single Audio Stream from a File or DVD

Valid for Fedora 10.

First get stream information and look which streams are available.

ffmpeg -i [INPUT].avi

When we have an avi (mpeg, mov, mp4) or another simple multimedia file with a single audio track:

ffmpeg -i [INPUT].avi -vn -acodec -ao pcm:fast:file=audio.wav -vc null -vo null

When we have an avi (mp4, mkv) or another multimedia file with multiple audio tracks (use -map option):

ffmpeg -i [INPUT].avi -vn -map 0:1 -acodec -ao pcm:fast:file=audio.wav -vc null -vo null

Ripping a 5.1 ac3 audio track form a multimedia file into a native ac3 format without re-encoding:

ffmpeg -i [INPUT].avi -vn -acodec ac3 -ac 6 -ab 384K -map 0:1 audio.ac3

Ripping an audio track from a DVD:

mplayer dvd:// -v | grep "audio stream" # find audio stream ids
mplayer title.vob -ao pcm:file=audio.wav -vc dummy -aid 128 -vo null

Post-processing of a PCM file:

normalize audio.wav

PCM (2 channels) to ipod’s aac:

neroAacEnc -if audio.wav -of audio.m4a

PCM to MP3:

lame -h audio.wav  audio.mp3

Example of direct ripping into an mp3 file from a multimedia file:

ffmpeg -i [INPUT].mkv -vn -acodec libmp3lame -ac 2 -ab 192K audio.mp3

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.