extract audio from video or online stream

You can easily extract audio from video files such as avi, mpg, even flv! into mp3 uses either mplayer or ffmpeg. You can even record online stream into mp3, such as stream from radio cast.

Lets begin with mplayer. To extract audio from video files, use -dumpaudio option and specified the output filename with -dumpfile

mplayer -dumpaudio nodame_theme.flv -dumpfile nodame_theme.mp3

Okay check out the output:

file nodame_theme.mp3

Output:

MPEG ADTS, layer III, v2,   8 kBits, 22.05 kHz, Monaural

Okay, The audio extracted from flv, so quality is quite low, haha. But you can change the audio rate by using ffmpeg. Let see how to use ffmpeg.

ffmpeg -i nodame_theme.flv -ab 128 -ar 44100 nodame_theme.mp3

-i is to specified input file, -ab audio bitrate, -ar audio sampling frequency

Let say what file tells you.

MPEG ADTS, layer II, v1, 128 kBits, 44.1 kHz, Monaural

How about record online stream?
First, find an online radio cast to try, you can have plenty of it from shoutcast.

mplayer -dumpstream http://64.236.34.97:80/stream/1005 -dumpfile smoothjazz.mp3
ffmpeg -i http://64.236.34.97:80/stream/1005 -ab 128 -ar 44100 smoothjazz.mp3

Thanks to Mohd Shakir, you can make it a script for stream recording.

(linux.byexamples.com)



Thank you for reading this post. You can now Read Comments (2) or Leave A Trackback.

Post Info

This entry was posted on Thursday, March 1st, 2007 and is filed under Uncategorized.

You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.



Previous Post: Run Windows Apps on Linux using 2X ApplicationServer »
Next Post: Fedora 7 Test 2 Released »

Read More

Related Reading:

2 Responses to “extract audio from video or online stream



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.