Inject stream freezes

I am all new to Mediasoup and am trying to inject a RTMP stream with the following FFmpeg command:

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"

The video when consumed freezes randomly and plays back after a while. I have tried the solution in Here but with no luck. I have also tried h264 codec and the result was the same.

I have tried the following gstreamer command too which has the same result too.

gst-launch-1.0 \
  rtpbin name=rtpbin \
  rtmpsrc location=rtmp://3.126.121.45:1935/live/stream \
  ! flvdemux name=demux \
  demux.video \
  ! queue \
  ! h264parse \
  ! decodebin \
  ! videoconvert \
  ! vp8enc target-bitrate=2000000 deadline=1 cpu-used=4 \
  ! rtpvp8pay pt=102 ssrc=22222222 picture-id-mode=2 \
  ! rtpbin.send_rtp_sink_0 \
  rtpbin.send_rtp_src_0 ! udpsink host="52.29.30.225" port="48875" \
  rtpbin.send_rtcp_src_0 ! udpsink host="52.29.30.225" port="48029" sync=false async=false \
  demux.audio \
  ! queue \
  ! decodebin \
  ! audioresample \
  ! audioconvert \
  ! opusenc bitrate=128000 \
  ! rtpopuspay pt=101 ssrc=11111111 \
  ! rtpbin.send_rtp_sink_1 \
  rtpbin.send_rtp_src_1 ! udpsink host="52.29.30.225" port="48988" \
  rtpbin.send_rtcp_src_1 ! udpsink host="52.29.30.225" port="46988" sync=false async=false

Can someone help me with a clue of what might cause this?

You can try -r 30 -g 30

Tried but the result is the same.