GStreamer UDP to VLC

Hello, I am unable to build a gstreamer pipeline to send video data over UDP to another machine running VLC. Firewalls have been disabled on both.

Jetson Xavier Transmit Command: gst-launch-1.0 -v videotestsrc ! x264enc ! rtph264pay ! udpsink host=192.168.2.10 port=5004

Windows PC VLC: sdp file with the following info

m=video 5004 RTP/AVP 96
c=IN IP4 192.168.2.10
a=rtpmap:96 H264/90000

Any advice would be greatly appreciated!

Many thanks

Hello,

Welcome to the NVIDIA Developer forums.
I’m moving your topic to the Jetson AGX Xavier category for greater visibility.

Tom K

Hi,
A user has shared a method in this post:
Gstreamer TCPserversink 2-3 seconds latency - #13 by Bazziil

Please give it a try.

A few things that may help:

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

  2. 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).

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

  1. If your network is wifi, you would try disabling multicast in udpsink properties (auto-multicast=0).

Thanks Honey_Patouceul. Turning off auto-multicast seemed to do the trick when running gstreamer on windows. I am still experiencing some issues with getting vlc to run but this has been massively helpful.

Out of interest, why does auto-multicast have to be set to false?

Multicast is not designed for wifi and can hog the wifi bandwidth, especially at 2.5GHz.

Google would tell more than me about that, but you can start reading this.

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