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.)
There is also a series @
CodeProject currently highlighting the new features which will be found in the RC2 Release Dubbed "Flawless".
Update - The library now
contains facilities for creating MPEG and H.264 Streams from Bitmap images as well as re-sourcing HTTP MJPEG and JPEG streams over Rtsp/Rtp
Update - The next release is in the works, ++42
Update - The RC 2 Release has posted! Get it in the
- The Release Candidate of this Library has been released! Grab it from the
- 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!
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.
//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://126.96.36.199/mpeg4/media.amp
Rtsp.RtspStream source = new Rtsp.RtspStream("RtspSourceTest", "rtsp://188.8.131.52/mpeg4/media.amp");
//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.
The RtspServer and RtspClient support pushed messages such as "PLAY_NOTIFY" and are observed through events in both classes, this is important for RTSP 2.0 draft compliance.
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
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!
Recently the library has also added a H264 Encoder and a MPEG Encoder which are experimental and work with System.Drawing.Bitmap, they are provided only for creating video stream data from existing images; thus it is now possible to take a JPEG stream and
convert it to MPEG or H.264 (soon to be on the fly and in real time)
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 or the
SharpAvi 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)