MilestoneSystemsInc / PowerShellSamples

A collection of samples for managing your Milestone XProtect VMS using MilestonePSTools in PowerShell
https://www.milestonepstools.com
MIT License
36 stars 12 forks source link

VMSCameraGeneralSetting not applying (Rotation/Mirror) #122

Closed mrilanduk closed 6 months ago

mrilanduk commented 7 months ago

We believe we may of discovered a bug/Issues when trying to set rotation and Mirror using the Set-VMSCameraGeneralSetting. Settings is being passed and change is visible within the application however no change to the image rotation or mirror.

joshooaj commented 7 months ago

What Milestone XProtect version and MilestonePSTools version are you using?

This sounds familiar - I believe on some XProtect versions the validation is slightly broken and you're allowed to set a value to the "Display Value", or the value shown in the UI. But then the recording server doesn't do anything with the value because it isn't valid. For example, I think in some cases the management server will allow you to set the codec to "H264" even though the expected value is "h264".

Depending on the camera, there might be a difference between the raw values and the display values for the rotation/mirror options. For example, If a display value for MirrorImage is "Yes", the raw value might be "yes", and maybe the server is allowing the uppercase Y when it shouldn't, resulting in an invalid state where the new value shows up in the UI but isn't pushed to the camera.

Can you show the output of the command below? Change "MirrorImage" as needed based on the property names for your particular cameras. The "Name" column is the display name and the Value column is the value you should be sending with the "Set" command.

Sometimes you will only/also see entries like MinValue, MaxValue, and optionally StepValue which are used to help integrations understand the rules, if any, for a setting without fixed values.

$camera = Select-Camera
($camera | Get-VmsCameraGeneralSetting -ValueTypeInfo).MirrorImage
mrilanduk commented 7 months ago

Xprotect v23.2a PSTools v23.3.1 Screenshot 2024-02-22 085210

aoforb commented 7 months ago

@joshooaj this is very helpful thank you. So based on what you said, the variable for Rotation 180, mirror is 5 and not the string contained in Name column.

joshooaj commented 7 months ago

Yes that's correct @aoforb. @mrilanduk does this help with applying the settings correctly?

I was able to reproduce similar behavior using MilestonePSTools v23.3.2 on XProtect 2023 R3, where I can set a camera setting to the display value without receiving an error, but the actual setting and the displayed setting become inconsistent. I recorded a demonstration which I'll share here and also pass along to our product experience team in a bug report.

https://github.com/MilestoneSystemsInc/PowerShellSamples/assets/7669972/2e588122-64ce-4575-9dc6-58090d4d3ce4

Oh, here's the function I wrote to monitor the current live stream statistics in PowerShell as shown in the above demo.

Watch-CameraStream

joshooaj commented 6 months ago

Closing stale issue.

Note: The issue was identified and resolved for a future XProtect release - hopefully 2024 R1