Tutorial 5 – Display Layouts salvo

Tutorial 4 – Display Layouts vport

In the previous tutorial we introduced layouts and the most basic layout property “vport”.

Another layout property that we can take advantage of is “salvo”. It associates one or more video streams to a viewport and it can switch between them on a timer.

Here’s our 2×1 example from the last tutorial using the “salvo” layout property:

Definition of layout property “salvo”:

LayoutProperty: salvo
Description: Associates a stream to a viewport. A single viewport can be associated with multiple streams which will be switched to sequentially assuming the Time parameter is set to a non-zero positive value.
LayoutParameters: ViewPortID,PtzCapabilities,Time,VideoUrl
ViewPortID: 0 indexed viewport identifier.
1 – Can do relative movement.
2 – Can box.
4 – Can virtual joystick.
Time: When having multiple salvo strings referencing the same viewport, determines how many milliseconds to wait before showing the next video. E.g. salvo: 0,0,5000,… , salvo: 0,0,12000,… Would show the first video for 5 seconds, then switch to the second video for 7 seconds, after which the cycle repeats.
VideoUrl: The qualified URL of the video stream.

Notice how we’re not using SetViewportSource any longer. If you set the layout property “salvo” Time parameter to 0 then switching will cease at the current stream; allowing us the ability to use “salvo” as a way to associate a viewport with a video stream permanently which is analogous to using SetViewportSource.

Now let’s make this a little more interesting by switching streams in a viewport:

In the layout above, the second video viewport (right viewport) will switch between 2 streams. The first stream will switch to the second after 5 seconds, and the second streams will switch to the first after 10 seconds. Even though we’re using the same camera for both streams, you can tell it’s switching by the title bar at the top of the viewport. It will read “[1 of 2]” or “[2 of 2]” depending on which stream is currently in view.

Screenshots of the final program:

That’s it. You can now create a stream switching layout and simplify associating video streams to video viewports using the layout property “salvo”.

Tutorial 6 – Display Layouts hotspot