Pelco Developer Network (PDN)

Unable to get video stream on CSharpSample

I am running the CSharpSample. Cameras list after the connect successfully. When I select a camera and then seek or play, I get the following error:

An unhandled exception of type 'System.NullReferenceException' occurred in CSharpWrapper.dll
at CPPCli.MediaControl.get_Mode() in \csharpsample\csharpwrapper\include\mediacontrol.h:line 131

Probably it was NULL, while trying to access the Control.Current.Mode

I tried to delete the checking stream mode part of the code, but result is same. By the way MediaController path is right.

Hello there, thank you for your post.

I'm sorry to hear that you're having a problem with the sample code. I've discussed your issue with another developer engineer as well, and we'd like to ask for some of the VX SDK logs of the problem ... with the application set to Trace mode. Under File>VxSDK Log Level>Trace. The logs are generated in C:\ProgramData\Pelco\VxSdk\Logs.

If you could determine which section of the code is trying to call Current.Mode prior to the crash, that would be more helpful as well.

Thanks for your answer,

I switched log level to Trace mode, the log output in trace mode as following:

[SerSystem.cpp:27] Attempting to login to 10.31.16.7
[SerSystem.cpp:1095] Successfully logged in to 10.31
[SerSystem.cpp:1223] Started internal notifications
[SerSystem.cpp:1277] Stopped notifications
[SerSystem.cpp:1271] Stopped internal notifications

I took the code to the comment line that is trying to call Current.Mode, but still it tries to get Current.Mode and get same error.

Also, I can not get the video stream on the VxOpsCenter. When I try to play a camera, video time is running but I get an error 'Cannot connect the video source' on the black screen. However, I can watch without error on the web via VxPortal. So maybe, is this a configuration problem?

Thank you for the additional information.

I do strongly believe that you are experiencing a configuration or setup problem. I can definitely say that if video does not play in Ops Center, it will also not play when using VX SDK Sample code. Both use GStreamer for obtaining and rendering the video stream. In the web interface, Admin Portal, that streaming is done via JPEG... so it's not quite the same method (though also it is good for at least checking network connections at a basic level).

It could be an issue with network traffic for a non-JPEG video stream - if you have the VX configuration set to Multicast perhaps that's the issue and multicast video is not arriving to the client destination. It could also be a hardware problem if the video stream isn't rendering. More current versions of VideoXpert Ops Center do have some means to render video using software methods instead of relying on the graphics card hardware, but it still may play into the problem.

You could use Wireshark to check if video traffic and requests are being transmit between the VideoXpert system and Ops Center (much of the traffic is https, secure and encrypted, but you can check to see if the traffic exists). Most likely it is a configuration issue with VideoXpert or the Network.