Skip to main content

snapshot

The snapshot command is used to take and manage snapshots from the video received on any video encoder. You can save the snapshots in JPEG or PNG format. The parameters vary depending on the format selected. For example, in JPEG format, you can specify the image quality (from 1 (lowest) to 100 (highest)). 

When taking a snapshot, the filename is optional. If none is specified, a unique name will be generated based on the current time. To overwrite an existing file, use the overwrite=yes option and specify the filename when capturing the snapshot. You can specify different formats and image quality settings per snapshot in the snapshot take command. You can also set system-wide defaults for the preferred snapshot format and quality via the snapshot set command.

ID is used to select the video encoder (0 for Video Encoder 0, 1 for Video Encoder 1, 2 for Video Encoder 2, 3 for Video Encoder 3,...). 

Note

The snapshot command takes the input to the encoder just before encoding (which includes any scaling done before encoding).

Native Output Width/Height

Specifying Native (assigning a value of 0) for the width or height means that the snapshot size (in pixels) will match the output resolution of the selected encoder. No resizing of the output will be done when saving the snapshot. 

Synopsis

snapshot ID take [format=value] [width] [height] [filename=<filename> [overwrite=yes,no]][quality=value] [palette=value]
snapshot set [format=value] [quality=value] [palette=value] [width] [height] [maxsize=value] [overwrite=yes,no]
snapshot get
snapshot list
snapshot delete [<filename>, all]

Actions

ActionDescription

take

Takes a snapshot from the video received on any video encoder, where ID selects the encoder, as described above.

You can optionally specify the format and image quality settings per snapshot, as well as the filename.

set

Sets system-wide defaults for the preferred snapshot format and quality.

get

Displays the current format and quality defaults for the snapshot utility.

list

Displays the available snapshots on the system along with the resolution.

Snapshot files are stored under /usr/share/haivision/snapshots.

delete

Deletes either the snapshot specified by <filename> or all snapshots stored under /usr/share/haivision/snapshots.

Parameters

ParameterDefaultDescription/Values

format

jpeg

Specifies the image format: JPEG or PNG. When saving in JPEG format, you can also specify the desired image quality.

overwrite

no

(Only applies when a filename is provided) When enabled, any existing snapshot file with the same filename will be overwritten. yes,no

quality

100

(JPEG format only) Specifies the desired image quality from 1 (lowest) to 100 (highest). 1..100

width0 (Native)

By default, the snapshot resolution will match the output resolution of the selected encoder. See Native Output Width/Height above.

You can optionally set a numerical value between 1..3840 (in pixels) for the snapshot image width to force an upscale or downscale of the input resolution into the configured resolution when the snapshot is saved.

height0 (Native)

By default, the snapshot resolution will match the output resolution of the selected encoder. See Native Output Width/Height above.

You can optionally set a numerical value between 1..2160 (in pixels) for the snapshot image height to force an upscale or downscale of the input resolution into the configured resolution.

palettergb

(PNG format only) Specifies the color palette to apply when saving the image. May be used to change the level of precision at which each pixel’s value will be saved.

  • rgb: true color/no palette/no change to the pixel values
  • laboptimized: will generate files much smaller than the original (RGB) file size.
  • colorcube: will generally generate the smallest file sizes of the three settings although the actual file size is close to the laboptimized.

maxsize

100 MB

(Users must be assigned Administrator role) Specifies the amount of storage in MB available to snapshots. -1, 0..4096

  • 0 disables the snapshot feature.
  • -1 is used for unlimited storage and is only available when the location is an NFS-mounted drive.

Examples

# snapshot 0 take format=jpg filename=mysnaphot.jpg quality=80

Takes a single image snapshot (immediately) in JPEG format at 80% image quality and stores it under the filename mysnapshot.jpg.

# snapshot set format=jpg quality=80

Sets the system-wide defaults for the preferred snapshot format to jpg at 80% image quality.

# snapshot get

Returns the system-wide settings for the snapshot format, for example:

Current Defaults:
  Format         : PNG
  Overwrite      : No
  Output Width   : NATIVE
  Output Height  : NATIVE
  Palette        : RGB
Max Storage    : 100MB
# snapshot list

Lists the contents of the snapshot folder:

Snapshot Files (in /usr/share/haivision/snapshots/):
  snap-2021-10-25-12h55m50s.png
1 snapshot file is available.
3.23MB (3%) of snapshot disk storage space used.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.