I don't receive any packages from rtsp client

Topics: Question
Oct 14, 2015 at 1:36 AM
I have a winforms application but I don't receive any packages from rtsp client.
        private void rtspMedia()
        {
            Media.Rtsp.RtspClient client = new Media.Rtsp.RtspClient("rtsp://streamreader:trudat55@69.84.126.216:88/videoMain");
            client.OnResponse += Client_OnResponse;
            client.OnRequest += Client_OnRequest;
            client.OnStop += Client_OnStop;
            client.OnConnect += Client_OnConnect;
            client.OnPlay += Client_OnPlay;
            client.Client.RtcpPacketReceieved += Client_RtcpPacketReceieved;
            client.Client.RtpPacketReceieved += Client_RtpPacketReceieved;
            client.Client.RtpFrameChanged += Client_RtpFrameChanged;
            ClientThreadProc = new Thread(() => client.Connect());
            ClientThreadProc.Start();
        }

        private void Client_OnPlay(Media.Rtsp.RtspClient sender, object args)
        {
            sender.Client.AverageMaximumRtcpBandwidthPercentage = (double)25;
        }

        private void Client_OnConnect(Media.Rtsp.RtspClient sender, object args)
        {
            sender.StartPlaying();
        }
I see that the application calls events Client_OnPlay and Client_OnConnect, Client_OnResponse and Client_OnRequest, but never the events Client_RtcpPacketReceieved,Client_RtpPacketReceieved, Client_RtpFrameChanged

I don't know if I need call any method.

Thanks.
Coordinator
Oct 14, 2015 at 1:10 PM
Try TCP

Media.Rtsp.RtspClient client = new Media.Rtsp.RtspClient("rtsp://streamreader:trudat55@69.84.126.216:88/videoMain",Media.Rtsp.RtspClient.ClientProtocolType.Tcp);
Marked as answer by juliusfriedman on 10/14/2015 at 5:11 AM
Oct 14, 2015 at 3:50 PM
Yes it's working, but when I convert the Media.Rtp.RtpFrame to image the application crashes,
        private void Client_RtpFrameChanged(object sender, Media.Rtp.RtpFrame frame)  //CRASH HERE
        {
            if (frame.IsComplete)
            {
                using (var ff = (new Media.Rtsp.Server.MediaTypes.RFC2435Media.RFC2435Frame(frame)))
                {
                    pictureBox1.Image = ff.ToImage();
                    pictureBox1.Invalidate();
                }
            }
        }
Image


Thanks
Coordinator
Oct 14, 2015 at 8:01 PM
That's because the media is not JPEG or it's jpeg with a dynamic payload type which would not follow the same depacketization as normally would be found in that profile.
Marked as answer by juliusfriedman on 10/14/2015 at 12:01 PM
Oct 14, 2015 at 8:17 PM
Do you know how to display the media on a pictureBox? do I have to convert the media to JPEG?
Coordinator
Oct 14, 2015 at 8:47 PM
Yes I do, no you do not as JPEG is not displayed on the screen either.

See this thread

https://net7mma.codeplex.com/discussions/569279

Thanks for your interest in the library.
Marked as answer by juliusfriedman on 10/14/2015 at 12:47 PM