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.
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:- Beryl in Ubuntu Feisy repositories
- Tremulous: the best open source game I’ve played
- Overclocking ATI Radeon cards in Linux
- HOWTO Encrypt CD/DVDs in Ubuntu
- Festival: Linux Text-To-Speech
- Top 5 Linux Live CD/DVDs
- Ubuntu Customization Guide part I
- New Domain!
- Ultimate Ubuntu performance tweaking guide
- Windows Vista (Aero) VS Linux Ubuntu (beryl)


December 7th, 2007 06:41
I see many people tried to go to my website to probably see the script, but the link here is outdated. The new link is at:
http://www.mohdshakir.net/2007/02/27/shell-script-for-the-day-listen-to-online-radio-offline
Thanks
March 26th, 2008 19:19
You won’t get better quality audio by increasing the bitrate or sampling rate.