Stream RTSP from h264 /dev/video src

I have a /dev/video src the transmit a h264 src, I need to stream an h264 rtsp stream.
I have tried to use
v4l2src device=/dev/video1 ! video/x-h264,width=1920,height=1080,framerate=15/1 ! rtph264pay name=pay0 pt=96 config-interval=10
From the gstreamer side I get:

0:00:03.581478176 26744 0x7fa401d140 WARN v4l2bufferpool gstv4l2bufferpool.c:790:gst_v4l2_buffer_pool_start:v4l2src0:pool:src Uncertain or not enough buffers, enabling copy threshold
0:00:04.712702013 26744 0x557385fd90 WARN rtspmedia rtsp-media.c:3867:gst_rtsp_media_suspend: media 0x7fac03b1b0 was not prepared
When I try to read it, and from the receiver side I get slow buffering, like decoder down’t work.

What is the best way to do what I want?
Thanks a lot!

Do yo launch the pipeline through test-launch? We have reference steps in
Jetson Nano FAQ
Q: Is there any example of running RTSP streaming?

Do I need to download only the test-lanuch.c?
Because I tried to do as guide says I get the following error:

undefined reference to ‘gst_rtsp_media_factory_set_enable_rtcp’
What can it be?
Thank you.

I managed to fix it using:

But I need a guide on how to stream h264 src, and not a YUYV src like shown in the guide.

Please add h264parse and try again:

v4l2src device=/dev/video1 ! video/x-h264,width=1920,height=1080,framerate=15/1 ! h264parse config-interval=1 !  rtph264pay name=pay0 pt=96

You may check if the pipeline is valid through gst-launch-1.0:

gst-launch-1.0v4l2src device=/dev/video1 ! video/x-h264,width=1920,height=1080,framerate=15/1 ! h264parse config-interval=1 !  rtph264pay name=pay0 pt=96 ! fakesink

And then apply it to test-launch.

Hi, thanks a lot!
I have done what you said, and from the streaming side it seems to work, but when I try to read it It just doesn’t work.
I tried to stream it to kinesis, I tried to show it using

gst-launch-1.0 uridecodebin uri=rtsp:// ! video/x-h264,width=1920,height=1080,framerate=15/1 ! h264parse ! autovideosink

and it fails with :

Delayed linking failed


gst-launch-1.0 rtspsrc location=rtsp:// ! rtph264depay ! video/x-h264,width=1920,height=1080,framerate=15/1 ! h264parse ! autovideosink

It runs but there is nothing to show.

and with ffmpeg I get:

[rtsp @ 0x7f22f4009280] decoding for stream 0 failed
Input #0, rtsp, from ‘rtsp:/’:
title : Session streamed with GStreamer
comment : rtsp-server
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p, 1920x1080, 90k tbr, 90k tbn, 180k tbc
[h264 @ 0x7f22f40b0420] no frame! 0KB vq= 0KB sq= 0B f=0/0

I even tried to run it with vlc, but again it seems like the stream is working but I get black screen.

Fro what I get nothing manages to parse the stream on the receiver side.
What can it be?

Thanks again!

Hi, is localhost(Jetson Nano). If you run it on Nano, please try

gst-launch-1.0 uridecodebin uri=rtsp:// ! nvoverlaysink

If you run it on another PC, you would need to set IP address of Nano. Such as:

$ gst-launch-1.0 uridecodebin uri=rtsp:// ! xvimagesink