BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
706 stars 284 forks source link

Unsupported Transport Type #66

Open rossbuggins opened 4 years ago

rossbuggins commented 4 years ago

I'm running the Streaming video display demo and trying to connect to a locally hosted RSTP server. I'm using VLC as the server with:

VLC "MyFile.mp4" --sout=#transcode{vcodec=h264,scale=Auto,acodec=mp4a,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{sdp=rtsp://MYLOCALIP:8996/go.mpg} :no-sout-all :sout-keep

However, I keep getting Bad Response Code: UnsupportedTransport

I'm using TCP in the settings in the demo code, as VLC only runs as a server in TCP transport type.

Another instance of VLC can connect to the RTSP stream ok.

Debugging, its at the point it sends a request message when setting up a channel of :

{SETUP rtsp://MYIP:8996/go.mpg/trackID=1 RTSP/1.0 CSeq: 3 User-Agent: RtspClientSharp Transport: RTP/AVP/TCP;unicast;interleaved=0-1

}

And the response is:

{RTSP/1.0 461 UnsupportedTransport CSeq: 3 SERVER: VLC/3.0.6 DATE: Mon, 21 Oct 2019 19:38:34 GMT CONTENT-LENGTH: 0 CACHE-CONTROL: no-cache CSEQ: 3 }

RandDruid commented 4 years ago

By default VLC uses UDP transport for RTP. In theory there is an option to configure RTP protocol to TCP, but I can't make it work.

--sout-rtp-proto={dccp,sctp,tcp,udp,udplite} 
                                 Transport protocol
          This selects which transport protocol to use for RTP.
rossbuggins commented 4 years ago

on https://wiki.videolan.org/Documentation:Streaming_HowTo/Advanced_Streaming_Using_the_Command_Line/ it states

tcp, accept TCP connections at the specified IP address (dst=) and use RFC 4571 RTP framing, not implemented yet,

Can RtspClientSharp not deal with UDP for the RTP then?

RandDruid commented 4 years ago

It can, but you should set RtpTransport to UDP. RTSP is always TCP. With UDP transport RtspClientSharp will send different SETUP message and VLC will accept it.

rossbuggins commented 4 years ago

Ok I’ll look again with it set to udp and trace through what goes on. Thanks