Mediasoup plain transport RTP out is sending data but the external endpoint is saving 0 bytes

I have an sfu application and I created a plain transport to forward the producer stream to recording server,

Plaintransport.get_stats is showing that it’s sending data, however the external endpoint is having trouble handling the data and the output file is always 0 bytes.

P.S.1: the external endpoint works ok when I send test data through my pc camera or a test video, but when it comes to plain transport RTP out somehow trouble willoccur. (Test data payload type is 96 and have flag rtph264 and my external endpoint is saving rtp to h264 files),
The rtp_cpblt of the router has video/vp8 as mimetype and payload type as 101 I guess. ← not sure if this info have anything to do with the problem.

P.S.2: I apologize if I have a lack of knowledge about mediasoup and webrtc, so is there something I should provide for the discussion?

> * Note that comedia mode just makes sense when the remote endpoint is gonna produce RTP on this plain transport. Otherwise, if the remote endpoint does not send any RTP (or SCTP) packet to mediasoup, there is no way to detect its remote RTP IP and port, so the endpoint won’t receive any packet from mediasoup.

Does this sound like your issue? Read through the options, if you’re still struggling, you may need to share code that you use to open/connect these transports but just guessing right now.

1 Like

Thanks, I actually was able to fix this today!
So what I did was:

  1. Pause the consumer once it’s created on top of plain transport.
  2. Exchange the consumer’s rtp parameters with the external endpoint.
  3. In the external endpoint, based on the rtp parameters, generate an sdp file that contains all the necessary stream encodings.
  4. Launch an ffmpeg listener with the sdp file as an input eg: ffmpeg -i encodings.sdp (it’s easy to do, I followed: mediasoup3-record-demo/sdp.js at master · ethand91/mediasoup3-record-demo · GitHub)
  5. Once ffmpeg is launched, resume the paused consumer.

It worked like charm, I followed ethand91 code from js to my external endpoint language.

Once everything is okay, I will post again the ffmpeg commands to how the ex. Endpoint is handling the streams perfectly, is that okay (because probably I shouldn’t as this forum is mediasoup related and not ffmpeg… I thought it may help others someday)?

1 Like