-
Notifications
You must be signed in to change notification settings - Fork 1
Set-VmsCameraStream improvements #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
947b44b to
5543b46
Compare
19e5c1d to
4cbbe19
Compare
4cbbe19 to
e27b46f
Compare
|
I'm working through this @Silex. As-is, this failed the integration tests and I've made changes to get them to pass, but I'm still observing some annoying behavior that was present before, and your originally reported issue doesn't seem totally resolved. When using the latest released version, v25.2.21, updating the stream and live mode at the same time does work, but the updated resolution isn't reflected in the local I'm not sure what my next step is going to be - I feel like a significant rewrite of the command (while maintaining compatibility) is needed as it was spaghetti code to begin with. In any case, here are some of my observations using the released version of the module for reference. I'm using a StableFPS camera with three streams, and it starts with only Video Stream 1 enabled: # Initial resolution and livemode is 555x555 and WhenNeeded
$stream = $camera | Get-VmsCameraStream -LiveDefault
# Changing to 111x111 and Always
$stream | set-vmscamerastream -Settings @{Resolution='111x111'} -LiveMode Always
# Locally, the resolution doesn't seem to change but LiveMode does.
# On the server, both settings were changed as expected.
$stream.Update()
# Now, after manually calling Update() on the local VmsCameraStreamConfig object,
# the resolution shows what I see in Management Client
$stream.Settings.Resolution
111x111So the command technically worked, but it failed to call Next, if I try to enable Video Stream 2, make that the default live stream, set LiveMode to Always, and change the resolution: $stream = $camera | Get-VmsCameraStream -Name 'Video stream 2'
$stream | Set-VmsCameraStream -Settings @{Resolution='111x111'} -LiveDefault -LiveMode Always
$stream
$stream.Settings.Resolution
<#
Camera Name DisplayName Enabled LiveMode LiveDefault Recorded
------ ---- ----------- ------- -------- ----------- --------
Camera 1 Video stream 2 Video stream 2 True Always True False
555x555
#>Once again, all the settings take effect on the server, but the local Multiple streams in the pipelineIf I make changes to multiple streams, I see the same issue with stale resolution values, and I start to see a failure to update all the stream usage properties: $streams = $camera | Get-VmsCameraStream
<# INITIAL STATE
Camera Name DisplayName Enabled LiveMode LiveDefault Recorded RecordingTrack PlaybackDefault UseEdge
------ ---- ----------- ------- -------- ----------- -------- -------------- --------------- -------
Camera 1 Video stream 1 Video stream 1 True WhenNeeded True True Primary recording True True
Camera 1 Video stream 2 False False False No recording False False
Camera 1 Video stream 3 False False False No recording False False
555x555
555x555
555x555
#>
$streams | Set-VmsCameraStream -Settings @{ Resolution = '111x111' } -LiveMode Always
<# NEW STATE
Camera Name DisplayName Enabled LiveMode LiveDefault Recorded RecordingTrack PlaybackDefault UseEdge
------ ---- ----------- ------- -------- ----------- -------- -------------- --------------- -------
Camera 1 Video stream 1 Video stream 1 True WhenNeeded True True Primary recording True True
Camera 1 Video stream 2 Video stream 2 True WhenNeeded False False No recording False False
Camera 1 Video stream 3 Video stream 3 True Always False False No recording False False
555x555
111x111
111x111
#>LiveModeThe local state matches what I see in Management Client, so that's good. However, only the third stream was correctly set to ResolutionThe resolutions are all correct in Management Client, but only 2/3 of the local stream objects show the updated value. Running |
-WhatIfthat displays empty stream names.Write-Verboseto correct place (it was in deprecated-Recordedpath).Parts of it is AI generated so please double check.