receveive gstreamer udp
connect rtspclientsharp to gstreamer udp
I am generating a rtp stream using gstreamer on windows 10. G:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v idsueyesrc ! videoconvert ! queue ! openh264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5000
(some parameters of the stream: /GstPipeline:pipeline0/GstIdsueyeSrc:idsueyesrc0.GstPad:src: caps = video/x-raw, format=(string)BGRA, width=(int)2052, height=(int)1502, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)sRGB, framerate=(fraction)0/1)
I can open it using vlc and this sdp file:
v=0
m=video 5000 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 H264/90000
I modified SimpleRstpClient-> Program.cs to tatic void Main() { var serverUri = new Uri("rtp://127.0.0.1:5000");
var connectionParameters = new ConnectionParameters(serverUri); //, credentials);
var cancellationTokenSource = new CancellationTokenSource();
connectionParameters.RtpTransport = RtpTransportProtocol.UDP;
Task connectTask = ConnectAsync(connectionParameters, cancellationTokenSource.Token);
Console.WriteLine("Press any key to cancel");
Console.ReadLine();
cancellationTokenSource.Cancel();
Console.WriteLine("Canceling");
connectTask.Wait(CancellationToken.None);
}
but then I get this error:
Connecting... Press any key to cancel RtspClientSharp.Rtsp.RtspClientException: Connection error ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it [::ffff:127.0.0.1]:5000 at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult) at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at System.Net.Sockets.Socket.<>c.<ConnectAsync>b__317_0(IAsyncResult iar) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at RtspClientSharp.Rtsp.RtspTcpTransportClient.<ConnectAsync>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at RtspClientSharp.Rtsp.RtspClientInternal.<ConnectAsync>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at RtspClientSharp.RtspClient.<>c__DisplayClass13_0.<<ConnectAsync>b__0>d.MoveNext() --- End of inner exception stack trace --- at RtspClientSharp.RtspClient.<>c__DisplayClass13_0.<<ConnectAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at RtspClientSharp.RtspClient.<ConnectAsync>d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at SimpleRtspClient.Program.<ConnectAsync>d__1.MoveNext() in G:\gstreamer\RtspClientSharp\Examples\SimpleRtspClient\Program.cs:line 48
I don't know why, the port is open as it's working using vlc. and i tired with firewall disabled.
if I do G:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v idsueyesrc ! videoconvert ! queue ! openh264enc ! rtph264pay name=pay0 pt=96 config-interval=1 ! tcpserversink host=10.231.220.199 port=5000 instead of udpsink. simpleRtspPlayer is stuck in "connecting".
actually it's the same error, juste the message in the state bar of simpletrspplayer is "overwrite." line 84 of rtspclient.cs, I see that connectionTask.Exception is the same error:
{"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [::ffff:10.231.200.199]:5000"}