Problem in determining PTZ types, Camera streaming live and Playback

Before asking any question, I would like to describe my application briefly. We are developing a 32bit WPF application. We want to make a “MileStone Component Integration” using MIP SDK. Goal of our application is to communicate with MileStone VMS and fetch camera streaming and show from within our application. We also want to initiate PTZ command for the cameras from our application.

My questions are:

1. How we can determine whether a camera supports Absolute PTZ or Continuous PTZ or Relative PTZ. For example, say if I have six cameras(C1 to C6), among them four(C1 to C4) are PTZ. Now suppose: C1 supports Absolute PTZ only, C2 supports Continuous PTZ only, C3 supports Relative PTZ only, and C4 supports both Absolute and Continuous PTZ. How we can determine which camera supports what PTZ type.

We have check the VideoOS.Platform.Item class and found that each item(in our case a Camera) has a read-only key-value pair property(public virtual Dictionary<string, string> Properties { get; }).

We have the MileStone’s sample application(PTZandPresets) to check PTZ operations and we have checked the key-value properties for one of our PTZ camera and the values are:

PTZ : Yes

PTZCenter : Yes

PTZRectangle : No

PTZHome : Yes

PTZDiagonal : Yes

pan : Relative

tilt : Relative

zoom : Relative

Ipix : No

PanoramicLens : No

ShortCut :

EdgeSupported : No

Channel : 0

I was wondering what are the property names(and corresponding values), which helps us to determine, that whether a camera supports either Absolute or Relative or Continuous PTZ or any combination of the three. In the above key-value collection of our PTZ camera, we have found the following three properties:

pan : Relative

tilt : Relative

zoom : Relative

Does the above three properties implies that the camera supports only Relative PTZ. If yes, what will be the value for Absolute or Continuous or Combination of Absolute and Continuous(or any other combination). I was wondering if there is any documentation regarding this.

2. Currently for any type of PTZ operations, we are using the following codes:

For Pan Right:

VideoOS.Platform.Messaging.Message msg = new VideoOS.Platform.Messaging.Message(MessageId.Control.PTZMoveCommand, VideoOS.Platform.Messaging.PTZMoveCommandData.Right);

EnvironmentManager.Instance.SendMessage(msg, SelectedCamera.FQID);

For Pan Left:

VideoOS.Platform.Messaging.Message msg = new VideoOS.Platform.Messaging.Message(MessageId.Control.PTZMoveCommand, VideoOS.Platform.Messaging.PTZMoveCommandData.Left);

EnvironmentManager.Instance.SendMessage(msg, SelectedCamera.FQID);

We have used the similar type of codes for Tilt and Zoom. My question is it okay to use the above code for both Absolute and Relative PTZ operation or do we need to use different code for different types of PTZ (Absolute or Relative) type.

For continuous PTZ we are currently using the following code:

private void PanTiltZoomForContOperation(string panVal, string panSpeedVal, string tiltVal, string tiltSpeedVal, string zoomVal, string zoomSpeedVal)

{

string pan = panVal;

string panSpeed = panSpeedVal;

string tilt = tiltVal;

string tiltSpeed = tiltSpeedVal;

string zoom = zoomVal;

string zoomSpeed = zoomSpeedVal;

PTZMoveStartCommandData2 data = new PTZMoveStartCommandData2();

Double.TryParse(pan, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.Pan);

Double.TryParse(tilt, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.Tilt);

Double.TryParse(zoom, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.Zoom);

Double.TryParse(panSpeed, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.PanSpeed);

Double.TryParse(tiltSpeed, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.TiltSpeed);

Double.TryParse(zoomSpeed, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out data.ZoomSpeed);

EnvironmentManager.Instance.SendMessage(

new VideoOS.Platform.Messaging.Message(MessageId.Control.PTZMoveStartCommand, data), _playbackFQID);

}

3. To show the camera streaming we are using VideoOS.Platform.Client.ImageViewerControl. But the control frequently lost the connection with the camera. Specially at the time of PTZ operation. Whenever we initiate any PTZ command, first the connection gets lost and then again reconnect. This causes an unsatisfactory user experience. I was wondering what are the possible causes for this type of issues.

4. In our application, within the same Window we are using two VideoOS.Platform.Client.ImageViewerControl: one for live and other for playback streaming. For playback, along with the ImageViewerControl, we are also using the PlaybackWpfUserControl. For Playback streaming we are referring the MileStone’s sample application “PlaybackWpfUser”. I was wondering is it necessary to use PlaybackWpfUserControl to implement playback streaming. Our playback code is as follows:

XAML

----------

xmlns:platformclient=“clr-namespace:VideoOS.Platform.Client;assembly=VideoOS.Platform”

<platformclient:ImageViewerWpfControl x:Name=“_playbackImageViewerControl” />

<platformclient:PlaybackWpfUserControl x:Name=“_playbackUserControl” Visibility=“Visible” Grid.Row=“1”/>

.CS

-------

FQID _playbackFQID;

_playbackImageViewerControl.Disconnect();

_playbackImageViewerControl.EnableDigitalZoom = false;

_playbackImageViewerControl.MaintainImageAspectRatio = true;

_playbackImageViewerControl.EnableVisibleHeader = true;

_playbackImageViewerControl.EnableVisibleCameraName = true;

_playbackImageViewerControl.EnableVisibleLiveIndicator = true;

_playbackImageViewerControl.EnableVisibleTimestamp = true;

  if (\_playbackFQID == null)

  {

    \_playbackFQID = ClientControl.Instance.GeneratePlaybackController();

    \_playbackUserControl.Init(\_playbackFQID); 

  }

EnvironmentManager.Instance.Mode = Mode.ClientPlayback;

_playbackUserControl.SetCameras(new List() { SelectedCamera.FqId });

_playbackImageViewerControl.PlaybackControllerFQID = _playbackFQID;

_playbackImageViewerControl.CameraFQID = SelectedCamera.FqId;

_playbackImageViewerControl.Initialize();

_playbackImageViewerControl.Connect();

_playbackImageViewerControl.Selected = true;

EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(

                        MessageId.SmartClient.PlaybackCommand,

                        new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = startTime.AddHours(-10).ToUniversalTime() }), \_playbackFQID);

I would like to mention the above code is not able to show the playback streaming. It is always showing the live streaming. I was wondering does the above code is not correct for showing Playback streaming

Early reply from MileStone end will be highly appreciated.

This is a developer forum and it is open for all. Please make sure that it stays usable (searchable) by doing one thread for one question.

If you want to have Milestone answer and not anybody else you can make four support cases.

Okay. I will create different threads for each question. I would also like to mention that I already created a case for these questions and MileStone support team suggested me to post the questions in developer forum. So answer from anyone(MileStone or any other developer) will be highly appreciated. Thanks.

This is so wrong. I am so sorry to hear this. Please give me the support case number.

My case number is MSC364747. The case is already closed by MileStone. Thanks.

You can check this link:

https://www.milestonesys.com/community/business-partner-tools/supported-devices/

and see if your device is supported. Also what kind of PTZ support is on your device.

Thanks Rie for the information. But I am looking for a programmatic approach to determine whether a camera is Absolute or Relative or Continuous PTZ enabled. I do not have access to the cameras. All I have MileStone’s C# classes and methods to access the VMS from my WPF application.

Hi Anirban,

You have mentioned that “I would like to mention the above code is not able to show the playback streaming. It is always showing the live streaming. I was wondering does the above code is not correct for showing Playback streaming”

I am also facing the same issue. Have you find the solution? if, Could you please share?

Hi Anuroopa. Yes, my playback streaming is working now. If you can able to share your playback code I may suggest you the possible fixes.

Hi Anirban,

If you could share your email id i will send you my source code.

Thank you

My email id: nrbndutta8@gmail.com.

Hi Anirban,

Thanks for your reply, Between I found the mistake I made, Code working fine now. I will contact you through your email id if I face any issues in future.