I'm streaming a video from an origin computer with ths command:
gst-launch-1.0 filesrc location = "test_video.mp4" ! decodebin ! videoconvert ! videoscale ! videorate ! "video/x-raw, width=1280, height=720, framerate=25/2" ! x264enc tune=zerolatency bitrate=500 ! rtph264pay config-interval=1 pt=96 ! udpsink host=<server public ip> port=50000
I need to consume this stream with gstreamer and re-send the stream to another 2 ports on the destination machine: one is in the localhost of the destination machine (127.0.0.1) and the second must be opened to consume the stream from any other computer, I'm doing this with this command:
#!/bin/bash
VMHOST="<public ip from server>"
DESTHOST=0.0.0.0 # Or ip for a specific machine
gst-launch-1.0 udpsrc address=$VMHOST port=50000 caps="application/x-rtp, media=video, encoding-name=H264, clock-rate=90000" ! tee name=t \
t. ! queue ! udpsink host=127.0.0.1 port=50001 \ # It works
t. ! queue ! udpsink host=$DESTHOST port=50002 # It doesn't
In resume, It is something like this:
[Source] -> [Server] -> [other port on Server]
\
v
[Stream consumed from any other PC]
The problem is that I can't open this stream on another computer, even with ffmpeg, gstreamer, or vlc, i'm trying to do this with this sdp file:
v=0
o=- 0 0 IN IP4 <public ip from server>
s=Video Stream
c=IN IP4 <public ip from server>
t=0 0
m=video 50002 RTP/AVP 96
a=rtpmap:96 H264/90000
If I set $DESTHOST to my public IP from my PC and I redirect the ports from my router, I can play the stream using the sdp file, but if I set $DESTHOST to 0.0.0.0, I think it should be streaming to any port, so I should open it on my PC, but I can't, I don't know if I need to change some settings on my sdp file or on one of my gstreamer pipelines.