[Red5] Live Icecast or Shoutcast to RTMP

Andy bowljoman at hotmail.com
Sun Jun 1 23:55:55 PDT 2008


Yea, its possible and in dev stage in my lab.

The garbage collection issue is from not using a URLStream to load the
shoutcast stream.

There us no 'magic thing'.

You separate the data buffers and write out a bytearray with a flv
header, video and audio tags and proper stream id stuff according to the
swf/flv spec.

Moving it into the aac department, you will need to look up the fl4
specification, but it's the same method. Write out a byte array with all
the corect tags and then feed it to a loader via loader.loadbytes();

Snippet of test stream processing:

us.readBytes(ba,0,us.bytesAvailable);
var
s:String=String.fromCharCode(ba.readByte(),ba.readByte(),ba.readByte(),b
a.readByte());
if(s!="NSVs")
{
	return;
}
var
vidType:String=String.fromCharCode(ba.readByte(),ba.readByte(),ba.readBy
te(),ba.readByte());
var
audType:String=String.fromCharCode(ba.readByte(),ba.readByte(),ba.readBy
te(),ba.readByte());
var width:uint=ba.readShort();
var height:uint=ba.readShort();
var framerate:Number=this.frate2double(ba.readByte());

Outputs in the test stream:
NSVs
VP61
MP3 
320
240
15

If you want to help out with this effort. Let me know.

Andy

-----Original Message-----
From: red5-bounces at osflash.org [mailto:red5-bounces at osflash.org] On
Behalf Of Jurgen Schaub
Sent: Sunday, June 01, 2008 10:59 PM
To: red5 at osflash.org
Subject: [Red5] Live Icecast or Shoutcast to RTMP


Hi,

Now that Flash supports the lovely AAC+ format, I'd like to be able to  
repackage our AAC+ Icecast stream into something that Flash  
understands. Jeroen Wijering has developed a fantastic Flash a/v  
player that will theoretically work for this - it's able to play a  
static AAC+ file, streamed directly from Icecast, with no problems. It  
won't, however, play a Shoutcast or Icecast stream natively... and  
even if it could, Flash won't properly garbage-collect the memory that  
the stream takes up, and will eventually crash the browser. RTMP has  
no such problems, and that seems to be the way to go.

Here's what I'd like to be able to put together:

    Icecast server ----[icy]---> Magic Thing ----[rtmp]---> Flash player

It looks like Red5 could possibly be that Magic Thing in the middle,  
but after crawling through the list archives, I couldn't really see  
anything in there that would help with this process.

I guess my first questions are: Is this even possible? Is there a  
better way to accomplish this?

Many thanks,

.....jurgen

_______________________________________________
Red5 mailing list
Red5 at osflash.org http://osflash.org/mailman/listinfo/red5_osflash.org




More information about the Red5 mailing list