[Icecast] using ezstream with stdin

Bob bob at leanbackproductions.com
Thu Apr 20 17:16:46 UTC 2006


Hi,

I pipe mp3 data to ezstream in Linux, and I've just looked at the code to
see how I do it.

I don't do any throttling at all - I just keep sending data all the time.
(I assume by throttling you mean "pipe data; sleep for estimated play-time
of data; pipe data ...")  However my mp3 files are only a few seconds long
(they are 4 bar loops) - that may make a difference.  I do it in Perl and
the loop looks like this:

  open(EZ, "|ezstream -c ezstream-config.xml");
  while (1) {
      if (open(MP3, $mp3file)) {
        while (<MP3>) {
          print EZ $_;  # read a chunk from the mp3 file and send it to
ezstream
        }
        close(MP3);
      }
  }

In my experience there's no need to 'sleep' - the OS takes care of it for
you.  I did try calculating the sleep-time but I ended up commenting out
those lines ;-)

There's a tiny glitch between the loops but that's due to MP3 headers I
think.  I never managed to get rid of that, but my ogg vorbis stream is
seamless so I don't really care.

cheers,
Bob.

On 4/20/06, Brandon @ LoudCity.Net IMAP <brandon at loudcity.net> wrote:
>
> I'm having  a hard time not getting mp3 data to ezstream via stdin fast
> enough. The vb.net application I'm writing, ezstream and icecast are all
> running on the same machine (Widows XP). Some where in the process, a
> buffer empties out and that results in a drop out when you are
> listening. Usually the dropout happens at a song change.
>
> At first I was chunking up the data according to bit rate and throttling
> how much was written to ezstream. So I guess the drop outs were due to
> some overhead between my application and ezstream. Maybe something was
> causing the write to stdin to take longer than my application expected.
>
> Just for fun, I tried reading entire mp3 tracks into memory, then
> blasting the whole byte array to ezstream in one chunk. It sounds much
> better, but I don't think this is the best way to do it.
>
> How do other people usually solve this problem?
>
>
> Thanks,
> Brandon
>
>
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/icecast/attachments/20060420/cbd405dc/attachment.htm>


More information about the Icecast mailing list