#!/bin/bash # This script will display six cameras in a 3x2 tiled display. The script # assumes 1920x1080 display resolution. # ## # This generates a pipeline for a single camera # # @param sensor_id - 0-5 # @param overlay_id - 0-5 # @param x_offset - where to place the camera output # @param y_offset - where to place the camera output cam() { local sensor_id="$1" local overlay_id="$2" local x_offset="$3" local y_offset="$4" # This won't display anything. This is useful for measuring system # performance because there is no need to do any format # conversions. #echo -n nvcamerasrc sensor-id=$sensor_id fpsRange=\"30 30\" #echo -n ! fpsdisplaysink text-overlay=false video-sink=fakesink # This displays the cameras on the screen echo -n nvcamerasrc sensor-id=$sensor_id fpsRange=\"30 30\" echo -n ! 'video/x-raw(memory:NVMM), width=(int)640, height=(int)540, format=(string)NV12, framerate=(fraction)30/1' # echo -n ! nvvidconv # echo -n ! fpsdisplaysink text-overlay=false video-sink='"'nvoverlaysink overlay=$overlay_id overlay-x=$x_offset overlay-y=$y_offset overlay-w=640 overlay-h=540'"' # You don't have to use the fps sink echo -n ! nvoverlaysink overlay=$overlay_id overlay-x=$x_offset overlay-y=$y_offset overlay-w=640 overlay-h=540 } # The -v is required to see the FPS values # gst-launch-1.0 -v \ # $(cam 5 5 0 0) \ # $(cam 4 4 640 0) \ # $(cam 3 3 1280 0) \ # $(cam 2 2 0 540) \ # $(cam 1 1 640 540) \ # $(cam 0 0 1280 540) gst-launch-1.0 -v \ $(cam 0 0 0 0) \ $(cam 1 1 640 0) \ $(cam 2 2 1280 0)