I have a scenario where I need to record videos produced by clients connected to the server. I need to record it server-side so I planned to use FFmpeg.
So I tried setting up the server and communications as stated in this section of the documentation: consuming media in an external endpoint with the additional setup to use WebRTC, as the clients are connecting through a web app using the mediasoup-client Device (the video is the camera recording).
But I’m struggling to record the output of the RTP Consumer. I get the
localPort from the transport, however I can’t figure out how to do this specific line:
You may need to build a “remote” SDP offer based on those transport and RTP parameters if your endpoint requires a SDP
When using a basic SDP file with FFmpeg, it throws the following error:
[udp @ 0x7fa884d04e40] bind failed: Address already in use
(Basic setup found on StackOverflow, I hope it is right…)
c=IN IP4 127.0.0.1 m=video 15856 RTP/AVP 101 a=rtpmap:101 VP8/90000
(101 and VP8 are set accordingly to the preferred parameters)
Also I understand that you are not FFmpeg experts! However I think this also has to do with Mediasoup as I need to create the sdp file and FFmpeg would have to read it to get the session parameters, and I don’t understand which parameters have to go there.
I first tried to use the rtp address as input (e.g., rtp://127.0.0.1:15856) for FFmpeg and also tried with VLC, but both threw the same error.
Also I have read similar topics on your forum but they were basically pointing to the docs…
(I also found a GitHub project recording with sdp but it seemed outdated: tan tan kanarek - Mediasoup server)
I would really appreciate if you have any idea on how to proceed. Please tell me if more information or a look at the code would help.
Also if I get this to work I would gladly publish this part of my program as an example for recording media with FFmpeg.
Thanks a lot!