Pelco Developer Network (PDN)

C++ video sample

Live video using VideoXpertSdk-ExampleRunner sample

So I run your VideoXpertSdk-ExampleRunner using a Bosch OnVIF, but it does not seem to display a live stream but rather only the first frame. Is that the intent? (The Vx System is working properly, although a bit slow).

Hello there, thank you for your post. I have a few questions and some comments that may help to determine what might be happening.

One important thing to consider and to keep in mind is that the VX SDK itself does not perform streaming, but is a wrapper for making calls and obtaining data from VideoXpert. Streaming is left to the designer of the specific solutions, and for the purposes of our sample code, we chose to use GStreamer. This provides a way to demonstrate streaming (typically, I promise) in normal circumstances so that developers can use whatever option they feel best suits their needs.

Seeing only the first stream of a live video stream is not what I'd consider normal, no. You commented that the VxSystem is working properly, although it is a bit slow -- are you referring to (#1) streaming when using a VideoXpert client application like Vx Ops Center? Or, (#2) are you referring to communication (requests and responses using the VX SDK to the VideoXpert system) is slow? This information may help to determine the problem, and it's important to note if the camera is streaming normally within VideoXpert itself using the Vx Ops Center client software.

If it is streaming properly in Vx Ops Center, then it may have to do with the Gstreamer streaming mechanism. It would also be good to know if you're attempting to stream live RTSP or MJPEG, and if it's Unicast or Multicast (and if the system is configured for multicast or unicast streaming). Finally, it would be good to review the information in the vxsdk logs (default location is ProgramData\Pelco\vxsdk), to see if anything there can be helpful. It's often helpful to set the VxLogLevel to TRACE, for more verbose information and communication between the SDK and VX -- the .NET-ExampleClient sample (C#) has an easy menu option to adjust that, but for the C++ sample you may have to add a line of code to adjust the log level.

If the camera is not streaming in a normal and typical fashion on your VideoXpert system when using the Vx Ops Center client, then it may be a different issue with the camera and VideoXpert specifically -- you'll want to contact Pelco Product Support to discuss the issue with our support team if that is the case.

Thanks for the reply. So I tried a Pelco IMP121A instead of the OnVIF Bosch and it works pretty well using RTSP (although there seems to be a 2 to 3 sec delay). On the other hand if I select the MJPEG option it shows only the first frame, using your C++ sample (ExampleRunner). Thoughts?

Thanks for the follow up. I'm glad to hear that the Pelco camera is working pretty well when using RTSP.

I presume that you mean it is working pretty well when using RTSP when using the VX SDK and Sample code (ExampleRunner C++). Do these cameras all, Pelco and non-Pelco, also perform well when using RTSP in VideoXpert Ops Center? What about when you attempt to stream MJPEG when using Ops Center?

It's important to make sure all behaviors are working properly within the standard VideoXpert environment before attempting them using the VX SDK and sample code. If they aren't working properly in the VideoXpert environment and tools, then the SDK will additional likely have problems. Sometimes streaming behaviors work properly in VideoXpert Ops Center, but then have some issues when using GStreamer / Sample code streaming methods -- that's a little different and can sometimes due to differences in implementation between streaming in Ops Center and streaming when using the Sample code.

Please let me know the answers to my questions here, and we can determine the best course of action to move forward. It might be an issue streaming using the sample code implementation of GStreamer and MJPEG using non-Pelco cameras... or it might be streaming MJPEG using the non-Pelco cameras in general if Ops Center also has problems displaying MJPEG streams.

Thanks for your help.
To your question "Do these cameras all, Pelco and non-Pelco, also perform well when using RTSP in VideoXpert Ops Center?":
I could not find an RTSP/MJPEG Option on the Ops Center, so not sure what protocol it is using.
I also noticed that Increase/ Decrease playback speed is not working using the C++ sample (ExampleRunner) (RTSP mode [_mediaControl->Play(_speed)] is returning false. Ops Center works fine if I increase/decrease speed. Thoughts?

Thank you for the follow up.

The different stream options can be found under the 'View' Hyperlink text in Ops Center, on the upper left. I've included a screenshot to help direct your attention to it:

Video Quality - Ops Center.png

Additionally, under Workstation Configuration, under the VX System Connections tab, you can edit a system to enable/disable the following options: Allow RTSP/RTP > Allow UDP > Allow Multicast. They are dependent options, so to enable Multicast, the previous two must also be selected. I find that sometimes, depending on network configurations, different options will perform differently ... so try them out as best fits your system. If you are having issues with cameras streaming in Ops Center, it is best to reach out and Contact Pelco Product Support via phone call or email.

Regarding your other comments related to playback speeds when using the sample - thank you for bringing that to our attention. We did recently have some exchanges of posts with some others users about this topic. Recently some changes were made to streaming in the samples. The VX SDK does have a project for the Media Controller - a streaming option built using GStreamer that isn't technically a part of the VX SDK. The new DLLs that we have available on Nuget do have this Media Controller built in and are denoted by the '-Media' extension to the name. It is possible to modify this on your own, using the source code available for the Media Controller library that is on GitHub.

One of our partners did discover an issue with playback speeds and post a solution to it on this forum thread just last week. The post is here, so that you can review the information there: not able to play recording content properly video xpert 3.0.17 sdk. Hopefully that will help you out.