Category Archives: Event Cue Points on red5

Getting Event Cue Points to work with Red5 0.8 and Red5 0.9.1

I’ve written a flash app (in AS3) that streams video to a red5 server (over RMTP of course) and embeds event cue points into the stream. The red5 server is using the OFLA demo that comes with red5, which converts the streams to FLV files. I then have another flash app that reads the FLV (over HTTP in this case not RTMP) and calls a function when an event cue point is reached while playing the FLV.
Now – the code you need to write to ensure that the cue points get properly written into the FLV depends on what RED5 version you are running. The code I’m talking about is the AS3 code in the app that streams the video. When you want to insert an event cuepoint you need to format the “send” function call with the following code (where ns is the netstream object):


For Red5 0.8

ns.send(“onCuePoint”, cueData);

For Red5 0.9.1

ns.send(“@setDataFrame”, ”onCuePoint”, cueData);

And thats pretty much it. And the other thing you need to ensure is that when you are setting up your netconnection, make sure you are using AMF0 encoding. I noticed this is needed for cue points to be added successfully in the right format.

nc.objectEncoding = flash.net.ObjectEncoding.AMF0

Jeremy is the webmaster of http://builderscrack.co.nz