|
@@ -246,11 +246,12 @@ function WebSocketServer(options) {
|
|
SendRtspCommand(CommandConstructor("DESCRIBE", null));
|
|
SendRtspCommand(CommandConstructor("DESCRIBE", null));
|
|
break;
|
|
break;
|
|
case "Describe":
|
|
case "Describe":
|
|
|
|
+ //console.log('stringMessage->',stringMessage);
|
|
rtspSDPData = parseDescribeResponse(stringMessage);
|
|
rtspSDPData = parseDescribeResponse(stringMessage);
|
|
if (typeof rtspResponseMsg.ContentBase !== "undefined") {
|
|
if (typeof rtspResponseMsg.ContentBase !== "undefined") {
|
|
rtspSDPData.ContentBase = rtspResponseMsg.ContentBase
|
|
rtspSDPData.ContentBase = rtspResponseMsg.ContentBase
|
|
}
|
|
}
|
|
- //console.log(rtspSDPData.Sessions)
|
|
|
|
|
|
+ console.log("rtspSDPData->",rtspSDPData.Sessions)
|
|
for (let idx = 0; idx < rtspSDPData.Sessions.length; idx++) {
|
|
for (let idx = 0; idx < rtspSDPData.Sessions.length; idx++) {
|
|
let sdpInfoObj = {};
|
|
let sdpInfoObj = {};
|
|
if (rtspSDPData.Sessions[idx].CodecMime === "H264") { //暂时只支持H264
|
|
if (rtspSDPData.Sessions[idx].CodecMime === "H264") { //暂时只支持H264
|
|
@@ -266,6 +267,16 @@ function WebSocketServer(options) {
|
|
sdpInfoObj.SPS = rtspSDPData.Sessions[idx].SPS;
|
|
sdpInfoObj.SPS = rtspSDPData.Sessions[idx].SPS;
|
|
}
|
|
}
|
|
SDPinfo.push(sdpInfoObj)
|
|
SDPinfo.push(sdpInfoObj)
|
|
|
|
+ }
|
|
|
|
+ else if(rtspSDPData.Sessions[idx].CodecMime === "H265"){//支持h265实验
|
|
|
|
+ sdpInfoObj.codecName = rtspSDPData.Sessions[idx].CodecMime;
|
|
|
|
+ sdpInfoObj.trackID = rtspSDPData.Sessions[idx].trackID;
|
|
|
|
+ sdpInfoObj.ClockFreq = rtspSDPData.Sessions[idx].ClockFreq;
|
|
|
|
+ sdpInfoObj.Port = parseInt(rtspSDPData.Sessions[idx].Port);
|
|
|
|
+ if (typeof rtspSDPData.Sessions[idx].Framerate !== "undefined") {
|
|
|
|
+ sdpInfoObj.Framerate = parseInt(rtspSDPData.Sessions[idx].Framerate)
|
|
|
|
+ }
|
|
|
|
+ SDPinfo.push(sdpInfoObj)
|
|
} else {
|
|
} else {
|
|
console.log("Unknown codec type:", rtspSDPData.Sessions[idx].CodecMime, rtspSDPData.Sessions[idx].ControlURL)
|
|
console.log("Unknown codec type:", rtspSDPData.Sessions[idx].CodecMime, rtspSDPData.Sessions[idx].ControlURL)
|
|
}
|
|
}
|
|
@@ -278,6 +289,7 @@ function WebSocketServer(options) {
|
|
break;
|
|
break;
|
|
case "Setup":
|
|
case "Setup":
|
|
sessionID = rtspResponseMsg.SessionID;
|
|
sessionID = rtspResponseMsg.SessionID;
|
|
|
|
+ console.log('setup->'+sessionID,SDPinfo)
|
|
//多路流(如音频流)
|
|
//多路流(如音频流)
|
|
//在Describe中暂时只解析H264视频流,因此SDPinfo.length始终为1
|
|
//在Describe中暂时只解析H264视频流,因此SDPinfo.length始终为1
|
|
if (setupSDPIndex < SDPinfo.length) {
|
|
if (setupSDPIndex < SDPinfo.length) {
|