Skip to content

Set-VmsCamera

SYNOPSIS

Sets one or more property values on the specified camera or cameras.

SYNTAX

Set-VmsCamera [-Camera] <Camera[]> [[-Name] <String>] [[-ShortName] <String>] [[-Description] <String>]
 [[-Enabled] <Boolean>] [[-Coordinates] <String>] [[-GisPoint] <String>] [[-Direction] <Double>]
 [[-CoverageDirection] <Double>] [[-FieldOfView] <Double>] [[-CoverageFieldOfView] <Double>]
 [[-Depth] <Double>] [[-CoverageDepth] <Double>] [[-Units] <String>] [[-PrebufferEnabled] <Boolean>]
 [[-PrebufferInMemory] <Boolean>] [[-PrebufferSeconds] <Int32>] [[-RecordingEnabled] <Boolean>]
 [[-RecordingFramerate] <Int32>] [[-RecordKeyframesOnly] <Boolean>] [[-RecordOnRelatedDevices] <Boolean>]
 [[-EdgeStorageEnabled] <Boolean>] [[-EdgeStoragePlaybackEnabled] <Boolean>]
 [[-ManualRecordingTimeoutEnabled] <Boolean>] [[-ManualRecordingTimeoutMinutes] <Int32>] [-PassThru] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

Uses Milestone's Configuration API to modify properties of cameras and saves the changes to the Management Server. Most parameters represent the Milestone MIP SDK property names of the underlying camera object. However, there are a few custom parameter names including "Coordinates", "Direction", "FieldOfView" and "Depth" which accept values that are easier to understand than the values expected by the MIP SDK.

This cmdlet supports the "-WhatIf" parameter switch. Use this to test to see what would happen and if the changes made are what you would expect to see. You may also use the "-Verbose" switch without the "-WhatIf" switch, and you will see all the changes applied to the camera(s).

You do not need to use this cmdlet to make configuration changes to cameras. You could choose to modify the properties directly on the camera objects, and then call the ".Save()" method on the object(s) when you're ready to push those changes to the Management Server. However, this cmdlet provides an idiomatic PowerShell option to accomplish the same task with less effort.

REQUIREMENTS

  • Requires VMS connection and will attempt to connect automatically

EXAMPLES

Example 1

Connect-ManagementServer -ShowDialog -AcceptEula
Get-VmsHardware | Get-VmsCamera -Channel (1..63) -Verbose | Set-VmsCamera -Enabled $false

<# OUTPUT
VERBOSE: Performing the operation "Changing Enabled from True to False" on target "Cash Register".
VERBOSE: Performing the operation "Saving changes" on target "Cash Register".
VERBOSE: Performing the operation "Changing Enabled from True to False" on target "Entrance".
VERBOSE: Performing the operation "Saving changes" on target "Entrance".
VERBOSE: Performing the operation "Changing Enabled from True to False" on target "LPR".
#>

In this example, we first ensure we are logged in to the Management Server. Then we gets all enabled cameras with a channel number between 1 and 63 (camera 2 to camera 64), and disable them. You might do this if you only use the first channel on every camera, and all other channels should be disabled. In this case, channels higher than 63 would be unchanged. If you had devices with more unused channels than this, you could use "(1..511)" to select all cameras from the 2nd to the 512th channel.

Example 2

$selectedCameras = Select-Camera -AllowFolders -AllowServers -RemoveDuplicates
$props = @{
    PrebufferEnabled = $true
    PrebufferSeconds = 10
    PrebufferInMemory = $true
    Verbose = $true
}
$selectedCameras | Set-VmsCamera @props

<# OUTPUT
VERBOSE: Performing the operation "Changing PrebufferSeconds from 3 to 10" on target "Camera 1".
VERBOSE: Performing the operation "Saving changes" on target "Camera 1".
VERBOSE: Performing the operation "Changing PrebufferSeconds from 3 to 10" on target "Camera 2".
VERBOSE: Performing the operation "Saving changes" on target "Camera 2".
#>

Prompts for a camera selection and accepts the selection of camera groups or recording servers, and removes duplicate entries in the results just in case the same cameras are present in multiple groups or subgroups. Cameras are retrieved from the selected group(s) recursively.

Next, each camera is configured to use an in-memory pre-buffer of up to 10 seconds. All changes made are logged to the verbose stream so each configuration change made to each camera will be displayed in the console.

Example 3

$vmsCameraParams = @{
    Camera = Get-VmsCamera -Name 'Office Entrance'
    Coordinates = '45.4171601197572, -122.732137977298'
    Direction = 90
    FieldOfView = 180
    Depth = 15
    Verbose = $true
}

Set-VmsCamera @vmsCameraParams

<# OUTPUT
VERBOSE: Performing the operation "Changing CoverageDirection from 0.505555555555556 to 0.25" on target "Cam Lab Camera".
VERBOSE: Performing the operation "Changing CoverageFieldOfView from 0.125 to 0.5" on target "Cam Lab Camera".
VERBOSE: Performing the operation "Changing CoverageDepth from 37.49040000015 to 4.57200000001829" on target "Cam Lab Camera".
VERBOSE: Performing the operation "Saving changes" on target "Cam Lab Camera".
#>

A hashtable named $vmsCameraParams is defined with all the parameters needed to change the GPS location, direction, field of view, and depth of field for the camera(s) named "Office Entrance". The hashtable is then "splatted" into the cmdlet and because we included the Verbose switch, all changes made to the camera are logged to the console.

Note that if the settings already matched these values, there would be nothing logged to the console because no changes had to be made.

PARAMETERS

-Camera

Specifies one or more Milestone Configuration API camera objects such as those returned by Get-VmsCamera.

Type: Camera[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Coordinates

Specifies GPS coordinates in a "latitude, longitude" format where latitude and longitude are positive or negative numberic values with no alphabetic characters. For example, "45.4171601197572, -122.732137977298".

To remove the coordinates from a camera, you may set the value to $null or ''.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CoverageDepth

Specifies the depth of the camera's field of view in meters.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CoverageDirection

Specifies the orientation of the camera as a 360-degree compass bearing expressed as a value between 0 and 1. For example, a value of 0 represents North while a value of 0.5 represents South, and 0.75 represents West. You can produce the right value by dividing the compass heading value, such as 270 degrees (East), by 360, for a value of 0.75.

Alternatively, you may choose to use the Direction parameter which allows for specifying a value in degrees between 0 and 360. If the Direction parameter is provided, it takes priority over CoverageDirection.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-CoverageFieldOfView

Specifies the angle of the field of view of the camera in degrees, expressed as a value between 0 and 1. For example, a value of 0.25 represents 90 degrees and a value of 0.5 represents 180 degrees. You can produce the right value by dividing the field of view in degrees, by 360.

Alternatively, you may choose to use the FieldOfView parameter which allows for specifying a value in degrees between 0 and 360. If the FieldOfView parameter is provided, it takes precedence over CoverageFieldOfView.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Depth

Specifies the depth of the field of view, either in meters, or in feet, depending on the region settings of the environment in which PowerShell is running. If PowerShell is running in a PC configured in a region of the United States, the value will be treated as a measurement in feet. In most other cases the value will be treated as a measurement of meters. To override the regional default or explicitly include the units in your script, you may use the Units parameter.

This parameter overrides the CoverageDepth parameter if that parameter is also provided.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Description

Specifies the desired camera description. This is visible in the Management Client and may be searchable in some clients or utilities.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Direction

Specifies the compass orientation of the camera in degrees between 0 and 360. This parameter overrides the CoverageDirection parameter if that parameter is also provided.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-EdgeStorageEnabled

Specifies that edge storage may or may not be used.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 21
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-EdgeStoragePlaybackEnabled

Specifies that playback may or may not be done directly from edge storage.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 22
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Enabled

Specifies that the camera should be enabled or disabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-FieldOfView

Specifies the field of view of the camera in degrees between 0 and 360. This parameter overrides the CoverageFieldOfView parameter if that parameter is also provided.

Type: Double
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-GisPoint

Specifies the GPS coordinates of the camera in a custom format. The value is accepted as a string in the format "POINT EMPTY" to "un-set" the coordinates, or "POINT (X Y [Z])" where the elevation field "Z" is optional and not usually provided, X represents the longitude, and Y represents the latitude. It's important to note that this format reverses the standard "latitude, longitude" order because it is expressed internally in Milestone as a "point" with X/Y coordinates.

You may use the Coordinates parameter for a more user-friendly format for setting coordinates.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ManualRecordingTimeoutEnabled

Specifies that the timeout used to stop a manual recording session should be enabled or disabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 23
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ManualRecordingTimeoutMinutes

Specifies the maximum time the camera can be recording due to a manual recording trigger.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 24
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

Specifies a new name for the camera.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PassThru

Specifies that the modified camera object should be returned to the pipeline or caller. No output is produced by this cmdlet by default.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PrebufferEnabled

Specifies that the pre-buffer feature should be enabled or disabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 14
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PrebufferInMemory

Specifies that the pre-buffer feature should pre-buffer to memory, or to disk. When PrebufferInMemory is set to $false, then the pre-buffer will reside on disk.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 15
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-PrebufferSeconds

Specifies the size of the pre-buffer in seconds. The maximum size for the pre-buffer is 15 seconds when pre-buffering to memory. When pre-buffering to disk, the maximum value is 10000.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 16
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-RecordingEnabled

Specifies whether or not recording is enabled for this camera. When enabled, recording can be triggered manually from a client application or automatically based on the configured set of rules. When disabled, the camera cannot be recorded, and any existing recordings cannot be played back.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 17
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-RecordingFramerate

Specifies the desired recording frame rate. This applies only when the recorded stream is in MJPEG format. This setting has no impact when the recorded stream is MPEG4, H264, or H265.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 18
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-RecordKeyframesOnly

Specifies that only key-frames should be recorded. Typically, key frames are received once per second but the value can vary widely depending on stream settings.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 19
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-RecordOnRelatedDevices

Specifies whether or not related devices should be recorded whenever recording is triggered for the camera. Related devices typically include microphones, speakers and metadata associated with the camera.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 20
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-ShortName

Specifies the new short-name for the camera.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Units

Specifies whether the unit of measurement provided in the Depth parameter is in feet or meters. By default, the value will be interpreted based on your PowerShell environment's region settings. Set Units to Metric to explicitly specify that the Depth value represents meters. Set it to Imperial to specify that the Depth value represents feet.

This parameter does not affect the behavior of the CoverageDepth parameter. That value is always interpreted as meters.

Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Metric, Imperial

Required: False
Position: 13
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

VideoOS.Platform.ConfigurationItems.Camera[]

System.String

System.Boolean

System.Double

System.Int32

OUTPUTS

VideoOS.Platform.ConfigurationItems.Camera

NOTES