GStreamer to stream cameras connected to the second Nano

I’m new to this GStreamer thing. The thing i wanna do is to have two Nanos (master and slave) connected by ethernet cable. each nano connect two cameras (so 4 cameras in total). Then the slave nano can use GStreamer to stream 2 cameras and send to master, the master will stream its own two cameras and also receive two streams from the slave. I’ve tried udpsink, but since my master and slave nanos have the same host IP address, it didn’t seem to work.

On the master, i ran

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! ‘image/jpeg,width=1280,height=720,framerate=60/1’ ! videorate ! ‘image/jpeg,framerate=12/1’ ! nvjpegdec ! ‘video/x-raw’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),width=640,height=480’ ! nvv4l2h264enc maxperf-enable=1 control-rate=0 bitrate=400000 insert-sps-pps=true iframeinterval=10 ! h264parse ! rtph264pay pt=96 ! udpsink host= port=8001 sync=false -e
then change the device and port number for the second camera. How can i start the slave cameras? only changing host number didn’t work for me…
Or if my understanding is not correct? Can anyone please provide some reference?


Yo may try RTSP. Please refer to

You can configure different port number to each stream.
Usually each device should get one unique IP in LAN. It is strange you have the two device with same IP.

Thanks DaneLLL! For record, I managed to get the stream using the command:

./test-launch ‘v4l2src device=/dev/video0 io-mode=2 ! image/jpeg,width=1280,height=720,framerate=60/1 ! videorate ! image/jpeg,framerate=12/1 ! nvjpegdec ! video/x-raw ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96 audiotestsrc ! voaacenc ! queue ! rtpmp4apay pt=97 name=pay1’

I can visualise it from vlc using rtsp://<TARGET_IP_ADDRESS>:8554/test

also I can visualise it using

export RTSP_PATH=rtsp://<TARGET_IP_ADDRESS>:8554/test

gst-launch-1.0 rtspsrc location="$RTSP_PATH" latency=500 ! rtph264depay ! h264parse ! omxh264dec ! nvoverlaysink overlay-x=800 overlay-y=50 overlay-w=640 overlay-h=480 overlay=2