SHM setup

The Scailable Edge AI Manager can take video as input from video feeds through shared memory. To make that possible, Scailable integrates the GStreamer module shmsrc and can as such receive video from the GStreamer module shmsink.
The GStreamer module shmsink is responsible for allocating a shared memory area, communicating the filename representing the shared memory area to Scailable through a communication pipe, feeding video frames into the shared memory and signalling the receiver that frames are ready to be read. Scailable will then use the frames and signal back to the shmsink when a frame has been used enabling the module to reuse the shared memory area for new frames.
To use the SHM interface for a camera set its input camera format to "Gstreamer SHM". By default, the shared memory interface expects an input of 640 x 360, at a frame rate of 25 frames per second. The default settings for the Gstreamer SHM interface can be changed through the settings file. For more information on these settings, see the advanced settings page.
Next, set the camera address to a (per camera and instance) unique SHM path. For instance, /tmp/localcam
Next, install and then launch a GStreamer instance including, for instance, a video test source:
gst-launch-1.0 videotestsrc ! \
videoconvert ! \
video/x-raw,format=RGB,width=640,height=360,framerate=25/1 ! \
shmsink socket-path=/tmp/localcam sync=true \
wait-for-connection=false shm-size=10000000
Now, on running a model, the Scailable AI Manager will make use of this custom GStreamer source for video based inferences.
Another example of integration with GStreamer, here using v4l2src on an IMX based platform:
gst-launch-1.0 v4l2src device=/dev/video0 ! \
imxvideoconvert_g2d ! \
video/x-raw,width=640,height=360 ! \
videoconvert ! video/x-raw,format=RGB ! \
shmsink socket-path=/tmp/localcam \
wait-for-connection=false shm-size=10000000
Or, for instance, using the Aravis plugin with a grayscale industrial camera:
gst-launch-1.0 --gst-plugin-path=/usr/local/lib/aarch64-linux-gnu/ \
aravissrc ! \
video/x-raw,format=GRAY8,width=2448,height=2048,framerate=30/1 ! \
videoconvert ! videoscale ! \
video/x-raw,format=RGB,width=960,height=540,framerate=30/1 ! \
shmsink socket-path=/tmp/localcam sync=true \
wait-for-connection=false shm-size=10000000
Contact us if you are interested in further integration of your GStreamer plugin or video source with the Scailable AI Manager including automatic initialization of pipelines and other AI Manager specific optimizations.