Ansersion / myRtspClient

A RTSP client based on jrtplib
Apache License 2.0
163 stars 92 forks source link

GetMediaData: No such media session #20

Open cafecai opened 5 years ago

cafecai commented 5 years ago

When I connect to the rtsp server, the program keeps prompting "GetMediaData: No such media session", and the server prompts "client not support accept SDP." My rtsp server can run normally, and the VLC media player can receive the video. Excuse me, what is this question?

start PLAY GetMediaData: No such media session GetMediaData: No such media session GetMediaData: No such media session GetMediaData: No such media session GetMediaData: No such media session .....

cafecai commented 5 years ago

/mnt/myRtspClient/example # ./complete_example rtsp://192.168.1.10/live.sdp Start play rtsp://192.168.1.10/live.sdp Then put video data into test_packet_recv.h264 RTSP/1.0 200 OK CSeq: 1 Date: Thu Jan 1 01:08:45 1970 Public: OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN Server: rtsp_demo

RTSP/1.0 406 Not Acceptable CSeq: 2 Date: Thu Jan 1 01:08:45 1970 Server: rtsp_demo

DoDESCRIBE error

Ansersion commented 5 years ago

According to the above info, the server maybe refuses to accept DESCRIBE command. Is your server on github? Maybe I could try to debug it.

cafecai commented 5 years ago

This is the code of the server https://github.com/cafecai/hisi_rtsp_demo

cafecai commented 5 years ago

I solved this problem. ErrorType RtspClient::DoDESCRIBE(string uri, bool http_tunnel_no_response) { .... Msg << Cmd << " " << RtspUri << " " << "RTSP/" << VERSION_RTSP << "\r\n"; Msg << "CSeq: " << ++RtspCSeq << "\r\n"; Msg << "User-Agent: my RTSP Client" << "\r\n"; Msg << "Accept: application/sdp" << "\r\n"; //Add this line of code Msg << "\r\n"; .... }

Ansersion commented 5 years ago

Thanks for your support!

sabazade commented 2 years ago

I solved this problem. ErrorType RtspClient::DoDESCRIBE(string uri, bool http_tunnel_no_response) { .... Msg << Cmd << " " << RtspUri << " " << "RTSP/" << VERSION_RTSP << "\r\n"; Msg << "CSeq: " << ++RtspCSeq << "\r\n"; Msg << "User-Agent: my RTSP Client" << "\r\n"; Msg << "Accept: application/sdp" << "\r\n"; //Add this line of code Msg << "\r\n"; .... }

I have added the lines you mentioned, still got those errors. Mine stop on "CheckSockWritable()" which just return "CHECK_OK"! I will be grateful if anyone could help me with it...