Stream RTSP from h264 /dev/video src

Hello.
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!

Hi,
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?

Thanks.
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.
Thanks.

Hi,
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://127.0.0.1:8554/test ! video/x-h264,width=1920,height=1080,framerate=15/1 ! h264parse ! autovideosink

and it fails with :

Delayed linking failed

and:

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test ! 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:/127.0.0.1:8554/test’:
Metadata:
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,
127.0.0.1 is localhost(Jetson Nano). If you run it on Nano, please try

gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! 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://10.19.107.93:8554/test ! xvimagesink

Thanks