[Icecast] converting mp3's to aac+ or ogg
sci-fi at hush.ai
sci-fi at hush.ai
Mon Jun 26 01:33:01 PDT 2006
I'll attach my ezstream.xml file to illustrate how ezstream can
be "programmed" to do various on-the-fly re-encodings.
The basic idea is to treat each <encdec> section as a pair of
cmd-line tools: implying a *ix pipe connects the output of the
<decode> cmd to the input of the <encode> cmd. The stdout of the
<encode> cmd is fed back to ezstream for netcasting.
I've successfully used this to netcast a lot of Apple Lossless
recordings I've done myself into an mp3 stream. (At the time
back when, the MacOSX recording apps could only do lossless using
Apple's codec. The alac cmd is open src and comes from a dude
who has reverse-engineered Apple's file format in this case.
This is only fyi, but it does work.)
(btw in my case since I want mp3 streams, if the m3u playlist
encounters a .mp3 filename, note the related <decode> section in
my xml simply 'cat's it to stdout, there is no related <encode>
cmd in this section, so ezstream handles the stream from that
point on. Neat trick, eh? <g>)
I know the flac cmd (part of the FLAC project) can pipe its
decoded data to stdout, too, thus the same kind of xml can be
used in your case.
It would be easy to change the lame cmd in my sample xml to the
oggenc cmd, pick your parms, make sure the other xml things match
everywhere, and you're netcasting ogg streams instead.
Several <encdec> sections can be programmed like this to try
supporting a mix of recordings in various formats. During the
interim, you can almost immediately switch to ogg stream format
by setting up an <encdec> section thusly: You'll want to use an
accurate mp3 decoder for the <decode> cmd (mpg123 can do that),
and use oggenc for the <encode> cmd as I just mentioned. Also go
ahead to add another <encdec> section that sees the .flac
filenames to <decode> with flac cmd and <encode> with oggenc
again. Then as Chris said, simply take your time in re-ripping
your originals to flac format, update your m3u playlist as
needed, and keep on streamin'. :)
On Sun, 25 Jun 2006 18:03:48 -0500 Chris MacDonald
<chris at thoughtsoft.net> wrote:
> Taking the 128 mp3 and re-encoding to flac won't fix any quality
> you may have as they will retain the same 'flaws'. In the end
> up with the same quality as you would have seen going from 128
mp3 to q3
> ogg. One nice thing about ezstream is that you can specify
> multiple formats so if going and ripping all your media again is
> daunting a task you could just use the mp3s you have, then slowly
> ripping to flac as you have time and ezstream will take care of
> the right decoder.
> I'm flattered you think I have customers and all manner of users
> I just use ezstream/icecast for myself, at least for now I just
> one stream. As an example configuration just take a look at the
> example that comes with ezstream. It's very close to what you
> any changes you need to make are pretty straightforward. Take
> though, the stream information in the configuration is
> only, to actually modify the encoding options of the stream
> Look under the 'reencoding' section of the config and modify the
> ezstream will use as the encoder. Any options for oggenc you can
> out by checking out the man pages, but you probably just want to
> with the with the quality, in which case you'd change '-q 0' to
> whichever you'd like.
> To my knowledge it isn't possible to get icecast or ezstream to
> the bitrate of the stream dynamically to meet a client's
> restrictions so what you'd want to do is have two streams, one
> quality and one high quality. For this you'd be running two
> ezstream, each with their own encoder settings to change the
> suit your needs.
> Dave wrote:
>> Hi Chris,
>> Thanks. What i've got are 128kbps mp3's. I encoded them using
>> as it did everything with one command and worked over an entire
>> used lame as it's backend and encoded at 128k. Question, what if
>> went from mp3 to flac, which would enable me to have my original
>> as they are, plus a mirrored area of flac files, then use
>> send those flac files as ogg. If that wouldn't blow to much up
>> wise i'd rather do it that way than reencode everything. For
>> streams do you have both dialup and broadband users? If so, i'd
>> to see your reencode settings so i will know what to punch in,
>> getting the quality right has been hit and miss. Are any of your
>> customers windows users using winamp?
>> ----- Original Message ----- From: "Chris MacDonald"
<chris at thoughtsoft.net>
>> To: "Dave" <dmehler26 at woh.rr.com>
>> Cc: <icecast at xiph.org>
>> Sent: Sunday, June 25, 2006 6:09 PM
>> Subject: Re: [Icecast] converting mp3's to aac+ or ogg
>>> Yeah, ezstream is a source client just like ices0, but the
>>> which they go about processing files or playlists may differ. I
>>> know too much about ices0 but in the configuration for ezstream
>>> can either specify a single file to stream or you can point it
>>> m3u playlist and it will play though that, I'm not sure this is
>>> compatible with how you currently queue media.
>>> In terms of quality, I'm pretty picky which is why I wanted my
>>> media in a lossless format. I chose flac but there are others,
>>> wav + compression; tracks I archive are usually 50-80% of their
>>> size, of course this varies from track to track. In your case
>>> from mp3 to ogg, your ability to notice a difference will
>>> the bitrate of the source mp3 and the resultant ogg stream.
>>> like a 256kbps vbr mp3 to a q3 (~110kbps vbr) ogg vorbis stream
>>> still sound fine (I did this before deciding to do al my
>>> flac), but if you took a 128kbps mp3 and did the same you'd
>>> the change. Again, it varies from person to person and I'd
>>> you'd just have to try it yourself to see what you'd like, it's
>>> a science and more a preference.
>>> The box that does my re-encoding on is an AMD 1800 with 512MB
>>> also does icecast, apache, mysql, sendmail, pretty much the
>>> shebang and I haven't had a problem. Though, mind you I'm only
>>> re-encoding for one stream whereas you'd be doing multiple
>>> The flac decoder seems content with ~2% of the processor and
>>> encoder seems to like ~40% and again, this is hardly a science
>>> undoubtedly 'your mileage will vary'.
>>> Dave wrote:
>>>> Hi Chris,
>>>> Yes that helps a lot, thanks. I'm currently using ices0,
>>>> worked fine when all i wanted to stream was mp3's. You've sold
>>>> ogg, and ezstream can it work as ices0 does? As i said i'd
>>>> not like to do all this reencoding again, how much of a
>>>> will i be looking at if i go from mp3 to ogg? I'm not familiar
>>>> the flac format at all. Does it have any kind of compression,
>>>> rather not have something like all these wavs around or
similar if i
>>>> could help it. As for the box how much of a hit will it take?
>>>> kind of machine do you use for your encoding?
>>>> ----- Original Message ----- From: "Chris MacDonald"
<chris at thoughtsoft.net>
>>>> To: "Dave" <dmehler26 at woh.rr.com>
>>>> Cc: <icecast at xiph.org>
>>>> Sent: Sunday, June 25, 2006 4:46 PM
>>>> Subject: Re: [Icecast] converting mp3's to aac+ or ogg
>>>>> Hey Dave,
>>>>> Personally I use ezstream as a source client as it's designed
>>>>> re-encode your stream (it's available at www.icecast.org).
>>>>> up my radio to re-encode my archived flacs to ogg vorbis then
>>>>> to icecast and it works quite well.
>>>>> As for quality, vorbis is apparently one of the nicer formats
>>>>> low bitrates. I'm not sure about aac though, I'd imagine
>>>>> isn't much in the way of support for it so you'd be much
>>>>> with ogg. Either way though, re-encoding from a lossy format
>>>>> to another lossy format (ogg/aac) you'll notice some sound
>>>>> degradation from your source mp3, this is entirely why I
>>>>> I'm not sure what you want to do for dialup/broadband quality
>>>>> settings but I'd probably just run two mounts for each
>>>>> low bitrate and one higher. One thing you have to keep in
>>>>> though is that all this re-encoding would happen on the fly
>>>>> need to make sure the machine you'd be doing it with was up
>>>>> Not sure if any of the above helps, but I'd imagine it
>>>>> some options at least.
>>>>> Dave wrote:
>>>>>> I've got a FreeBSD 6 machine running icecast2 and
>>>>>> ices0streaming four different streams of mp3's. Now i have a
>>>>>> to stream the same content as either aac+ or ogg vorbis
>>>>>> would be easiest to set up and give the best quality. I want
>>>>>> new streams to handle both broadband and dialup users
>>>>>> sacrificing quality. My problem is i really really do not
>>>>>> have to manually go through my media again and bring them in
>>>>>> aac+ or ogg, doing it once for mp3 was bad enough. I used
>>>>>> handle this, and as i said i'd like to find an automated way
>>>>>> reworking these files. Any suggestions welcome.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1426 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/icecast/attachments/20060626/f649de8a/ezstream_mp3_m4a_works-0001.bin
More information about the Icecast