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.