我的HTML页面上有一个select元素.我想用数组填充它.因为我们可以将一个数组作为数据提供者给动作脚本中的comboBox.我做了以下事情
在HTML中......
<table>
<tr>
<td>
<label>Recording Mode:</label>
</td>
<td>
<select id="rec_mode">
</select>
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
在javascript中......
var videoSrcArr = new Array("option1", "option2", "option3", "option4", "option5");
Run Code Online (Sandbox Code Playgroud)
当使用VideoSrcArr加载页面时,如何填充rec_mode元素?谢谢
我想编写一个可以在网络上搜索Bonjour启用设备的C程序.
基本上我们有一个网络IP摄像头,它支持Bonjour协议.我想在C中编写API,可以搜索启用了Bonjour的设备.有没有人有关于我该怎么做的示例代码或建议?
我们有支持ONVIF协议的网络IP摄像头.当我试图获得其PTZ配置时,它会产生Auth错误.我在C中实现这一点.以下是请求和响应.
请求:
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\""
"xmlns:tds=\"http://www.onvif.org/ver20/ptz/wsdl\">"
"<soap:Body>"
"<tds:GetNodes/>"
"</soap:Body>"
"</soap:Envelope>"
Run Code Online (Sandbox Code Playgroud)
响应:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:ptzimg2="http://www.onvif.org/ver10/schema"
xmlns:ptzimg3="http://www.w3.org/2005/05/xmlmime"
xmlns:ptzimg4="http://docs.oasis-open.org/wsn/b-2"
xmlns:ptzimg5="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:ptzimg6="http://docs.oasis-open.org/wsn/t-1"
xmlns:ptzimg1="http://www.onvif.org/ver20/ptz/wsdl"
xmlns:ptzimg7="http://www.onvif.org/ver20/imaging/wsdl"
xmlns:ter="http://www.onvif.org/ver10/error">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<SOAP-ENV:Code>
<SOAP-ENV:Value>
SOAP-ENV:Sender
</SOAP-ENV:Value>
<SOAP-ENV:Subcode>
<SOAP-ENV:Value>
ter:NotAuthorized
</SOAP-ENV:Value>
</SOAP-ENV:Subcode>
</SOAP-ENV:Code>
<SOAP-ENV:Reason>
<SOAP-ENV:Text xml:lang="en">
Sender Not Authorized
</SOAP-ENV:Text>
</SOAP-ENV:Reason>
<SOAP-ENV:Node>
http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver
</SOAP-ENV:Node>
<SOAP-ENV:Role>
http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver
</SOAP-ENV:Role>
<SOAP-ENV:Detail>
The action requested requires authorization and the sender is not authorized
</SOAP-ENV:Detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
Run Code Online (Sandbox Code Playgroud)
如何验证用户身份?谢谢
我有网络IP摄像头(佳能VB-M40).本相机支持ONVIF协议.我正在使用C语言在Windows中实现其ONVIF功能.我使用以下请求获得了RTSP URI.
snprintf(postData, sizeof(postData),
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" "
"xmlns:tds=\"http://www.onvif.org/ver10/media/wsdl\""
"xmlns:tt=\"http://www.onvif.org/ver10/schema\">"
"<soap:Body>"
"<tds:GetStreamUri>"
"<tds:StreamSetup>"
"<tt:Stream>0</tt:Stream>"
"<tt:Transport>"
"<tt:Protocol>HTTP</tt:Protocol>"
"</tt:Transport>"
"</tds:StreamSetup>"
"<tds:ProfileToken>profile1</tds:ProfileToken>"
"</tds:GetStreamUri>"
"</soap:Body></soap:Envelope>",
username, digest_str, nonce_str, time_str);
Run Code Online (Sandbox Code Playgroud)
并且响应是:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:MC2="http://www.onvif.org/ver10/schema"
xmlns:MC3="http://www.w3.org/2005/05/xmlmime"
xmlns:MC4="http://docs.oasis-open.org/wsn/b-2"
xmlns:MC10="http://www.w3.org/2004/08/xop/include"
xmlns:MC5="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:MC6="http://docs.oasis-open.org/wsn/t-1"
xmlns:CC="http://www.canon.com/ns/networkcamera/onvif/va/schema"
xmlns:MC1="http://www.onvif.org/ver10/media/wsdl"
xmlns:MC8="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding"
xmlns:MC9="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding"
xmlns:MC7="http://www.onvif.org/ver20/analytics/wsdl"
xmlns:ter="http://www.onvif.org/ver10/error"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:tns1="http://www.onvif.org/ver10/topics">
<SOAP-ENV:Header></SOAP-ENV:Header>
<SOAP-ENV:Body>
<MC1:GetStreamUriResponse>
<MC1:MediaUri>
<MC2:Uri>rtsp://192.168.5.53:8090/profile1=r</MC2:Uri>
<MC2:InvalidAfterConnect>false</MC2:InvalidAfterConnect>
<MC2:InvalidAfterReboot>true</MC2:InvalidAfterReboot>
<MC2:Timeout>PT0M0S</MC2:Timeout>
</MC1:MediaUri>
</MC1:GetStreamUriResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Run Code Online (Sandbox Code Playgroud)
根据ONVIF规范,一旦我得到流URI,我应该向设备发送'DESCRIBE'请求.我正在使用此过程,因为我需要TCP上的流.
我的问题是如何向设备和套接字发送'DESCRIBE'请求?
我应该在我发送GetStreamURI请求的同一个套接字上发送此请求.或者我必须创建另一个.请求的格式是什么?
我的网页上有一个img标签.我给它一个IP摄像头的URL,从中获取图像并显示它们.我想在完全加载时显示图像.这样我就可以避免闪烁.我做了以下事情.
<img id="stream"
width="1280" height="720"
alt="Press reload if no video displays"
border="0" style="cursor:crosshair; border:medium; border:thick" />
<button type="button" id="btnStartLive" onclick="onStartLiveBtnClick()">Start Live</button>
Run Code Online (Sandbox Code Playgroud)
javascript代码
function LoadImage()
{
x = document.getElementById("stream");
x.src = "http://IP:PORT/jpg/image.jpg" + "?" + escape(new Date());
}
function onStartLiveBtnClick()
{
intervalID = setInterval(LoadImage, 0);
}
Run Code Online (Sandbox Code Playgroud)
在这段代码中.当图像很大时.加载需要一些时间.同时它开始显示加载的图像部分.我想显示完整的图像并跳过加载部分谢谢
我有一个字符串"h264:640x480:4:30000".我使用sscanf函数如下.
char res[16] = { 0 };
int quality = 0;
int fps = 0;
sscanf(temp1, "h264:%s:%d:%d", res, &quality, &fps);
Run Code Online (Sandbox Code Playgroud)
执行此功能时.我期待"res"中的"640x480","质量"中的"4"和"fps"中的"3000".但它将整个字符串复制到"res"中,其他两个变量值保持为0.
这个问题的正确格式是什么.
以下代码在JavaScript中有效吗?
var model = {
var1: "",
var3: function() {
this.someval1=0;
},
var4: new var3(),
}
Run Code Online (Sandbox Code Playgroud)
我知道函数返回一个对象.我们可以像对象一样使用var4吗?上面的代码给出错误"var3 is undefined".
如何确定IP地址是LAN IP地址还是WAN IP地址?我正在 Windows 中编写 C API。谢谢