Gstreamer RTSP to RTMP

Hi

I have a Jetson Orin NX 8 GB module (with nvenc - video enc HW)

I’m trying to stream a video from RTSP to RTMP via GStreamer command:

gst-launch-1.0 \
  rtspsrc location=rtsp://<rtsp_address> ! \
  rtph264depay ! h264parse ! nvv4l2decoder ! \
  nvv4l2h264enc bitrate=2000000 ! h264parse ! flvmux streamable=true ! \
   rtmpsink location="rtmp://<username:password@rtsp_url/share_key>"

without any success, I’m always getting connection errors:

(ERROR: from element /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0: Could not open resource for writing.
Additional debug info:
gstrtmpsink.c(293): gst_rtmp_sink_render (): /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0:
Could not connect to RTMP stream ")

note that when using ffmpeg it’s working through CPU encoding libx264 and this is the command for FFmpeg:

ffmpeg -rtsp_transport tcp -i rtsp://<rtsp address> \
-profile:v main -keyint_min 60 \
-sc_threshold 0 -bufsize 0 -vf scale=640:360 -vcodec libx264 -preset:v veryfast \
-pix_fmt yuv420p -r 15 -f flv rtmp://<username:password@rtsp_url/share_key>

Hi,
Not sure but it seems like you would need to run RTMP sever first, and then use rtmpsink. We are also interested in setting up RTMP. Would see if other users can share experience.

If you figure out a solution, please kindly share to us.

FYI, there are setup of UDP and RTSP in AGX Orin FAQ page.

Hi @DaneLLL
but it’s working using FFMPEG, as I described above. What could be the difference between FFMPEG and GStreamer in terms of RTMP?

Thanks

UPDATE : the issue was resolved , I’ve change the RTMP server provider , it’s working now

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.