为什么Axis P1347 RTSP请求返回错误代码400?

时间:2015-07-28 13:12:03

标签: libcurl rtsp mpeg-4

我正在使用AXIS P1347网络摄像头尝试使用RTSP网址rtsp://192.168.1.47/axis-media/media-amp?videocodec=mpeg4来传输mpeg4图像,这会导致RTSP/1.0 400 Bad Request错误代码。请查看下面我的TestRTSPClient会话的输出,让我知道我做错了什么。 TestRTSPClient是一个32位Microsoft Visual Studio C ++测试程序,它运行libcurl API。非常感谢任何帮助。

C:\Users\Administrator\Downloads>TestRTSPClient.exe rtsp://root:pass@192.168.1.4
7/axis-media/media.amp?videocodec=mpeg4
RTSP Proc Activate
Activate Called
Opening connection to 192.168.1.47, port 554...
Activate End
RTSP Proc In doeventloop
...remote connection opened
Sending request: DESCRIBE rtsp://root:pass@192.168.1.47/axis-media/media.amp?vid
eocodec=mpeg4 RTSP/1.0
CSeq: 2
User-Agent: ClickItCameraControlLib (LIVE555 Streaming Media v2014.05.14)
Accept: application/sdp


Received 247 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="AXIS_00408CB5496E", nonce="000f8692Y74454910ff13
1f1dff234aaa61363525d1a57", stale=FALSE
WWW-Authenticate: Basic realm="AXIS_00408CB5496E"
Date: Tue, 28 Jul 2015 14:11:54 GMT


Resending...
Sending request: DESCRIBE rtsp://root:pass@192.168.1.47/axis-media/media.amp?vid
eocodec=mpeg4 RTSP/1.0
CSeq: 3
Authorization: Digest username="root", realm="AXIS_00408CB5496E", nonce="000f869
2Y74454910ff131f1dff234aaa61363525d1a57", uri="rtsp://root:pass@192.168.1.47/axi
s-media/media.amp?videocodec=mpeg4", response="8cda56c69d14829ee16869b4014836c7"

User-Agent: ClickItCameraControlLib (LIVE555 Streaming Media v2014.05.14)
Accept: application/sdp


Received 74 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 400 Bad Request
CSeq: 3
Date: Tue, 28 Jul 2015 14:11:54 GMT

[URL:"rtsp://root:pass@192.168.1.47/axis-media/media.amp?videocodec=mpeg4"]: Fai
led to get a SDP description: 400 Bad Request
[URL:"rtsp://root:pass@192.168.1.47/axis-media/media.amp?videocodec=mpeg4"]: Clo
sing the stream.

1 个答案:

答案 0 :(得分:0)

我刚刚在Axis P1347网络摄像机上测试了以下代码,尝试使用RTSP协议流式传输mjpeg图像,看起来没问题。

char httpUrlTemp[MAX_PATH * 2];
sprintf(httpUrlTemp, "http://%s/mjpg/%d/video.mjpg?resolution=%s&fps=%s", address.c_str(), m_nChannelID + 1, requiredResolution.c_str(), requiredFrameRate.c_str());
   m_httpUrl = httpUrlTemp;

非常感谢。