> > Never mind the fact that MP3 is an assymmetric
> > compression - Doing the compression is (at least in computer terms)
[quoted text clipped - 7 lines]
> I'm not sure what century your posting from, but as of 2005, computers
> have had enough power to encode MP3 in realtime for several years.
With all due respect, Mike, I ain't buying that. Perhaps in part because
I've seen *ZERO* evidence of any such capability, even on "top of the
line" Wintel boxes running at multiple GHz clockrates.
> Realtime MP3 encoding is done routinely for internet radio stations
Uh-uh... I ain't buying THAT one, either. When I gave up on "internet
radio", it was mainly because the sound quality was so abysmally
horrible that I couldn't stand to listen to it for more than a couple of
minutes. And *NONE* of the applications involved knew MP3 from
marshmallows. Every single one of them used its own (proprietary, no
less) streaming codec that made whatever was playing sound like a
tin-=can-and-string telephone in an echo chamber.
> (just look at the Radio "playlist" in iTunes)
I don't do iTunes (or any of the other "iWhatever" perversions), so I
have no clue what you're talking about when you mention the "Radio
playlist", but you're going to have a damn hard time convincing me that
*ANY* machine or program is capable of doing MP3 compression quick
enough to be used as a realtime stream source without hideous mangling
on the receiving end of things.
> and even my poor, pokey G4/400 was
> able to encode MP3s at 3-4x realtime rate using iTunes
I'm thinking we both need to step back and take a look at what we're
each calling "realtime" - For the record, I'm saying that realtime means
"the encoding happens in a span of time only slightly longer than it
would take to simply play the raw data".
For instance, if I push an AIFF file that takes 3:26 to play into an
encoder that wants to be considered "realtime", that encoder's going to
have to spit out a finished MP3 file damn close to 3:26 (give or take
5-10 seconds to allow for filesystem access overhead and the like) after
I hand it the data.
If it doesn't, it's NOT what I'd consider calling a realtime encoder,
regardless of how fast it might be.
In other words, if I shove a file into the encoder, I'll be able to play
the output - straight from the encoder - without ever knowing there was
an encoding step involved. (unless, of course, my ears are sharp enough
to pick up on any artifacts that the encoding produces)
> , which is not
> considered a particularly speedy MP3 encoder. Realtime MP3 encoding is not
> only not insane, it's routine.
I'm still not buying.
As of *RIGHT THIS INSTANT*, I've got an AIFF file being packed down into
MP3 in the background. It's about 2/3 done, and has already been "in
progress" for *AT LEAST* 10 times the playback duration of the source
file, if not more, and I expect that by the time it finishes, the total
"time to compress" will be in the neighborhood of 15-20 times the
playback duration of the piece. This is on a G4/300. Trying to stream it
out to somebody "realtime" would not only be insanity, but stark-raving
madness at the receiving end - a second or three of sound, followed by
lots of dead air, followed by a few seconds of sound, followed by lots
of dead air, lather, rinse, repeat...
That's assuming the networking code can "get a word in edgewise" to
actually send the data over the wire...
No clue about iTunes and its performance, but the MP3 encoder plugin
that I use is the quickest thing I've personally encountered for making
MP3s on a Mac.
I suspect that they're all pretty similar, since last time I looked into
the concept, there was only one "core" MP3 encoder that could be had -
legally, anyway - and it didn't come in source-code form that would
allow tweaking - It was a handful of ".h" files and a precompiled
library for <platform X> that you bought a license (and god, what a high
price-tag...) to be able to call into. NO "tweaking", "unrolling", or
other optimization possible. Basically, a "black box" that you pumped
the raw audio data and a couple of "compress it this much and put the
result here" parameters into, and waited for it to spit out MP3
compressed data.
Which should mean that, unless things have changed radically (which I
think highly unlikely due to the whole patent issue) most, if not all,
MP3 encoders are effectively running the same core code, with any speed
differences attributable solely to the following:
o hardware type (Some boxes don't do "circular shift left", aka "cshl",
natively ferinstance, which means that code that's heavy on that
operation has to "fake it", usually at a major speed penalty - Others
have a native cshl machine-language instruction that makes it possible
for the same code runing on that hardware to beat the pants off the
machine that lacks a native "cshl")
o clock speed (It should go without saying that an 800 MHz processor is
going to get the job done quicker than a 300)
o compression amount (More compression = more time doing the
compressing).

Signature
Don Bruder - dakidd@sonic.net - New Email policy in effect as of Feb. 21, 2004.
Short form: I'm trashing EVERY E-mail that doesn't contain a password in the
subject unless it comes from a "whitelisted" (pre-approved by me) address.
See <http://www.sonic.net/~dakidd/main/contact.html> for full details.
Michael Ash - 21 Jan 2005 19:26 GMT
>> > Never mind the fact that MP3 is an assymmetric
>> > compression - Doing the compression is (at least in computer terms)
[quoted text clipped - 11 lines]
> I've seen *ZERO* evidence of any such capability, even on "top of the
> line" Wintel boxes running at multiple GHz clockrates.
Then you aren't looking hard enough, or even looking at all.
>> Realtime MP3 encoding is done routinely for internet radio stations
>
[quoted text clipped - 5 lines]
> less) streaming codec that made whatever was playing sound like a
> tin-=can-and-string telephone in an echo chamber.
Please see one of these URLs:
http://www.shoutcast.com/
http://www.rogueamoeba.com/nicecast/
The latter is a Mac OS X product that exists for the sole purpose of
taking arbitrary audio output from your Mac and streaming it over the
internet. This is somewhat contradictory with your claims that this is
impossible.
And google for MP3 streaming servers, you'll get about a zillion hits.
Internet radio over MP3 is not a hypothetical thing, it is real, it is
here, it is *now*, and it has been for years.
>> (just look at the Radio "playlist" in iTunes)
>
[quoted text clipped - 4 lines]
> enough to be used as a realtime stream source without hideous mangling
> on the receiving end of things.
Will 422 pages of servers that are streaming MP3 in realtime on
shoutcast.com convince you? Granted, most of them are probably streaming
pre-encoded MP3s, but quite a few of them will be streaming live.
Before they started giving me mono sound, I used to occasionally listen to
Virgin Radio's internet stream. 128kbps MP3, encoded live, even with the
ads and the DJ, in real time.
If you don't believe that it's possible, that's very strange, because it's
all over the place and being used constantly.
>> and even my poor, pokey G4/400 was
>> able to encode MP3s at 3-4x realtime rate using iTunes
[quoted text clipped - 3 lines]
> "the encoding happens in a span of time only slightly longer than it
> would take to simply play the raw data".
If the encoding happens in a span of time that's 3-4 times shorter than it
would take to simply play the raw data, it doesn't count?
> For instance, if I push an AIFF file that takes 3:26 to play into an
> encoder that wants to be considered "realtime", that encoder's going to
> have to spit out a finished MP3 file damn close to 3:26 (give or take
> 5-10 seconds to allow for filesystem access overhead and the like) after
> I hand it the data.
At 3-4x realtime, this 3:26 AIFF would be encoded in about one minute. If
you don't like the fact that it's much faster, you can always put in
artificial delays, so that shouldn't be a problem.
> If it doesn't, it's NOT what I'd consider calling a realtime encoder,
> regardless of how fast it might be.
If your encoder can go faster than 1:1 (which most of them can on anything
vaguely resembling modern hardware) then you can make it realtime by
simply buffering it enough to smooth over any bumps. This buffer does not
need to be large with a standard encoder.
> In other words, if I shove a file into the encoder, I'll be able to play
> the output - straight from the encoder - without ever knowing there was
> an encoding step involved. (unless, of course, my ears are sharp enough
> to pick up on any artifacts that the encoding produces)
That basically describes how it happens. With internet radio, it works
exactly like this except that the encoding computer may be on the other
side of the planet. Unless your connection can't handle the data rate, you
don't notice.
>> , which is not
>> considered a particularly speedy MP3 encoder. Realtime MP3 encoding is not
[quoted text clipped - 12 lines]
> lots of dead air, followed by a few seconds of sound, followed by lots
> of dead air, lather, rinse, repeat...
A G4/300? I don't believe Apple ever shipped anything slower than 350, are
you sure about that?
Anyway, I performed an experiment similar to your setup. I found a CD, and
took a 4:22 track on that CD. I converted it to a 128kbps MP3 using
iTunes, and timed the wall clock time. This time also counted the time it
took me to switch to iTunes and perform the drag that initiated the
conversion. I also had iTunes set up to play the file while it was
importing, which will slow things down. The total time was... are you
ready for it? A hair over twenty-eight seconds. This is ten times faster
than playback rate. With this kind of encoding speed, you could move
regular human speech into the inaudible range on the receiving end. Of
course, you can also just insert some delays so it comes out at the same
frequency it went in.
The above test was performed on a PowerBook G4/1.5GHz. You can find plenty
of computers that will happily boot OS 9 and are not ten times slower. I'm
sure your "G4/300" is not ten times slower.
> That's assuming the networking code can "get a word in edgewise" to
> actually send the data over the wire...
The amount of CPU power required to stream 16kB/sec is laughably small
by comparison. This won't be a factor.
> No clue about iTunes and its performance, but the MP3 encoder plugin
> that I use is the quickest thing I've personally encountered for making
> MP3s on a Mac.
Then again, you are apparently not looking very hard.
> I suspect that they're all pretty similar, since last time I looked into
> the concept, there was only one "core" MP3 encoder that could be had -
[quoted text clipped - 6 lines]
> result here" parameters into, and waited for it to spit out MP3
> compressed data.
There are plenty of legal MP3 encoders out there that are written from
scratch. Of course, the authors of them pay a licensing fee to the MP3
people, but your assertion that there's only one legal MP3 encoder that's
a black box is completely wrong. MP3 won the digital audio format wars
precisely because its patent owners were relatively open with their
licensing.
Larry - 26 Jan 2005 01:39 GMT
> http://www.rogueamoeba.com/nicecast/
can anyone post a chunk of code to deal with quicktime api?
David Phillip Oster - 26 Jan 2005 16:36 GMT
> can anyone post a chunk of code to deal with quicktime api?
<http://www.google.com/search?q=sample+code+sequence+grabber>
Charlton Wilbur - 21 Jan 2005 19:29 GMT
>>>>> "DB" == Don Bruder <dakidd@sonic.net> writes:
DB> I don't do iTunes (or any of the other "iWhatever"
DB> perversions), so I have no clue what you're talking about when
DB> you mention the "Radio playlist", but you're going to have a
DB> damn hard time convincing me that *ANY* machine or program is
DB> capable of doing MP3 compression quick enough to be used as a
DB> realtime stream source without hideous mangling on the
DB> receiving end of things.
Eppur si muove, buddy.
On my nearly 5-year-old iMac DV+, running a G3 at a measly 450MHz, I
can encode MP3s from CDs at a rate of encoding 2 to 3 seconds per
second of processing. This is sufficient to make it a realtime stream
source -- and that's a computer that turns 5 this June.
On my Powerbook, it encodes somewhere between 7 and 8 seconds of music
per second of processing, and that's a computer that will turn 2 in March.
DB> I'm thinking we both need to step back and take a look at what
DB> we're each calling "realtime" - For the record, I'm saying
DB> that realtime means "the encoding happens in a span of time
DB> only slightly longer than it would take to simply play the raw
DB> data".
If you're willing to accept "the encoding happens in a span of time
substantially *less* that it would take to simply play the raw data",
this is entirely possible now.
DB> As of *RIGHT THIS INSTANT*, I've got an AIFF file being packed
DB> down into MP3 in the background. It's about 2/3 done, and has
DB> already been "in progress" for *AT LEAST* 10 times the
DB> playback duration of the source file, if not more, and I
DB> expect that by the time it finishes, the total "time to
DB> compress" will be in the neighborhood of 15-20 times the
DB> playback duration of the piece. This is on a G4/300.
This directly contradicts what I've seen with my own eyes. A couple
days back I compressed about three hours of AIFF audio to 320Kbps AAC
on the iMac, and it took a little over an hour. I don't know what's
going on with your setup that would make a G4/300 take 30 to 45 times
as long to encode MP3s as it takes a G3/450 to encode AACs (memory? OS
overhead?), but it's probably worth spending as much time looking into
the discrepancy as you have in arguing with us about how realtime MP3
encoding is impossible.
Charlton

Signature
cwilbur at chromatico dot net
cwilbur at mac dot com
Sherm Pendley - 21 Jan 2005 19:50 GMT
> With all due respect, Mike, I ain't buying that. Perhaps in part because
> I've seen *ZERO* evidence of any such capability
If you haven't seen it, your eyes must be closed.
> I'm thinking we both need to step back and take a look at what we're
> each calling "realtime" - For the record, I'm saying that realtime means
> "the encoding happens in a span of time only slightly longer than it
> would take to simply play the raw data".
I just ran a test. Encoding a 42-minute CD took six minutes. And my machine
is no hot rod - it's an old single G4/500. If it took 42 minutes, I'd be
looking to see what went wrong.
sherm--

Signature
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org