Warm tip: This article is reproduced from serverfault.com, please click

VLC read RTP multicast stream

发布于 2021-01-05 16:29:24

I'm trying to send a RTP stream using an UDP multicast address with this command:

gst-launch-1.0 /dev/video0 ! video/x-raw,format='NV16',width=1280,height=720,framerate=30/1 ! queue ! \
    omxh265enc control-rate=low-latency num-slices=8 gop-mode=low-delay-p periodicity-idr=30 cpb-size=350 initial-delay=250 target-bitrate=6000 ! queue ! \
    rtph265pay config-interval=1 mtu=1400 pt=96 ! \
    udpsink host=239.0.0.1 port=5000 auto-multicast=true multicast-iface=eth0 async=false max-lateness=-1 qos=true qos-dscp=60 max-bitrate=60000000 -v

I do not a have a rtsp address but I'm using a sdp file that I open with VLC:

v=0
m=video 5000/2 RTP/AVP 96
c=IN IP4 239.0.0.1
a=rtpmap:96 H265/90000

And this does not work(no image) however if I use a let's say 192.168.0.1 as the IP address then everything works fine. Spying on the ethernet interface with wireshark I can see the RTP packets being delivered to the client and the VLC console says it successfully opens the sdp file.

Questioner
vegalock
Viewed
0
vegalock 2021-01-06 22:29:27

While not directly answering the question I used gstreamer to convert multicast to unicast as a workaround:

gst-launch-1.0 udpsrc address=239.0.0.1 port=5000 auto-multicast=true multicast-iface=eth1 ! \
               queue ! \
               udpsink host=127.0.0.1 port=50000 async=false max-lateness=-1 qos=true qos-dscp=60 max-bitrate=60000000