Configuration
Platforms and sensors.
To work with live video streams, you must first configure them. In general, the server works with a logical entity called a Platform — such as a plane, drone, or car — that can carry multiple Sensors (video cameras) or other data sources. The operator configures the platforms.yml file to specify the existing platforms and network topology.
The StanagOnDemand server works with Stanag streams that come as UDP multicast streams. If you have unicast source streams, you can use a stream recaster for unicast-to-multicast recasting.
Basic platform configuration
Let's use an example to show the configuration file that defines two UAV platforms (with names UAV_1 and UAV_2)
The first UAV has four video sensors:
- EO/IR sensor with the stream coming from udp://227.1.1.1:30120
- Tail camera sensor with the stream coming from udp://227.1.1.2:30122
- Operator screen capture sensor with the stream coming from udp://227.1.1.3:30123
- Radar capture sensor with the stream coming from udp://227.1.1.4:30124
Note that the Radar sensor has the active parameter set to false (active: false), so this sensor is not monitored. Set it to true to enable monitoring.
The second UAV has only one sensor:
- EO/IR sensor with the stream coming from udp://228.1.1.1:1234
If you have only one UAV (platform) to monitor, there should be only one platform on the list.
# Platforms
platforms:
# First platform
- platform:
active: true
name: UAV_1
description: First platform
type: UAV
sensors:
- sensor:
name: EO
description: EO/IR sensor
active: true
type: video
url: udp://227.1.1.1:30120
- sensor:
name: Tail
description: Tail camera
active: true
type: video
url: udp://227.1.1.2:30122
- sensor:
name: Operator
active: true
type: video
url: udp://227.1.1.3:30123
- sensor:
name: Radar
active: false
type: video
url: udp://227.1.1.4:30124
# Second platform
- platform:
active: true
name: UAV_2
description: Second platform
type: UAV
sensors:
- sensor:
active: true
name: EO
type: video
url: udp://228.1.1.1:1234
Note. If you have to select the specific network interface, use add ?localaddr= to the url:
udp://227.1.1.1:30120?localaddr=192.168.1.28
Configuring live video preview per channel
By default, the video preview parameters are configured via environmental variables passed to the stserver-webrtc-streamer:
webrtc-streamer:
image: impleo/stserver-webrtc-streamer:2.0.2
container_name: webrtc-streamer
restart: always
depends_on:
- broker
- stsupervisor
environment:
STSERVER_NAME: ${SERVER_NAME}
VIDEO_BITRATE: "3500000"
VIDEO_RESOLUTION: "1280x720"
WEBRTC_SERVICE: "stanag2webrtc"
It is possible to override these parameters per channel by adding a live section to the sensor configuration. For example, if you have a video that can be directly played back in the browser (using the h264 codec) to preserve the original video quality and minimize CPU usage, it is recommended to use video pass-through by setting the videoPassthrough parameter to true.
# Platforms
platforms:
# First platform
- platform:
active: true
name: UAV_1
description: First platform
type: UAV
sensors:
- sensor:
name: EO
description: EO/IR sensor
active: true
type: video
url: udp://227.1.1.1:30120
live:
videoPassthrough: true
Alternatively, if you want to set specific video bitrate, resolution and codec, you can use the videoResolution, videoBitrate and videoCodec parameters.
# Platforms
platforms:
# First platform
- platform:
active: true
name: UAV_1
description: First platform
type: UAV
sensors:
- sensor:
name: EO
description: EO/IR sensor
active: true
type: video
url: udp://227.1.1.1:30120
live:
videoResolution: "1280x720"
videoBitrate: 2500000
videoCodecName: vp8
Video stream without KLV
If you video stream does not contain KLV metadata, you must set the noKlv parameter to true.
# Platforms
platforms:
# First platform
- platform:
active: true
name: UAV_1
description: First platform
type: UAV
sensors:
- sensor:
name: EO
description: EO/IR sensor
active: true
type: video
url: udp://227.1.1.1:30120
live:
noKlv: true