[Jetson Nano] Live stream from IP-cam and USB HDMI capture with gst-inspect-1.0 error


I’m trying to live stream two merged streams (rtsp from ip-camera and laptop screen capture through capture card) with gstreamer on Jetson Nano with hardware acceleration. The code execution doesn’t stop, but the live stream doesn’t appear.

I think that the main problem is this warning:
0:00:01.291620055 6383 0x559cf90590 WARN videoencoder gstvideoencoder.c:678:gst_video_encoder_setcaps: rejected caps video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)25/1, format=(string)I420, pixel-aspect-ratio=(fraction)15/11

Because when I try to stream only screen capture or video from ip-cam all the warning except the above-mentioned exist, but they don’t interfere program operation.
Here is my code:

Here is grepped warnings log(there is no errors in full log too).

1 Like

Somehow we are not able to access pastebin.com. Please share your pipeline in gst-launch-1.0 command. And the release version( head -1 /etc/nv_tegra_release ).

gst-launch-1.0 -v

v4l2src device=’/dev/video0’ io-mode=2 ! image/jpeg, width=640, height=480, framerate=30/1 !
nvjpegdec ! ‘video/x-raw, width=640, height=480, framerate=30/1’ !
nvvidconv ! ‘video/x-raw(memory:NVMM), width=640, height=480, framerate=30/1’ ! queue max-size-bytes=0 max-size-buffers=0 ! glue.

rtspsrc location=‘rtsp://’ protocols=tcp latency=500 ! rtph264depay ! h264parse ! nvv4l2decoder !
nvvidconv ! ‘video/x-raw(memory:NVMM), width=1920, height=1080, framerate=25/1’ ! queue max-size-bytes=0 max-size-buffers=0 ! glue.

nvcompositor name=glue sink_0::xpos=0 sink_0::ypos=252 sink_0::width=960 sink_0::height=540
sink_1::xpos=960 sink_1::ypos=252 sink_1::width=960 sink_1::height=540 !

nvvidconv ! ‘video/x-raw(memory:NVMM), width=1920, height=1080, framerate=25/1’ ! nvv4l2h264enc bitrate=‘4500000’ !
h264parse config-interval=1 disable-passthrough=true ! queue max-size-bytes=0 max-size-buffers=0 ! mux.
flvmux name=mux ! rtmpsink location=‘rtmp://a.rtmp.youtube.com/live2/<stream_code>’ &> debug_record_cam+screen.txt
release version:

R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t210ref, EABI: aarch64, DATE: Fri Oct 16 19:44:43 UTC 2020

It looks similar to
Gstreamer using nvcomposer to filesink hangs, but nvcomposer to nvoverlaysink works fine

Please replace the prebuilt lib and try again.

I’ve replaced the prebuilt lib and even added background width and height as in the topic on the link, the rejected caps warning gone, but live stream doesn’t appear. Is there any more possible solutions?
new warning log : new_warn_log - Pastebin.com

Please check if you can save it to a valid video file:

... ! h264parse ! matroskamux ! filesink location=a.mkv

Yes, now it records to file, what muxer can I use for live stream on youtube?

Since we don’t have much experience in this usecase, would suggest you go to gstreamer forum to get further help.
A similar topic:
USB webcam stream to YouTube.com - #5 by DaneLLL

Thanks, I’ve found a decision on that gstreamer forum: I added live=1 flashver=FME/3.0\20(compatible;\20FMSc\201.0)in rtmpsink’s location and added audiotestsrc to flvmux.