[CentOS] Re: Capturing audio streams with Linux? -- I try to answer with assumptions (but please RTFM)

Bryan J. Smith b.j.smith at ieee.org
Thu Sep 15 20:32:00 UTC 2005

Preston Crawford <me at prestoncrawford.com> wrote:
> Right now I'm using the command...
> /usr/bin/mplayer -playlist http://<servername>/feed.pls
> -dumpaudio -dumpfile atc.mp3

Again, RTFM.  This isn't an answer that is "use command X
with options Y" non-sense.  Encoding is VERY SUBJECTIVE --
and I make the assumption you are using "lame" as your
encoder!  I've tried to _minimize_ by post as best as I can,
but I'm sure some people will privately (or even publicly)
bitch, moan and otherwise complain.  I ask you to read the
man page, especially the "-lameopts," or you'll have to if
you're not using "lame."


To split files, the option is "-endpos".  You can put it in
terms of hh:mm:ss.mm (integers default to seconds), or bytes
(b), kilobytes (kb) or megabytes (mb).

E.g., to encode files to 1MiB each:  

  /usr/bin/mplayer -endpos 1mb -playlist
http://<servername>/feed.pls -dumpaudio -dumpfile atc.mp3

Now you'll probably have to loop during recording.  E.g.,

  for i in `seq -f %03g 1 100; do
    /usr/bin/mplayer -endpos 1mb -playlist
http://<servername>/feed.pls -dumpaudio -dumpfile atc${i}.mp3

You will probably get dummy, near-0 byte length files at the
end -- or hit Ctrl-C when your program has ended.


Bitrate and fidelity matters on what codec you are using. 
Newer MPlayer releases is using the "lavc" method.  There are
various programs it can use, but "lame" is what I use.  Here
are the options for the "lame" encoder.

  -oac mp3lame

Now you have to talk about the algorithm to the encoding
rate.  This is why I said RTFM.  Assuming you're using lame,
read up the manpage on "-lameopts".  The two base modes I
typically use are constant bit rate (CBR) and average bit
rate (ABR).  ABR is typically recommended, although try CBR
if you have troubles with ABR -- passes might be an issue
with real-time encoding.

Then there is the actual bitrate option in kpbs.

Then there are more subjective quality, algorithm quality,
compression, etc...

So if you just want me to give you a set of options to try,
since it sounds like you're listening to voice, use ABR with
a bit-rate of 64kbps and see how that works.

  -lameopts vbr=3:br=64

Again, there are no less than 30+ options/variables for just
the lame encoder for MP3 under mencoder.  This is highly
subjective, so I leave it to you to explore further.

Bryan J. Smith                | Sent from Yahoo Mail
mailto:b.j.smith at ieee.org     |  (please excuse any
http://thebs413.blogspot.com/ |   missing headers)

More information about the CentOS mailing list