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?
Thanks, I actually was able to fix this today!
So what I did was:
- Pause the consumer once it’s created on top of plain transport.
- Exchange the consumer’s rtp parameters with the external endpoint.
- In the external endpoint, based on the rtp parameters, generate an sdp file that contains all the necessary stream encodings.
- 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)
- 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)?