Information - You can find an article which explains Rtsp and Rtp communication and the idealogy behind the creation of this library at the CodeProject (it has nothing to do with ShartpRTSP.)

New Article's
There is also a series @ CodeProject currently highlighting the new features which will be found in the RC2 Release Dubbed "Flawless".

Update - The next release is in the works, ++42

Update The RC 2 Release has posted! Get it in the Downloads Section!

Update - The Release Candidate of this Library has been released! Grab it from the Downloads Section!

Update - Checkout the Source History section for a brief look at the latest updates!

If you have a question check out the Discussion Area for help!

Project Description

Delivering media to clients can be a complex and expensive process. This project's goal is to allow developers to deliver media to clients freely in less then 10 lines of code utilizing standards complaint protocol implementations. It also aims to provide a re-usable set of classes for working with Rtsp and Rtp/Rtcp and Sdp.

Example Code

//Create the server optionally specifying the port to listen on
Rtsp.RtspServer server = new Rtsp.RtspServer(/*555*/);

//Create a stream which will be exposed under the name Uri rtsp://localhost/live/RtspSourceTest
//From the RtspSource rtsp://
Rtsp.RtspStream source = new Rtsp.RtspStream("RtspSourceTest", "rtsp://");
//If the stream had a username and password
//source.Client.Credential = new System.Net.NetworkCredential("user", "password");
//If you wanted to password protect the stream
//source.RtspCredential = new System.Net.NetworkCredential("username", "password");

//Add the stream to the server

//Start the server and underlying streams

This is all a developer needs to do to get a server streaming from a source!

This library implements Rtsp/RFC2326 and Rtp/RFC3550 in way which is easy to understand and agnostic of the underlying video or audio format being transported.

It supports the concept of RFC4571 framing in TCP and allows TCP streams to be re-sourced over UDP.

It provides facilities for Creating and Parsing Rtsp, Rtp and Rtcp and Sdp Packets.

It also provides a RtspServer so that you can deliver your media to complaint players such as DarwinStreamingServer, VLC, FFMPEG, Mplayer, QuickTime and many many more!

The included RtspClient and RtpClient are standards complaint and support Tcp and Udp transport and switch automatically when required.

This library also provides a RtspServer which supports re-sourcing live streams allowing you to deliver media to as many clients as your server can support without utilizing the bandwidth of the source stream beyond the initial single server connection.

Your clients only talk to the code, they never talk to the source stream.

This allows you to stream in real time from your phone or using a webcam over a modem or other low bandwidth link to virtually unlimited clients with very little overhead.

The underlying implementation is compatible with any video codec and provides RtpPackets or RtpFrames via events so it is up to the developer to do something more with them such as decoding them for viewing or storing them in a file.

The RtspServer does successfully aggregate live Rtsp video streams in ANY container or codec to a compatible RtspClient or Player (VLC, Mplayer and QuickTime have been tested) 

You can use this project to develop and test custom video codecs or other types of transport where players are not found in abundance or to provide media over Rtsp with Rtp transport.

Types of transport besides Rtp may eventually be added but are not currently supported at this time unless encapsulated inside a RtpPacket / RtcpPacket and through Rtsp.

The library cannot decode individual frames (Except for Jpeg) however you can use it to setup a source stream and then use FFMPEG or VLC to pull the stream down from your local server over Rtsp and extract images utilizing only the resources of the RtspServer and not the source.

It also allows you to password protect a source stream even if the source was not password protected or the other way around.

Developers could also utilize the RtspClient and or the RtpClient without the included RtspServer to allow them to communicate with VoIP systems or other systems and devices which support the Rtsp or Rtp protocol. (Examples are needed but support is available in the Discussion Area for developers using the library)

This library also has facilities for Parsing and Creating Sdp files / RFC4566.

This is not a transcoding project and does not support encoding / decoding of any video codecs, however it does support (de) packetizing Jpeg over Rtp  (format 26 RFC2435) which is sometimes called MJPEG or JPEG over RTP.

This means if you have a camera / server / source which can send a Rtp stream in the Jpeg format you can see the individual frames.

You can also send a series of images over Rtp as Jpeg (RFC2435) as long as the source image format is supported as a System.Drawing.Image.

This lets you turn your Web Camera or Digital Camera or source of images into a LIVE Rtsp Stream!

This library also has an implementation of reading and writing 'rtpdump' compatible files in various formats.

Archiving is currently be supported through the 'rtpdump' format. Sdp information must be stored separately as of now.

For more information on the 'rtpdump' format check out the Rtp Tools Home Page

Developers could also utilize the Base Media File Format Library to save / archive the media and then play it back with the included RtspServer and hopefully when I get the time I will add that example, in the mean time enjoy the code and let me know how you use it, what features you feel are missing, incomplete or not included or just to say thanks!

Here are some pictures of the library in action on a Dell Optiplex 755(Core 2 Duo with 8GB Ram)




Last edited Jan 17 at 11:58 PM by juliusfriedman, version 50