从Open ONVIF(网络视频接口论坛)设备录制的问题

Nee*_*enu 89 java networking recording ip-camera onvif

我正在开发网络视频接口论坛-Java项目,并遵循ONVIF应用程序员指南中描述的步骤.

我已经从wsdlsONVIF网站提供了源代码.我可以使用media.wsdl.检索实时流URI .现在我有一个录音问题.我尝试过的代码如下:

RecordingService recording_ervice = new RecordingService();
RecordingPort record_port = recording_ervice.getRecordingPort();


BindingProvider bindingProvider = (BindingProvider) record_port;

// Add a security handler for the credentials
final Binding binding = bindingProvider.getBinding();
List<Handler> handlerList = binding.getHandlerChain();
if (handlerList == null) {
    handlerList = new ArrayList<Handler>();
}

handlerList.add(new RecordStream.SecurityHandler());
// binding.setHandlerChain(handlerList);

// Set the actual web services address instead of the mock service
Map<String, Object> requestContext = bindingProvider.getRequestContext();

requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + deviceip + "/onvif/media_service");
requestContext.put(BindingProvider.USERNAME_PROPERTY, user);
requestContext.put(BindingProvider.PASSWORD_PROPERTY, pass);

Recordings recordings = record_port.getRecordings();
Run Code Online (Sandbox Code Playgroud)

上面运行的代码给出了一个错误:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Method 'ns11:GetServiceCapabilities' not implemented: method name or namespace not recognized
Run Code Online (Sandbox Code Playgroud)

我也试过媒体服务,然后错误是:

Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 405: Method Not Allowed
Run Code Online (Sandbox Code Playgroud)

AMD*_*MDG 2

当您尝试使用媒体源时,您显然请求了未经授权的操作,因为服务器返回了错误代码 405。该方法被禁止使用,或者您需要凭据才能使用该方法。

至于Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Method 'ns11:GetServiceCapabilities' not implemented: method name or namespace not recognized,@Sigismondo 的说法是正确的,大多数网络摄像机不支持它。您将需要另一种录制方法(文字和双关语)来从网络摄像机进行录制。