顯示具有 mp3 標籤的文章。 顯示所有文章
顯示具有 mp3 標籤的文章。 顯示所有文章

2010年9月26日 星期日

HowTo - Linux 下如何從 flv 取出聲音成 mp3

  • Use  mplayer
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

Then check out the output:

$ file nodame_theme.mp3

Output:

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

  • Use ffmpeg
$ ffmpeg -i nodame_theme.flv -ab 128 -ar 44100 nodame_theme.mp3
or 
$ ffmpeg -i video.flv -f mp3 -vn -acodec copy carsounds2.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
or
$ ffmpeg -i http://64.236.34.97:80/stream/1005 -ab 128 -ar 44100 smoothjazz.mp3

  • Reference
http://linux.byexamples.com/archives/229/extract-audio-from-video-or-online-stream/

使用 Sound Juicer 將 CD 轉成 MP3

  • Install
$ sudo apt-get install sound-juicer gstreamer0.10-plugins-ugly-multiverse
(instead gstreamer0.10-lame in Ubuntu 10.04) 
  • Configuration for MP3 encoder
Basic one:
audio/x-raw-int,rate=44100,channels=2 ! lame name=enc ! id3mux
Add bit-rate setting:
audio/x-raw-int,rate=44100,channels=2 ! lame name=enc vbr=0 bitrate=128
Advanced one:
audio/x-raw-int,rate=44100,channels=2 ! lame name=enc mode=1 vbr=4 quality=1 preset=1001 vbr-max-bitrate=320 ! xingmux ! id3v2mux
The meat and potatoes of this line is preset=insane, which tells Lame to use the Insane quality preset, and will give you a fixed-bitrate MP3 file at CBR 320Kbps. This preset will usually be overkill for most people and most situations, but if you must have the absolute highest quality with no regard to filesize (as do I), this is the way to go. This is the highest preset quality available. Of course, there are other presets available–all of them variable bitrate (VBR):

preset=medium

This preset should provide near transparency to most people on most music. The resulting bitrate should be in the 150-180kbps range, according to music complexity.

preset=standard

This preset should generally be transparent to most people on most music and is already quite high in quality. The resulting bitrate should be in the 170-210kbps range, according to music complexity.

preset=extreme

If you have extremely good hearing and similar equipment, this preset will provide slightly higher quality than the “standard” mode. The resulting bitrate should be in the 200-240kbps range, according to music complexity.
  • More detail configuration for gstreamer-lamp
$ gst-inspect-0.10 lame

  • Reference
http://wiki.ubuntu-tw.org/index.php?title=HowtoGripMusic
http://www.calebscreek.com/2008/09/howto-enable-mp3-ripping-in-sound-juicer-2220/

Ceasar's Photo

www.flickr.com