Skip to content

Conversation

@Silex
Copy link
Contributor

@Silex Silex commented Dec 22, 2025

  • Fix settings lost when stream usage is modified.
  • Fix -WhatIf that displays empty stream names.
  • Adds verbosity when changing settings.
  • Move Write-Verbose to correct place (it was in deprecated -Recorded path).

Parts of it is AI generated so please double check.

@Silex Silex force-pushed the stream-improvements branch from 947b44b to 5543b46 Compare December 22, 2025 08:41
@Silex Silex force-pushed the stream-improvements branch 3 times, most recently from 19e5c1d to 4cbbe19 Compare January 13, 2026 07:44
@joshooaj joshooaj force-pushed the stream-improvements branch from 4cbbe19 to e27b46f Compare January 21, 2026 03:15
@joshooaj
Copy link
Contributor

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 $stream object. And updating more than one stream at a time shows both "sync" issues, as well as a failure to apply all stream-usage changes server side.

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
111x111

So the command technically worked, but it failed to call Update() on my local VmsCameraStreamConfig object after changing the resolution and still showed the old resolution. Once I called the update method myself, everything was correct locally and on the server.

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 $stream object shows the old resolution while showing the updated "stream usage" properties.

Multiple streams in the pipeline

If 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
#>

LiveMode

The local state matches what I see in Management Client, so that's good. However, only the third stream was correctly set to Always.

Resolution

The resolutions are all correct in Management Client, but only 2/3 of the local stream objects show the updated value. Running Update() on the three streams gets the local resolution value in sync with the server so they're all showing 111x111, but LiveMode was still only modified on one of the three streams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants