私はRTSPストリーミングサーバーを書いていますが、助けが必要です。私はすべてを試し、トピックを読んだと思います:
AndroidローカルRTSPサーバー(なりすまし)、DESCRIBE応答が送信された後、PVPlayerはTCPソケットを閉じます
そしてそれらに類似した他のもの。もちろん、多くのpdfやRFCも読んでいます。
私の話:rtspサーバーを作成しましたが、DESCRIBEヘッダーに応答を送信すると問題が発生します。
responseHeader.append(HeaderStates.OK);
responseHeader.append(CRLF);
responseHeader.append(CSeq);
responseHeader.append(CRLF);
responseHeader.append("session: ");
responseHeader.append(Long.valueOf(sessionID));
responseHeader.append(CRLF);
Date date = new Date();
responseHeader.append("Date: ");
responseHeader.append(date.toGMTString());
responseHeader.append(CRLF);
responseHeader.append("Content-Type: application/sdp");
responseHeader.append(CRLF);
responseHeader.append("Content-Base: ");
responseHeader.append(localAddress.getHostAddress());
responseHeader.append(":");
responseHeader.append(Integer.valueOf(localPort));
responseHeader.append(CRLF);
responseHeader.append(CRLF);
responseHeader.append("v=0");
responseHeader.append(CRLF);
responseHeader.append("o=- ");
responseHeader.append(date.getTime());
responseHeader.append(" ");
responseHeader.append(date.getTime());
responseHeader.append(" IN IP4 ");
responseHeader.append(localAddress.getHostAddress());
responseHeader.append(CRLF);
responseHeader.append("a=control:rtsp://192.168.1.143:55555");
responseHeader.append(CRLF);
responseHeader.append("s=RTSPSession");
responseHeader.append(CRLF);
responseHeader.append("m=video 55555 RTP/AVP 26");
responseHeader.append(CRLF);
responseHeader.append("a=rtpmap:26 JPEG/90000");
responseHeader.append(CRLF);
responseHeader.append("a=mimetype:video/JPEG");
responseHeader.append(CRLF);
//responseHeader.append("a=control:trackID=1");
responseHeader.append(CRLF);
responseHeader.append(CRLF);
ここで、HeaderStates.OKは「200OK」、SessionIDはSystem.currentTimeMillis()、CRLF=「\r \ n」、responseHeaderは「RTSP/1.0」で始まります。
次に、VLC(私のPC上のクライアントが処理されていない例外をスローしてクラッシュします)、SMPlayerはヘッダーを読み取り、ログに表示しますが、応答しません。
SDPのエラーについて記載されているSMPlayerログが表示されることがありますが、このエラーの原因はデバッグが長すぎると思います。
私の質問:私が間違ったことは何ですか?クライアントからのSETUPヘッダーがないのはなぜですか?