Search code examples
ubuntustreamgstreamerrtpnvidia-jetson

Jetson TX2 multicast UDP stream with gstreamer


I'm trying to make a Jetson TX2 with Ubuntu 18.04 stream its CSI input encoded in H264 to UDP multicast with gstreamer. I've gone through (like) whole internet and tried all the codes and I'm unable to connect to it with VLC either by URL nor by SDP file. However I'm able to connect to it from same computer with another gstreamer instance. Target is to be able to connect to the stream from browser, but I guess it'd be easier to make it work with VLC.

Server code:

gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 ! udpsink host=239.127.1.21 port=5000

Receiver code: gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! xvimagesink

This works and the receiver code open window with the video. When I've tried to receive by VLC I've had some problems but basically nothing works and VLC is only connecting, I've tried:

  • vlc udp://:5000
  • vlc rtp://:5000 error: A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (96).
  • vlc udp://239.127.1.21:5000
  • vlc rtp://239.127.1.21:5000 (same error as above for the rtp...)
  • vlc v.sdp with sdp file:
v=0
c=IN IP4 239.192.1.21
m=video 5000 RTP/AVP 96 
a=rtpmap:96 H264/90000

I've tried various IPs - server's IP, localhost, I've tried to connect from another computer and tried various combinations of client's IPs and server IPs. I was unable to connect also to unicast but I need to make multicast work.

So my question basically is: how to connect to gstreamer stream from browser.


Solution

  • Could you try

    gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! omxh264enc ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! rtph264pay mtu=1400 config-interval=1 pt=96 ! udpsink host=239.127.1.21 port=5000
    

    with the sdp file

    v=0
    c=IN IP4 239.127.1.21
    m=video 5000 RTP/AVP 96 
    a=rtpmap:96 H264/90000