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.