Streaming video over RTSP server

Topics: Question
Jul 26, 2016 at 3:40 PM

Thank you for the excellent work with the library. It has been quite useful with the project and includes a lot of features.
I have not been able to use the simple RTSPserver streaming functionality to vlc/camera device manager or a simple GUI.

server = new RtspServer(, 554); //private Rtsp server member declared)
Media.Rtsp.Server.MediaTypes.RtspSource local = new RtspSource("Bird","rtsp://localhost/live/bird");
        if (!server.TryAddMedia(local))
            throw new System.Exception();
I have exhausted all options with streaming avi, jpeg, test streams, configuring the network.
It seems like I have been missing something trivial but since it has been almost a day, I thought I would turn to ask a question.

I would be glad to give more details.
Jul 26, 2016 at 3:43 PM
Edited Jul 26, 2016 at 3:45 PM
Thanks for your kind words and interest in the project.

I am confused by the example code you provided; if you can provide a complete example I will critique further.

By default the RtspServer takes an IPAddress and Port to be created on and not a Uri...

There are sufficient examples of encoding JPEG in the TestRtspServer function of the UnitTests solution. There is an example of encoding existing images as well as creating them on the fly and encoding such; (See Mirror, PicsTCP, Bandit, etc)

They all should work out of the box as should most of the other streams included in that same test.
Marked as answer by juliusfriedman on 7/26/2016 at 7:43 AM
Jul 27, 2016 at 8:07 AM
Thank you for the quick response.
Sorry for the confusion, the following code is the complete and has a few trials with different formats and functions.

Project details: To create a console service application(server), WCF service library to recieve signals from joysticks to control cameras. The communication is translated to ONVIF protocol from the different available communication protocols. All this is displayed to a client UI.

The Rtspserver initially implemented was using a no-argument constructor and then I added the ip address and port [RtspServer(, 554);]. I was trying to stream the jpeg or .avi file over rtsp protocol to test the server functionality.
        server = new RtspServer();
        Media.Rtsp.Server.MediaTypes.RtspSource local = new RtspSource("Bird", "rtsp://localhost/live/bird");

        //Media.Rtsp.Server.MediaTypes.RFC2435Media jpeg = new RFC2435Media("bird", "C:\\Users\\gareddy\\Pictures\\bird.avi", true)
        //Media.Rtsp.Server.MediaTypes.RtspSource birdSource = new RtspSource("bird", "C:\\Users\\gareddy\\Pictures\\bird.avi");
        //Media.Rtsp.Server.MediaTypes.JPEGMedia jpegMedia = new JPEGMedia("myjpeg", "C:\\Users\\gareddy\\Pictures\\ALTEN.jpg"); 

           if (!server.TryAddMedia(local))
            throw new System.Exception();
        //if (!server.TryAddMedia(jpegMedia))
        //    throw new System.Exception();
        //if (!server.TryAddMedia(birdSource))
        //    throw new System.Exception();

I installed the library using nuget, and don't have the unitTests solution. I downloaded the source code and added it as a dependancy but that did not work.
1) How do I use the Testfunctions and the examples located?

If I could find out how or what might be going wrong with the code to stream the video/jpeg file, that would be very helpful.

Ps- I am a newbie and learning the trade.
Pps-Bandit looks like a strong dog :)
Jul 27, 2016 at 2:55 PM
I understand what your trying to do from the first paragraph.

I don't understand how the example begins to relate to such;

Where are these sources being streamed from? You have to provide the data to be streamed..... This is why I provide the Mirror, PicsTcp and Bandit Streams; they allow easy experimentation with existing data in a codec which is widely implemented (jpeg).

If you want to add images one by one there is an example of that also; just follow the same examples in the API from the source which the nuget package was derived from... e.g.

If your content on using the that package then that's what your going to have to do.

You can also just download the latest source and build; unless that is not possible for some reason...

Thanks for the kind words about Bandit, his name was originally going to be 'Bear' but though the process of elimination it seemed that "Bandit" stuck for one reason or another; mostly likely due to the 'mask` of black fur which was on his face :p

Let me know how I can help you further :)
Marked as answer by juliusfriedman on 7/27/2016 at 6:55 AM
Aug 2, 2016 at 8:58 AM

The sources .avi, .jpeg are files I downloaded to my computer. The final goal is to stream an IP camera rtsp://192.168.134.... to the GUI.

I tried to download the latest sourcefile and open the project but one or more project failed to load.
(D:\Backup\Documents\Visual Studio 2013\Projects\vii2\vii2\vii2.csproj : error : The project file could not be loaded. The device is not ready.)

The installed the package using the package manager console. Is that updated to the latest version?

I was working on the UI and put this on the back-burner for a bit and just amazed at how magical wpf and .Net framework can be. But the streaming part is one of the important part of the project.
Aug 4, 2016 at 12:22 PM
Nuget is not updated yet afaik, Vii2 should be unloaded by default.
Marked as answer by juliusfriedman on 8/4/2016 at 4:23 AM