Sending two simultaneous video stream over WiFi

Could we live stream two videos over WiFi from an AGX to NX simultaneously (two USB cameras connected to AGX, reading them through openCV, and sending over WiFi, to be received by NX). Which method could give us minimum latency. Are there some examples that we could look into. If this is possible, could we send the videos pear to pear (directly from AGX to NX, maybe also using a second Wi-Fi adaptor on each) not using a router.

Hi,
General usecases are to use UDP or RTSP. Please refer to

Jetson Nano FAQ
Q: Is there any example of running RTSP streaming?

Jetson 4k Encoding -> Decoding Pipeline and latency - #11 by DaneLLL
Delay in video - #5 by DaneLLL

Yo may try the two cases and pick one fitting your usecase.

1 Like

Hi @DaneLLL,
Many thanks
./test-launch “videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96”
works as expected.

when I have a Econsytems See3Cam_130 connected as video0 source:
./test-launch “device=/dev/video0 ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96”
works as well

But
./test-launch “v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=720,framerate=30 ! omxh264enc ! rtph264pay name=pay0 pt=96”
doesn’t work. Camera turns-on very briefly and turns off again, and receiving side says “unable to open”

And if I wanted to stream two USB cameras at the same time, should I modify the Test_launch to add another port maybe?

Could you help

Best,
Sefa

Hi,
Since your camera outputs UYVY format, you need to convert it to NV12 through nvvidconv:

v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=720,framerate=30 ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96

You can check if the pipeline is valid through gst-launch-1.0 command and then apply it to test-launch:

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1280,height=720,framerate=30 ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96 ! fakesink
1 Like

I receive this message when I try to check the pipeline:
WARNING: erroneous pipeline: could not link v4l2src0 to nvvconv0, neither element can handle caps video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(int)30

Edit1:removing the frame rate, check is OK

This is the message when I stream it, after I try to connect to stream:
(test-launch:10898): GLib-GObject-WARNING **: 16:29:15.333: invalid cast from ‘GstV4l2Src’ to ‘GstBin’

(test-launch:10898): GStreamer-CRITICAL **: 16:29:15.333: gst_bin_get_by_name: assertion ‘GST_IS_BIN (bin)’ failed

Edit2: I don’t know why double quotes was the issue, changing it to single quotes work

Hi @DaneLLL ,

$ gst-launch-1.0 uridecodebin uri=rtsp://<SERVER_IP_ADDRESS>:8554/test ! nvoverlaysink

opens a full-size window, with no re-sizing option, how can we open a window of certain size, or control the window size or re-size the window at the receiver side

Thanks

Another Question is:

$ gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvoverlaysink

does not open any video window:
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000106629
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Hi,
For video scaling, you can utilize nvvidconv plugin. Two reference pipelines:

$ gst-launch-1.0 uridecodebin uri=rtsp://10.19.107.93:8554/test ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=360' ! nvegltransform ! nveglglessink
$ gst-launch-1.0 uridecodebin uri=rtsp://10.19.107.93:8554/test ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=360' ! nvoverlaysink overlay-w=640 overlay-h=360

The v4l2 source may not support YUY2(YUYV) format. You may refer to Jetson Nano FAQ:
Q: I have a USB camera. How can I launch it on Jetson Nano?

1 Like