![]() |
home | contact us | about us | |
| (by Lou Burne, last updated 10-APRIL-2012) | ||

| A | Create an FlvStuffer object. The FlvStuffer is a class for saving RTMP audio, video and meta-data messages into an FLV file. |
| B | Create an RtmpClient object. The RtmpClient constructor takes one parameters, a reference to the main
application window. Since
Red5Download.cs runs in a console, which is windowless, this parameter can be null. EventsEnabled - Set EventsEnabled to false so the RtmpClient doesn't waste time composing events when no one is listening. |
| C | Create a new
RTMP connection. The RtmpConnection object returned encapsulates a connection to
the remote RTMP server. The behavior flags instruct the RtmpClient library to automatically respond to any request for pings or data acknowledgements that come from the server. |
| D | As this is not
a live stream, only a short timeout is required. (Live streams can take a few seconds to get going.) |
| E | Connect to the
RTMP application. The RTMP application we are connecting to uses standard connection parameters. |
| F | Open a new RTMP stream. |
| G | Register a
callback function for the new stream. Instead of a separate callback function defined in our code file, we are using a C# anonymous function. For each RTMP message received on our stream, we display the details on the console, and then pass the message to the FlvStuffer to update the FLV file. This callback could be made more efficient by limiting the callbacks to only those types of messages we need to put into the FLV file, i.e., audio, video and meta-data. |
| H | Play the
stream, from the beginning (ts=0), to the end (ts=PlayAll). |
| I | Loop until the streaming stops, or the user presses the "C" key. |
| K | Clean up the
RTMP session. Delete the stream, close the connection. The RtmpClient object will be disposed of when it falls out of scope. |
| L | Closing the FlvStuffer will set the correct duration for the FLV file, and flush and close the FLV file. |
![]() |
© 1998-2012 Broccoli Products Ltd Reg Number: 2895355 Reg Office: 27 Old Gloucester Street, London. WC1N 3AX |
Privacy Policy Copyright Notice Liability Disclaimer Contact Us |
|