1

I am using the following ffmpeg command to inject an rtmp stream to mediasoup.

ffmpeg \
  -re \
  -v info \
  -stream_loop -1 \
  -i rtmp://3.126.121.45:1935/live/stream \
  -map 0:a:0 \
  -acodec libopus -ab 128k -ac 2 -ar 48000 \
  -map 0:v:0 \
  -c:v libvpx -minrate 2500k -maxrate 2500k -b:v 2500k -r 30 -g 60 -max_delay 0 -bf 0 -deadline realtime -cpu-used 1 \
  -f tee \
"[select=a:f=rtp:ssrc=11111111:payload_type=101]rtp://52.29.30.225:41299?rtcpport=40612&pkt_size=1300|[select=v:f=rtp:ssrc=22222222:payload_type=102]rtp://52.29.30.225:44083?rtcpport=48791&pkt_size=1300"

But the video seems to freeze randomly and plays again. Any idea how I can fix this? Tried the solution given here and here with no luck.

Update: Seems like it is the problem of RTP retransmission when some packets are lost. Unfortunately, ffmpeg doesn't fare well with RTP streaming as mentioned here. Meaning ffmpeg doesn't support retransmission mechanism like nack, pli etc. So considering gstreamer instead as suggested in the mediasoup discourse discussion.

HM Moniruzzaman
  • 135
  • 1
  • 11

0 Answers0