[root@fitPC2i ~]# yum list | grep lame
yum -y install lame
●mp3エンコーダ『lame』の取得
[[taro@fitPC2i lame]$ wget http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz/download
:
●『lame』の解凍 ▼
[taro@fitPC2i lame]$ ll 合計 1412 -rw-rw---- 1 taro apache 1445348 2月 29 04:00 2012 lame-3.99.5.tar.gz [taro@fitPC2i lame]$ tar zxvf lame-3.99.5.tar.gz : [taro@fitPC2i lame]$ ll 合計 1416 drwxr-x--- 15 taro apache 4096 2月 29 03:56 2012 lame-3.99.5 -rw-rw---- 1 taro apache 1445348 2月 29 04:00 2012 lame-3.99.5.tar.gz
●『lame』のコンパイル
[taro@fitPC2i lame]$ cd lame-3.99.5
[taro@fitPC2i lame-3.99.5]$ ./configure
:[taro@fitPC2i lame-3.99.5]$ su
パスワード:
[root@fitPC2i lame-3.99.5]# make install
Making install in mpglib
:
[root@fitPC2i lame-3.99.5]# exit
exit
●インストール完了
[root@fitPC2i lame-3.99.5]# cd ~/
[taro@fitPC2i ~]$ which lame
/usr/local/bin/lame
●コマンドの使い方
[taro@fitPC2i ~]$ lame --longhelp
LAME 32bits version 3.99.5 (http://lame.sf.net)usage: lame [options] <infile> [outfile]
<infile> and/or <outfile> can be "-", which means stdin/stdout.
RECOMMENDED:
lame -V2 input.wav output.mp3OPTIONS:
Input options:
--scale <arg> scale input (multiply PCM data) by <arg>
--scale-l <arg> scale channel 0 (left) input (multiply PCM data) by <arg>
--scale-r <arg> scale channel 1 (right) input (multiply PCM data) by <arg>
--mp1input input file is a MPEG Layer I file
--mp2input input file is a MPEG Layer II file
--mp3input input file is a MPEG Layer III file
--nogap <file1> <file2> <...>
gapless encoding for a set of contiguous files
--nogapout <dir>
output dir for gapless encoding (must precede --nogap)
--nogaptags allow the use of VBR tags in gapless encodingInput options for RAW PCM:
-r input is raw pcm
-x force byte-swapping of input
-s sfreq sampling frequency of input file (kHz) - default 44.1 kHz
--bitwidth w input bit width is w (default 16)
--signed input is signed (default)
--unsigned input is unsigned
--little-endian input is little-endian (default)
--big-endian input is big-endian
Operational options:
-a downmix from stereo to mono file for mono encoding
-m <mode> (j)oint, (s)imple, (f)orce, (d)ual-mono, (m)ono (l)eft (r)ight
default is (j) or (s) depending on bitrate
joint = joins the best possible of MS and LR stereo
simple = force LR stereo on all frames
force = force MS stereo on all frames.
--preset type type must be "medium", "standard", "extreme", "insane",
or a value for an average desired bitrate and depending
on the value specified, appropriate quality settings will
be used.
"--preset help" gives more info on these
--comp <arg> choose bitrate to achieve a compression ratio of <arg>
--replaygain-fast compute RG fast but slightly inaccurately (default)
--replaygain-accurate compute RG more accurately and find the peak sample
--noreplaygain disable ReplayGain analysis
--clipdetect enable --replaygain-accurate and print a message whether
clipping occurs and how far the waveform is from full scale
--flush flush output stream as soon as possible
--freeformat produce a free format bitstream
--decode input=mp3 file, output=wav
--swap-channel swap L/R channels
-t disable writing wav header when using --decode
Verbosity:
--disptime <arg>print progress report every arg seconds
-S don't print progress report, VBR histograms
--nohist disable VBR histogram display
--quiet don't print anything on screen
--silent don't print anything on screen, but fatal errors
--brief print more useful information
--verbose print a lot of useful informationNoise shaping & psycho acoustic algorithms:
-q <arg> <arg> = 0...9. Default -q 5
-q 0: Highest quality, very slow
-q 9: Poor quality, but fast
-h Same as -q 2. Recommended.
-f Same as -q 7. Fast, ok quality
CBR (constant bitrate, the default) options:
-b <bitrate> set the bitrate in kbps, default 128 kbps
--cbr enforce use of constant bitrateABR options:
--abr <bitrate> specify average bitrate desired (instead of quality)VBR options:
-V n quality setting for VBR. default n=4
0=high quality,bigger files. 9=smaller files
-v the same as -V 4
--vbr-old use old variable bitrate (VBR) routine
--vbr-new use new variable bitrate (VBR) routine (default)
-Y lets LAME ignore noise in sfb21, like in CBR
-b <bitrate> specify minimum allowed bitrate, default 32 kbps
-B <bitrate> specify maximum allowed bitrate, default 320 kbps
-F strictly enforce the -b option, for use with players that
do not support low bitrate mp3
-t disable writing LAME Tag
-T enable and force writing LAME Tag
MP3 header/stream options:
-e <emp> de-emphasis n/5/c (obsolete)
-c mark as copyright
-o mark as non-original
-p error protection. adds 16 bit checksum to every frame
(the checksum is computed correctly)
--nores disable the bit reservoir
--strictly-enforce-ISO comply as much as possible to ISO MPEG spec
--buffer-constraint <constraint> available values for constraint:
default, strict, maximumFilter options:
--lowpass <freq> frequency(kHz), lowpass filter cutoff above freq
--lowpass-width <freq> frequency(kHz) - default 15% of lowpass freq
--highpass <freq> frequency(kHz), highpass filter cutoff below freq
--highpass-width <freq> frequency(kHz) - default 15% of highpass freq
--resample <sfreq> sampling frequency of output file(kHz)- default=automatic
ID3 tag options:
--tt <title> audio/song title (max 30 chars for version 1 tag)
--ta <artist> audio/song artist (max 30 chars for version 1 tag)
--tl <album> audio/song album (max 30 chars for version 1 tag)
--ty <year> audio/song year of issue (1 to 9999)
--tc <comment> user-defined text (max 30 chars for v1 tag, 28 for v1.1)
--tn <track[/total]> audio/song track number and (optionally) the total
number of tracks on the original recording. (track
and total each 1 to 255. just the track number
creates v1.1 tag, providing a total forces v2.0).
--tg <genre> audio/song genre (name or number in list)
--ti <file> audio/song albumArt (jpeg/png/gif file, v2.3 tag)
--tv <id=value> user-defined frame specified by id and value (v2.3 tag)
--add-id3v2 force addition of version 2 tag
--id3v1-only add only a version 1 tag
--id3v2-only add only a version 2 tag
--id3v2-utf16 add following options in unicode text encoding
--id3v2-latin1 add following options in latin-1 text encoding
--space-id3v1 pad version 1 tag with spaces instead of nulls
--pad-id3v2 same as '--pad-id3v2-size 128'
--pad-id3v2-size <value> adds version 2 tag, pad with extra <value> bytes
--genre-list print alphabetically sorted ID3 genre list and exit
--ignore-tag-errors ignore errors in values passed for tagsNote: A version 2 tag will NOT be added unless one of the input fields
won't fit in a version 1 tag (e.g. the title string is longer than 30
characters), or the '--add-id3v2' or '--id3v2-only' options are used,
or output is redirected to stdout.Misc:
--license print License information
MPEG-1 layer III sample frequencies (kHz): 32 48 44.1
bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320MPEG-2 layer III sample frequencies (kHz): 16 24 22.05
bitrates (kbps): 8 16 24 32 40 48 56 64 80 96 112 128 144 160MPEG-2.5 layer III sample frequencies (kHz): 8 12 11.025
bitrates (kbps): 8 16 24 32 40 48 56 64
●例:モノラル、ID3タグ アーチスト名 "TOKYO FM"、固定ビットレート48kbps
[taro@fitPC2i ~]$ lame -b 48 -m m --ta "TOKYO FM" AD13051423.wav
LAME 3.99.5 32bits (http://lame.sf.net)
Resampling: input 44.1 kHz output 32 kHz
Using polyphase lowpass filter, transition band: 10968 Hz - 11355 Hz
Encoding AD13051423.wav to AD13051423.mp3
Encoding as 32 kHz single-ch MPEG-1 Layer III (10.7x) 48 kbps qval=3
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
99914/99914 (100%)| 7:31/ 7:31| 7:34/ 7:34| 7.9694x| 0:00
-------------------------------------------------------------------------------
kbps mono % long switch short %
48.0 100.0 94.1 3.2 2.7
Writing LAME Tag...done
ReplayGain: -15.3dB
モノラルなので固定ビットレートは通常の半分。
『午後のこーだ』に比べ、エンコードはかなり遅い。モノラル1時間で7分31秒。
(Win7稼動時のパフォーマンス評価、プロセッサ2.3、メモリ4.3、ハードディスク4.2)
●環境
CentOS release 6.2 (Final)