RTP In Through FFmpeg Works On Localhost But Not In Production

Hi, I am trying to re-encode an rtsp stream through ffmpeg and then sending it to mediasoup by utilizing plain transport. It works perfectly fine on localhost but in production, the remote track is always muted.

Here is the ffmpeg command i am using:

            const ffmpegArgs = [
              '-rtsp_transport', 'tcp','-i','rtsp://demo:rtspwebrtc@103.217.176.234:552', '-c:v', 'libx264', 
              '-preset', 'ultrafast',
              // '-tune', 'zerolatency',
              '-ssrc', '22222222', '-payload_type', '102',
             '-f','rtp', `rtp://37.27.0.12:${videoRtpPort}?rtcpport=${videoRtcpPort}`
            ]

I am creating the plain transport as below:

      const videoTransport = await router.createPlainTransport(
        { 
          listenIp :  {
            ip:'0.0.0.0',
            announcedIp:'37.27.0.12'
        },
          rtcpMux  : false,
          comedia  : true
        });

and producer on it as:

        videoProducer = await videoTransport.produce(
            {
              kind          : 'video',
              rtpParameters :
              {
                codecs :
                [
                  {
                    kind       : "video",
                    mimeType   : "video/H264",
                    payloadType: 102,
                    clockRate  : 90000,
                    parameters: {
                      "packetization-mode": 1,
                      "profile-level-id": "4d0032",
                      "level-asymmetry-allowed": 1
                  },
                    rtcpFeedback: []
                  }
                ],
                encodings : [ { ssrc: 22222222 } ]
              }
            });

I am creating webRTC transport and consumer as:

const transport = await mediasoupRouter.createWebRtcTransport({
    listenIps: [
        {
            ip:'0.0.0.0',
            announcedIp:'37.27.0.12'
        }
    ],
    enableUdp:true,
    enableTcp:true,
    preferUdp:true,
    enableSctp:true,
    initialAvailableOutgoingBitrate: 1000000
   })

  const VideoConsumer = await transport.consume({
            producerId:videoProducer?.id,
            rtpCapabilities:data?.rtpCapabilities,
            paused:false
        })

If i get the stats of plain transport, it shows that bytes are received regularly but while consuming it shows the track is muted. Any help will be much appreciated.

So i was able to solve it myself. Issue was related to ffmpeg and rtcp feedback. As in ffmpeg, there was no mechanism for NACK/PLI And Fir. I shifted to gstreamer and everything worked like a breeze. Gstreamer commad for anyone interested:

pipeline = Gst.parse_launch(f'''
    rtpbin name=r
    rtspsrc location=rtsp://demo:rtspwebrtc@103.217.176.234:552 !
    rtph265depay ! avdec_h265 ! videoconvert ! x264enc speed-preset=ultrafast !
    rtph264pay ! capssetter caps=application/x-rtp,payload=(int)102,clock-rate=(int)90000,ssrc=(uint)22222222,rtcp-fb-nack-pli=(int)1 !
    rtprtxqueue max-size-time=3000 ! 
    r.send_rtp_sink_0 r.send_rtp_src_0 !
    udpsink host=127.0.0.1 port={sys.argv[1]} r.send_rtcp_src_0 ! udpsink host=127.0.0.1 port={sys.argv[2]} sync=false async=false
    udpsrc ! r.recv_rtcp_sink_0
''')

New video producer setup:

        videoProducer = await videoTransport.produce(
            {
              kind          : 'video',
              rtpParameters :
              {
                codecs :
                [
                  {
                    kind       : "video",
                    mimeType   : "video/H264",
                    payloadType: 102,
                    clockRate  : 90000,
                    parameters: {
                      "packetization-mode": 1,
                      "profile-level-id": "4d0032",
                      "level-asymmetry-allowed": 1
                  },
                    rtcpFeedback: [
                      { type: 'nack' },
                      { type: 'nack', parameter: 'pli' },
                      { type: 'cm', parameter: 'fir' },
                      { type: 'goog-remb' }
                    ]
                  }
                ],
                encodings : [ { ssrc: 22222222 } ]
              }
            });

Note: I have used Gstreamer bindings for python