TaggedException: Invalid transport header in rtsp

Topics: Question
Aug 30, 2017 at 7:51 PM
Hi Everyone!

After reading a useful article on codeproject i would like to use net7mma for reading live stream from an ip camera.

I have the following code:
class Program
        static RtspClient client;
        static void Main(string[] args)
            string url = "rtsp://foo.bar.org:554/profile1";
            string userName = "myusername";
            string password = "mypassword";

            client = new RtspClient(url,RtspClient.ClientProtocolType.Udp);
            client.Credential = new System.Net.NetworkCredential(userName, password);
            client.AuthenticationScheme = System.Net.AuthenticationSchemes.Basic;
            client.OnConnect += Client_OnConnect;
            client.OnResponse += Client_OnResponse;

        private static void Client_OnResponse(RtspClient sender, RtspMessage request, RtspMessage response)
            Console.WriteLine("client on response event fired");

        private static void Client_OnConnect(RtspClient sender, object args)
            if (client.IsConnected)

                if (!sender.IsPlaying)
                    sender.SocketReadTimeout = sender.SocketReadTimeout + 30000;

Connection is successful, but on sender.StartPlaying() i receive the following exception:
  • InnerException {"Cannot setup media, Invalid Transport Header in Rtsp Response: RTP/AVP;unicast;destination=;source=foo.bar.org;client_port=10000-10001;server_port=20038-20039;ssrc=5d39bb44"} System.Exception {Media.Common.TaggedException<Media.Rtsp.RtspClient>}
Can you please explain what is missing and how to fix it.

Many thanks.