A few things that may help:
-
For being decoded and displayed, some information is needed on receiver side, that can can be sent by sender. This include SPS/PPS and using an IDR or intrarefresh interval.
-
For receiving with ffmpeg or VLC, it may be easier to use MP2 ts. You may generate stream with:
# Open source CPU based:
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! x264enc key-int-max=30 insert-vui=1 tune=zerolatency ! h264parse config-interval=1 ! mpegtsmux ! rtpmp2tpay ! udpsink port=5004
# NVIDIA encoder
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvv4l2h264enc insert-sps-pps=1 insert-vui=1 ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink port=5004
and you would receive with:
# gstreamer using open-source CPU based decoder:
gst-launch-1.0 -v udpsrc port=5004 ! application/x-rtp,media=video,encoding-name=MP2T,clock-rate=90000, payload=33 ! rtpjitterbuffer latency=300 ! rtpmp2tdepay ! tsdemux ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
# On Jetson, using HW decoder:
gst-launch-1.0 -v udpsrc port=5004 ! application/x-rtp,media=video,encoding-name=MP2T,clock-rate=90000, payload=33 ! rtpjitterbuffer latency=300 ! rtpmp2tdepay ! tsdemux ! h264parse ! nvv4l2decoder ! nvvidconv ! xvimagesink
And you would also get it with VLC (note that for Jetson you would have to disable a plugin):
cvlc rtp://127.0.0.1:5004
or with FFMPEG:
ffmpeg -i udp://127.0.0.1:5004 -f xv display
# or
ffmpeg -i rtp://127.0.0.1:5004 -f xv display
(this may take some seconds to display).
- Yes, if you want to use RTPH264 with VLC or FFMPEG you would need a SDP file. Yours looks correct, try using the encoding pipelines such as:
# Open source CPU based:
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! x264enc key-int-max=30 insert-vui=1 tune=zerolatency ! h264parse config-interval=1 ! rtph264pay ! udpsink port=5004
# NVIDIA encoder
gst-launch-1.0 videotestsrc ! video/x-raw,width=320,height=240,framerate=30/1 ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvv4l2h264enc insert-sps-pps=1 insert-vui=1 ! h264parse ! rtph264pay ! udpsink port=5004
and it should be ok.
- If your network is wifi, you would try disabling multicast in udpsink properties (
auto-multicast=0
).