Set up an encrypted SRTP stream
This guide shows you how-to establish an encrypted SRTP stream from an Axis device using GStreamer.
Prerequisites
You need:
- An Axis device with RTSPS support
- Device user credentials
- GStreamer ≥ 1.26
- Build tools for GStreamer (meson, ninja)
Step 1: Enable RTSPS on the device
Enable RTSPS on the device:
Network.RTSPS.Enabled=”yes”
Step 2: Build GStreamer
Clone and build GStreamer:
git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git
cd gstreamer
meson setup build
ninja -C build
Enter the development environment:
meson devenv -C build
Step 3: Start an encrypted stream
Run the GStreamer test client:
./subprojects/gst-plugins-good/tests/examples/rtsp/test-client-managed-mikey -l 'rtsps://<user>:<pass>@<CAMERA_IP>:322/axis-media/media.amp'
This command establishes an RTSPS session and receives media over SRTP.
Optional: Enable periodic re-keying
To re-key the session periodically, use the -r, --rekey-interval option with the desired interval in seconds (for example, 10):
./subprojects/gst-plugins-good/tests/examples/rtsp/test-client-managed-mikey -r 10 -l 'rtsps://<user>:<pass>@<CAMERA_IP>:322/axis-media/media.amp'
Optional: Select Encryption and Authentication algorithms
To select specific encryption and authentication algorithm, use the -c, --cipher and -a, --auth options with the desired values:
./subprojects/gst-plugins-good/tests/examples/rtsp/test-client-managed-mikey -c aes-256-gcm -a null -k 44 -l 'rtsps://<user>:<pass>@<CAMERA_IP>:322/axis-media/media.amp'
In this example, an authenticated encryption (AEAD) method — aes-256-gcm — is selected. This algorithm provides both confidentiality and integrity protection. Therefore, the authentication algorithm is omitted by setting it to null.
Step 4: Inspect available options
To see all supported arguments:
./subprojects/gst-plugins-good/tests/examples/rtsp/test-client-managed-mikey --help